Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
BD / Exams / English / Module Control Work 1 Cards.doc
Скачиваний:
22
Добавлен:
20.02.2016
Размер:
887.3 Кб
Скачать
  1. Relational algebra. Equi-join, natural join and semi-join operations. Example

  2. SQL language. CHAR и VARCHAR2 types

  3. By using database from labs write expression in Relational agebra and Tuple relational calculus that answer to the following query: “Output department names whose teachers have lectures in room 200 of the 6 builting on Mondau of the 2nd week

  4. Create the database with the following tables:

Database of the family tree:

PERSON – info about persons and their parents

Table name

Column name

Data type

Length

(precis.)

Scale

Column integrity constraint

PERSON

Name

VARCHAR2

25

Cannot be NULL

TaxID

NUMBER

8

UNIQUE, cannot be NULL, default value - 0

Sex

CHAR

1

List of possible values – (‘M’, ’F’)

BirthDate

Date

Must be more than 01.01.1930

Pas_Ser

CHAR

2

Default value‘XX’

Pas_Nom

CHAR

6

Default value ‘000000’

M_Pas_Ser

CHAR

2

M_Pas_Nom

CHAR

6

F_Pas_Ser

CHAR

2

F_Pas_Nom

CHAR

6

Table integrity constraint

Pair of columns (Pas_Ser, Pas_Nom) is a PRIMARY KEY

Pair of columns (Name, BirthDate) is unique – UNIQUE

Pair of columns (M_Pas_Ser, M_Pas_Nom) is a FOREIGN KEY. It references to the pair of columns (Pas_Ser, Pas_Nom) of the same table (it references the the mother of the person).

Pair of columns (F_Pas_Ser, F_Pas_Nom) is a FOREIGN KEY. It references to the pair of columns (Pas_Ser, Pas_Nom) of the same table (it references the the father of the person).

When person is deleted then all references to it as a mother/father are set to NULL.

  1. Card 19

  1. Relational algebra. Left join, right join and full join operations.

  2. SQL language. Purpose nad possibilities of the UPDATE statement. Examples

  3. By using database from labs write expression in Relational agebra and Tuple relational calculus that answer to the following query: “Output department names whose teachers-assistants have lectures on Monday in the groups of the 6th course

  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

Pair of columns (Ag_No, Ras_No) is 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 0

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 1/3 value of the column Part_Price

Card 20

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