I. Overview of the database
1. Disadvantages of saving data in a custom file format: Poor concurrency, poor speed of finding data.
2. DBMS (Database Management system) and database. Usually talk about the meaning of "database" (1) MSSQLServer, Oracle and other DBMS; (2) A classification (catalog) of a bunch of data tables.
3. Different brands of DBMS have their own different features: MYSQL (suitable for developing websites, fast, not strict, may lose data), MSSQLServer, DB2, Oracle, Access, Sybase, etc.
4. SQL//Refers to query statements
Sql server
MSSQLServer//Microsoft Database
5. In addition to file-type databases such as Access, SqlServerCe, most databases require a database server to run. Learning, development is connected to the local database, on-line runtime is the database running on a separate server.
Ii. Concepts in the database
1. Catalog (classification): (also known as database, Tablespace tablespace), non-homogeneous data should be placed in different databases:
(1) Easy to personalize the individual catalog management
(2) Avoid naming conflicts
(3) Higher security
2. Table: Different things in different places, different types of data placed in different "lattice", this area is called "table". Different tables are optimized for space based on the data they are placed in, and are easy to find.
3. Columns (column), Fields (field)
Third, primary KEY (PrimaryKey): The column that uniquely identifies the data row is called the primary key
1. The primary key is the unique identifier of the data row. Columns are not duplicated to be primary keys. There are no special reasons to set the primary key for the table.
2. Two first-use policies for primary keys: Business primary KEY and logical primary key
(1) Business key is the use of business-meaningful field key, such as Social Security numbers, bank accounts and so on.
(2) Logical primary key is the use of meaningless fields of the key, completely to the program, the business people will not look at the data, such as the serial number. The logical primary key is recommended because it is difficult to ensure that the business primary key is not duplicated (for example, the ID number is duplicated) and does not change (for example, account rise, phone number).
Iv. Association between tables, foreign keys (ForeignKey)
SQL from beginner to basic-01 database development and ADO