Database
Some data files that are stored on your hard disk
is organized according to the data structure. Warehouses for storing and managing data
Memory only temporarily stores some data
The common database has
IBM's DB2 orcle Sybase informix Sol Server
. NET--sql Server
PHP--mysql
Jave--oreacl
data types in SQL database
int number
Decimal (5,2) 5 indicates that a decimal length of 2 means a few digits behind the decimal point
Bit-Boolean type 1-true 0-false
DateTime-Time Date type
nvarchar (length) Max string (max)
varchar (length)
Text-long text
relational database
There are 4 kinds of constraints
PRIMARY KEY constraint;
There is no limit to the data type of the primary key column, but this column must be unique and not empty.
FOREIGN KEY constraints;
Create a constraint between two tables
One of the columns of the current table is constrained by one of the primary key columns/unique columns of the other table
The contents of the column in which the current table is constrained are not allowed to exceed the contents of the column that constrains it
The only constraint;
Unique constraint setting a column unique cannot have a repetition can have an empty;
Cheak constraints;
Constrain the expression range of a value write an expression that is not the same as C # && is and | | IS OR
Set Primary key primary key is preceded by a key
Create a simple table with the mouse
A FOREIGN KEY constraint constrains another table with one table;;
Getting Started with databases