Primary key, foreign key, natural primary key, surrogate primary key, relational databases and non-relational databases

Relational databases :

The complex data structures converted into a two-dimensional table that is using the relational model to organize data into a two-dimensional data table by SQL that is structured query statements to manipulate data : Jpa late to learn object-oriented query jpql operating statement data

 

Oracle

Oracle ( Oracle / domain of God )

Stable operation and high portability, full-featured, superior performance! For large corporate sector. Corporate charges.

DB2

IBM

Fast, good reliability, suitable for massive data recovery resistant. For medium to large corporate sector.

SQL SERVER

Microsoft

Comprehensive, efficient, user-friendly, easy to operate, but not cross-platform. Suitable for small and medium enterprise sector.

MYSQL

AB-->SUN-->Oracle

Open source free, small, fast. Suitable for small and medium enterprise sector.

 

Non-relational databases (Not Only SQL)

  It is to enhance the relational database in high performance, high concurrency and health ;

 

① value store ( Key-value ): Redis , the Memcached   - memory database (fast)

 

② column stores: Hbase

 

③ document database: MongoDB

 

④ graph database: Graph

Primary key:


A relational database table in a unique and non-null called primary key (such as id, user name that antialiased)

  It is used to ensure that the latter will call record (record is a table row of data, also known as a target) uniqueness. Simply put, with a database table, multiple records are not allowed the same primary key exists.

Foreign key:


  A foreign key for associating the table with another table. It is able to determine the field of another table records, for maintaining data consistency.

Than to say there is a table parent_id this field is the primary key field is the addition of a table, parent_id called the foreign key field

Natural primary key:

 

 

 

Natural primary key and a surrogate primary key on the classification of the primary key, the primary key of a record that he is the identification

Natural primary key is the primary key has a special meaning, for example, we username as the primary key id, he also represents the user, such as provinces certificate as the primary key, you identify this man, than say this type of id card

Represents the primary key:

Like 1,2,3. . . . meaning that no n;

related:

Object id; is a record (an object) ID;

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/13438145925xiaozheng/p/11241624.html