1. Each table is gradually the object +id, the primary key + auto increment. No GUID.
2. Add 4 tracking fields per table: Insertdate,insertuserid, add time and add people, updatedate,updateuserid the last update time and update people, a total of four fields. If you are sure to use SQL SERVER, you can name it. if it is a product, in order to support multiple databases, or separate to good, such as: insert_date all lowercase, so naming is also a good choice, unified up can be. If I do, in the SQL Server database, I still prefer to name the case, Oracle with less, Oracle must be "_" separate.
3. Date unification with DateTime, whether the wrong is unified with the bit field, with the Chinese text byte unified with nvarchar, only in English with varchar, the price with a decimal point of the Unification of Decimal (10,2), almost all of these already contain all the field types.
4. Any table name does not use abbreviations, and the words are separated from the words by _.
5. Date-related table field suffix are date, the number of metric suffixes are used by the count, the message is used with the price, the prices are used cost, the link with the URL, the image with the image, points with point, record log with records, configuration with config, State with status, pattern mode with mode, classification are unified with category, class type unified with type, factory with factory, orders with order, users with user, admin with admin, password Password, comment Notes are used remark, Article article, news, imports with import, export with export, enable enabled, whether it is, described with description, The logo is marked with flags. Corporate companies with company, products with product, Province province, Urban city, county and county with district, address with a role, permissions with permission, login with login, Launched with logout, create unified with Create, delete with delete, update with update, get with GET, photos with photo, picture with image. Contact person Linkman.
Database design: Some points of attention in database SQL Server design