Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
BD / Exams / English / Module Control Work 1 Cards.doc
Скачиваний:
19
Добавлен:
20.02.2016
Размер:
887.3 Кб
Скачать
  1. Network data structure and integrity constraints

  2. SQL language. Purpose and possibilities of the DROP TABLE statement. Examples

  3. By using database from labs write expression in Relational agebra and Tuple relational calculus that answer to the following query: ” Output group numbers and ratings of the 2rd course on CS faculty that have lectures by teachers-professors on the 1st week”

  4. Create the database with the following tables:

Database of agregate/parts:

AGREGATE – agregate, ASSEMBLY – agregare assembly, PART – aggregate/assembly part.

Table name

Column name

Data type

Length

(prec)

Scale­

Column integrity constraint

AGREGATE

AGNo

NUMBER

3

PRIMARY KEY

Ag_Name

VARCHAR2

25

Cannot be NULL

AG_Weight

NUMBER

6

3

Cannot be NULL

AG_Type

CHAR

1

Cannot be NULL. Take values from the list (‘1‘,‘2‘,‘3‘,‘4‘,‘5‘)

Table integrity constraint

Pair of columns (Ag_Name, AG_Type) is unique - UNIQUE

ASSEMBLY

ASNo

NUMBER

3

PRIMARY KEY

As_Name

VARCHAR2

30

Cannot be NULL

AS_Color

NUMBER

3

Cannot be NULL. Cannot be less than 0

AG_No

NUMBER

3

FOREIGN KEY, references to the column AGNo of the table AGREGATE. If aggregate is delete then all its child assemples are deleted too

RASNO

NUMBER

3

FOREIGN KEY, references to the column ASNo of the table ASSEMBLY. It is not possible to delete assembly if there exists at least one child assembly

Table integrity constraint

4 columns (Ag_No, Ras_No) фку unique

PART

Part_Name

VARCHAR2

30

Cannot be NULL

Part_Price

NUMBER

8

2

Cannot be NULL. Cannot be less than 0

Part_ discount

NUMBER

8

2

Cannot be less than 50

AGNo

NUMBER

3

FOREIGN KEY, references to the column AGNo of the table AGREGATE. If aggregate is delete then all its child parts are deleted too

ASNo

NUMBER

3

FOREIGN KEY, references to the column ASNo of the table ASSEMBLY. If aggregate is deleted then all references to it are set to NULL

Table integrity constraint

Pair of columns (Com_Name, SM_BARNo) is a primary key

Value of the column Part_ discount must be less than 3/17 value of the column Part_Price

Card 11.

Соседние файлы в папке English