One
Scene:
Web page through the user name and password landing to the homepage of the site, but also to know the user's details, such as home address, education, contact telephone, whether married, entry/departure time and other information;
General website Registration when registering a user name and password, and then you enter the site, prompting you to improve the personal information;
Build table:
A base_user table with ID, username, password
A user table with Base_user ID, home address, educational background, contact number, married, entry/departure time
Many-to-one (set the associated field on multiple sides), a-to-many (set the associated field on many sides), many-to-many (intermediate table)
Scene:
Fund industry, fund product information, net Fund product, fund product announcement, fund manager
Fund product information and fund products net value is a one-to-many relationship, a product work date has a net production;
Fund product information and fund product announcements is a one-to-many relationship, each product has a number of articles introducing the product, these articles are for the product;
Fund product information and fund managers are many-to-many relationships, a product has a number of product managers in the management, a manager to manage a number of products;
Build table:
Fund product information: ID, product name, product size, date of incorporation, risk-benefit characteristics, product type, minimum subscription amount, etc., but the product type is more than one product may be the same type, so you can put the type of product in a table, easy to manage
(The relationship between fund product information and product type is many to one);
NET value of the fund product: ID, ID of the associated product, unit value, date, etc.
Fund announcement: ID, associated Product ID, content, date, etc.
Fund managers and fund products are many-to-many relationships, with an intermediate table
Intermediate table information: ID, fund manager ID, fund product ID, appointment time, separation time, etc.
Fund manager: ID, name, education, whether married; but in the manager, some information in the manager's personal CV can be individually designed for a table, such as from educational situation, work experience, work in that job, etc.
Outside the topic:
Users and roles, roles and menus, roles and site columns are many-to-many relationships
Background CMS Management:
One-to-one situation, display your ID, user name, last login time and then click on a button to pop up a fill in the details of the information entered into the details of the table, ID is the user's ID;
One-to-many or many-to-one on a multiple (association ID) side provides a select drop-down box that selects one of that ID;
Many-to-many, can be separate for the intermediate table input, you can also use radio to select, and then insert into the intermediate table (such as user and role relationship, the user is the role is many-to-many relationships, but usually to let the user choose multiple roles, the same role can be more than one person);
Essays-Relationship of database tables