SQL from beginner to basic-01 database development and ADO

Source: Internet
Author: User
Tags mssqlserver

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

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.