- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Card 19
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
- •Create the database with the following tables:
-
Create the database with the following tables:
Database of company structure:
COMPANY – company, DEPARTMENT – departments of the company, PERSON – persons in departments
|
Table name |
Column name |
Data type |
Length (prec) |
Scale |
Column integrity constraint |
|
COMPANY |
CPK |
NUMBER |
3 |
|
PRIMARY KEY |
|
Name |
VARCHAR2 |
25 |
|
Cannot be NULL |
|
|
Type |
NUMBER |
1 |
|
values are in the interval 1-9 |
|
|
Promotion |
DATE |
1 |
|
values are in the interval 01.01.1950-31.12.2000 |
|
|
Director |
NUMBER |
3 |
|
FOREIGN KEY, it references to the primary key of the table PERSON. If director is deleted then reference to it is set to NULL |
|
|
Table integrity constraint |
Pair of columns (Name, Type) is unique - UNIQUE |
||||
|
DEPARTMENT |
DPK |
NUMBER |
3 |
|
PRIMARY KEY |
|
Name |
VARCHAR2 |
30 |
|
Cannot be NULL |
|
|
Num |
NUMBER |
2 |
|
values are in the interval 2-95 |
|
|
СFK |
NUMBER |
3 |
|
FOREIGN KEY, it references to the primary key of the table COMPANY. If company is deleted then all its departments are deleted too |
|
|
Chief |
|
|
|
FOREIGN KEY, it references to the primary key of the table PERSON.. It is not possible to delete a person if it is a chief of department |
|
|
Table integrity constraint |
Pair of columns (СFK, Chief) is unique |
||||
|
PERSON |
PPK |
NUMBER |
3 |
|
PRIMARY KEY |
|
Name |
VARCHAR2 |
30 |
|
Cannot be NULL |
|
|
Post |
VARCHAR2 |
27 |
|
Takes one of the following values: programmer, analyst, designer, director, chief of department |
|
|
BirthDate |
Date |
4 |
2 |
Cannot be less than 01.01.1930 |
|
|
DFK |
NUMBER |
3 |
|
FOREIGN KEY, it references to the primary key of the table DEPARTMENT. It is not possible to delete department if there exists at least one person in it |
|
|
Boss |
NUMBER |
3 |
|
FOREIGN KEY, references to the column PPK of the same table. If boss is deleted then al references to it are set to NULL |
|
|
Table integrity constraint. |
|
||||
Card 14
