数据库(database)

数据库中有五大约束

       1、主键约束(Primay Key Coustraint) 唯一性,非空性

  2、唯一约束 (Unique Counstraint)唯一性,可以空,但只能有一个

  3、检查约束 (Check Counstraint)对该列数据的范围、格式的限制(如:年龄、性别等)

  4、默认约束 (Default Counstraint)该数据的默认值

  5、外键约束 (Foreign Key Counstraint)需要建立两表间的关系并引用主表的列

四个主要事件分别为

SELECT(查询):select from 表名 where 条件(条件1 and 条件2)

INSERT(插入):insert into 表名(列1,列2) values(‘ ‘,’ ‘),(‘ ‘,’ ‘),(‘ ‘,’ ‘)

DELETE(删除):delete from 表名 where 条件

UPDATE(修改):update 表名 set 列名=’ ‘,列名=’ ‘ where 条件

————————

There are five constraints in the database

1. The primary key constraint is unique and non empty

2. Uniqueness of unique constraint. It can be empty, but there can only be one

3. Check constraints on the range and format of this column of data (such as age, gender, etc.)

4. Default constraint: the default value of the data

5. Foreign key constraint needs to establish the relationship between the two tables and reference the columns of the main table

The four main events are

Select: select from table name where condition (condition 1 and condition 2)

Insert: insert into table name (column 1, column 2) values (‘,’ ‘), (‘, ” ‘), (‘, ” ‘)

Delete: delete from table name where condition

Update (modify): update table name set column name = ”, column name = ” where condition