Design of MySQL Database

Source: Internet
Author: User

Database design has a rigorous process, according to the process of making a complete database, you can save a lot of time, but also to the greatest extent with the customer's ideas fit.

Requirements Analysis phase: Analyze customer's business and data processing requirements

Summary design phase: Design The E-R model of the database to confirm the correctness and completeness of the requirement information

Detailed design phase: Application of three major paradigms to audit database structure

Code writing phase: physical implementation of the database, encoding implementation of the application

A hospital ward Computer Management Center needs the following information: Department: section name, branch address, telephone, doctor name Ward: Ward number, bed number, the department name of the Doctor: name, title, department name, age, ID number of patients: Medical record number, name, gender, diagnosis, competent physician, ward number of which, A ward can only belong to a department, a department may have multiple wards, a doctor only belong to a department, a department can have more than one doctor, a doctor can be responsible for the diagnosis and treatment of multiple patients, a patient's competent doctor only one. A patient can only stay in one ward, and a ward may accommodate multiple patients. Complete the following design: (1) the E-r Diagram (2) of the Computer Management system is designed to convert the E-r diagram into a relational schema structure.

1. If it is a 1:1 relationship: then convert the entity to a table, the primary key of any 1-side entity to the other end of the entity to do foreign keys. 2. If the relationship is 1:n: then the entity is converted into a table, the relationship is not a table, the 1-side entity's primary key to the N-side entity to do foreign keys. 3. If the relationship is m:n: convert the entity into a table, the relationship forms a table, and the primary key of the two entities is taken as the foreign key of the table, forming a composite primary key.

Design of MySQL Database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.