
- •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:
-
Relational tuple calculus Restricted variables, restricted logical connective and restricted quantifiers. Examples
-
Basic types of SQL Oracle
-
By using database from labs write expression in Relational agebra and Tuple relational calculus that answer to the following query: “Output days of week when teachers-assistants of the CS faculte have lectures in DBMS subject in groups of 3rd course”.
-
Create the database with the following tables:
Database of goods catalogue:
SUPPLIER – suppliear
PART – goods
CATALOG – goods cataloque
Table name |
Column name |
Data type |
Length (precis.) |
Scale |
Column integrity constraint |
SUPPLIER |
SNo |
NUMBER |
3 |
|
PRIMARY KEY |
Name |
VARCHAR2 |
30 |
|
UNIQUE, cannot be NULL |
|
Address |
VARCHAR2 |
50 |
|
UNIQUE |
|
FUND |
NUMBER |
6 |
2 |
Values are in the interval 0 - 500000 |
|
Registration |
Date |
|
|
Is in interval 01.01.1950-12.12.2012 |
|
Table integrity constraint |
Pair of columns (Fund, Registration) is unique |
||||
PART |
PNo |
NUMBER |
3 |
|
PRIMARY KEY |
Name |
varchar2 |
30 |
|
UNIQUE, cannot be NULL |
|
Cost |
NUMBER |
7 |
2 |
Cannot be negative |
|
Discount |
NUMBER |
7 |
2 |
Cannot be negative |
|
Table integrity constraint |
Discount must be less than 30% от Cost |
||||
CATALOG |
SNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column SNo of the table SUPPLIER. If supplier is deleted then all references to it are set to NULLЕ. |
PNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column PNo of the table PART. If part is deleted then all references rows in CATALOG are deleted too. |
|
QualiLevel |
CHAR |
1 |
|
Available values – ‘1’, ’2’, ’3’, ’4’, ’5’, ’6’ |
|
|
Quantity |
NUMBER |
4 |
|
Values are in the interval 0 - 1000 |
Table integrity constraint |
Pair of columns (SNo, PNo) is a primary key (PRIMARY KEY) |
Card 17
-
Relational algebra. Cartesian product and join operations. Examples
-
SQL language. Arithmetic operations with dates
-
By using database from labs write expression in Relational agebra and Tuple relational calculus that answer to the following query: “Outputs department names whose teachers have lectures in C++ subject.
-
Create the database with the following tables:
Database of the football matches:
TEAM – football team
STADIUM – stadium
MATCH – football matches
Table name |
Column name |
Data type |
Length (précis.) |
Scale |
Column integrity constraint |
TEAM |
City |
varchar2 |
50 |
|
|
Name |
varchar2 |
50 |
|
|
|
Country |
varchar2 |
30 |
|
Cannot be NULL |
|
NumOfPlayers |
NUMBER |
3 |
|
values are in the interval 1 - 100 |
|
Table integrity constraint |
Pair of columns (Name, City) is a PRIMARY KEY |
||||
STADIUM |
COUNTRY |
varchar2 |
30 |
|
|
Name |
varchar2 |
50 |
|
|
|
Quantity |
NUMBER |
6 |
|
values are in the interval 1 - 200000 |
|
TimeZone |
number |
2 |
|
cannot be negative |
|
Table integrity constraint |
Pair of columns (NAME, COUNTRY) is a PRIMARY KEY |
||||
MATCH |
Name1 |
varchar2 |
50 |
|
|
City1 |
varchar2 |
50 |
|
|
|
Name2 |
varchar2 |
50 |
|
|
|
|
City2 |
varchar2 |
50 |
|
|
|
SNAME |
varchar2 |
30 |
|
|
|
SCOUNTRY |
varchar2 |
50 |
|
|
|
DateTime |
date |
|
|
Is in interval 01.01.2000 – 31.12.2010 |
Table integrity constraint |
(Name1, City1) FOREIGN KEY, it references to the PRIMARY KEY of the table TEAM – it the first tean. (Name2, City2) FOREIGN KEY, it references to the PRIMARY KEY of the table TEAM – it is the second team. (SNAME, SCOUNTRY) FOREIGN KEY, it references to the PRIMARY KEY of the table STADIUM – place of the match List of columns (Name1, City1, Name2, City2, DateTime) is a PRIMARY |
Card 18