哪个constraint定义了每行的指定栏位必须满足的某种特定条件
- User
哪个constraint定义了每行的指定栏位必须满足的某种特定条件
- Assistant
CHECK constraint。
- User
哪些constraint可以在table level定义
- Assistant
以下是可以在table level定义的常见constraint:
- PRIMARY KEY constraint
- FOREIGN KEY constraint
- UNIQUE constraint
- CHECK constraint
- NOT NULL constraint
- User
For the following SQL statement, list all parent table(s).(對於以下SQL指令,列出所有父表。)
CREATE TABLE FOREIGN _ou
(id NUMBER(5)
CONSTRAINT primary_primary_id
PRIMARYKEY,
manager_id
NUMBER(6)
CONSTRAINT foreign_ manager_fk
REFERENCES
foreign_ ou (id),
department_id NUMBER(4)
CONSTRAINT foreign_ dept fk
REFERENCES,
departments (department id));
- Assistant
- foreign_ou (作为当前创建的表)
- departments (被引用的表,作为父表)
- User
For the table created, check the column(s) that can be null
CREATE TABLE emp_ ouyang
( employee_ id NUMBER(6)
CONSTRAINT
emp employee id แ PRIMARY KEY
, first_ name
VARCHAR2(20)
last name
VARCHAR2(25)
CONSTRAINT
emp_ last name nn NOT NULL
email
VARCHAR2(25)
CONSTRAINT
emp email nn
NOT NULL
CONSTRAINT
emp email uk
UNIQUE
job id
VARCHAR2(10)
CONSTRAINT
emp job_ nn
NOT NULL
, salary
NUMBER(8,2)
CONSTRAINT
emp_ salary ck
CHECK (salary-0)
commission pct NUMBER(2,2)
manager id
NUMBER(6)
CONSTRAINT emp_ manager fk REFERENCES
employees (employee id)
department id NUMBER(4)
CONSTRAINT emp_ dept fk
REFERENCES
departments (department id));
- Assistant
The following column(s) cannot be null:
- employee_id (PRIMARY KEY)
- last_name
- job_id
- department_id
The following column(s) can be null:
- first_name
- commission_pct
- manager_id