Some concepts of database:
A relational database structures data in tables, tables could be regarded as matrixes with columns and rows. Columns mean the title, the categories while rows contain the actual data for each category. Columns are also called “fields”, and rows are also called “records”.
Entity table: a table which is used to store things that are in the real world. We use different categories to describe those aspects of those things to make them different from other records.
Relation table: a table which specify the relation between the entity tables.
Primary Key: a primary key is a field that each record’s data in this field could not be the same as others. This data should be unique. In the database design, for every entity table, there should be a field that is defined as a primary key. It would also be good to define such a primary key for the relation table to make the records easier to reach.
That might be some rules that we should set up to make our database more structured and easy to be used and maintained.
In my opinion, there should be a primary key field called “id” in each table. We could use this field to be the index of each table. Also we should put the data created date and the data modified date to make it possible to trace the modification of each record. In those tables which could be modified by users (other than those only be controlled by the administrator) we may put in a field to specify who create this record. Together with the created date and the modified date, it would be easy to control and trace the data.
Any other idea for the database schema? I think that we should decide some common rules for the database structure first.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment