- •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:
-
What are logical and physical data independence? How they are supported in ANSI/SPARC database architecture?
-
SQL language. NULL/NOT NULL integrity constraints. Syntax and semantics. Examples.
-
By using database from labs write expression in Relational agebra and Tuple relational calculus that answer to the following query “Output group numbers of the 5th course that have lessons of the type ‘lab’ on the 1st week“ of the teachers- assistants of the CS faculty”
-
Create the database with the following tables:
Database of company structure:
ORGANIZATION – company, DIVISION – company division, DEPARTMENT – division pepartment
|
Table name |
Column name |
Data type |
Length (precis.) |
Scale |
Column integrity constraint |
|
ORGANIZATION |
ONo |
NUMBER |
3 |
|
PRIMARY KEY |
|
Name |
VARCHAR2 |
30 |
|
UNIQUE, cannot be NULL |
|
|
Director |
VARCHAR2 |
30 |
|
Cannot be NULL |
|
|
Fund |
NUMBER |
7 |
2 |
Cannot be NULL, Is in the interval 0-1000000 |
|
|
|
Foundation |
Date |
|
|
Is in interval 1.7.1970 – 20.12.2012 |
|
Table integrity constraint |
Pair of columns (Name, Director) is unique |
||||
|
DIVISION |
DNo |
NUMBER |
3 |
|
PRIMARY KEY |
|
Name |
varchar2 |
30 |
|
Cannot be NULL |
|
|
Head |
varchar2 |
30 |
|
|
|
|
OrgNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column ONo of the table ORGANIZATION. If organization is deleted then all its divisiona sre deleted too. |
|
|
Table integrity constraint |
Pair of columns (Name, OrgNo) is unique Pair of columns (Name, Head) is unique |
||||
|
DEPARTMENT |
DepNo |
NUMBER |
3 |
|
Cannot be NULL |
|
Name |
varchar2 |
30 |
|
Cannot be NULL |
|
|
NoOfEmp |
NUMBER |
2 |
|
Is in the interval 1 - 75 |
|
|
DivNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column DNo of the table DIVISION. It is not possible to delet division if there esist at least one department in it. |
|
|
Table integrity constraint |
Pair of columns (Name, DivNo) is a primary key (PRIMARY KEY) |
||||
Card 8
-
Hierarchy data structure and integrity constraints
-
SQL language. Membership condition an range condition. Examples
-
By using database from labs write expression in Relational agebra and Tuple relational calculus that answer to the following query “Output group numbers with rating > 50 of the faculty CS that have lectures in DBMS discipline on Monday of the 2nd week”
-
Create the database with the following tables: Database of site structure:
HOME_PAGE – site home page
REF_PAGE – pages that are referenced fron the home page
DOCUMENT – electronic document that are accessable from any page.
|
Table name |
Column name |
Data type |
Length (precis.) |
Scale |
Column integrity constraint |
|
HOME_PAGE |
HPNo |
NUMBER |
3 |
|
PRIMARY KEY |
|
Title |
VARCHAR2 |
30 |
|
|
|
|
URL |
VARCHAR2 |
150 |
|
Cannot be NULL |
|
|
BackgrType |
CHAR |
1 |
|
Cannot be NULL. Take values from the list (‘W‘,N‘,‘Q‘,‘K‘,‘S‘) |
|
|
FontType |
CHAR |
1 |
|
Cannot be NULL. Take values from the list (‘1‘,‘2‘,‘3‘,‘4‘,‘5‘,‘6‘,‘7‘,‘8‘) |
|
|
Table integrity constraint |
Triple of columns (Title, BackgrType, FontType) is unique |
||||
|
REF_PAGE |
RPNo |
NUMBER |
3 |
|
PRIMARY KEY |
|
Title |
VARCHAR2 |
30 |
|
Cannot be NULL |
|
|
URL |
VARCHAR2 |
150 |
|
Cannot be NULL, уникальный |
|
|
HomePNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column HPNo of the table HOME_PAGE. If home page is deleted, then all its child pages are deleted too. |
|
|
Table integrity constraint |
Pair of columns (Title, HomePNo) is unique. |
||||
|
DOCUMENT |
DocNo |
NUMBER |
3 |
|
Cannot be NULL |
|
Title |
VARCHAR2 |
30 |
|
Cannot be NULL |
|
|
URL |
VARCHAR2 |
150 |
|
Cannot be NULL, уникальный |
|
|
Type |
CHAR |
3 |
|
Take values from the list (‘txt’, ‘doc’, ‘pdf’, ‘bmp’) |
|
|
Created |
Date |
|
|
Must be more than 01.10.2002 |
|
|
Updated |
Date |
|
|
|
|
|
RefPNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column RPNo of the table REF_PAGE. If the page is deleted then all references to it are set to NULL. |
|
|
|
HomePNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column HPNo of the table HOME_PAGE. It is not possible to delete home page if there exists at least one document that references to it. |
|
Table integrity constraint |
Pair of columns (DocNo, Title) is unique Difference between Updated and Created must be more than 2,5 days |
||||
Card 9
-
Hierarchy data model operations
-
SQL language. Purpose and possibilities of the ALTER TABLE statement. Examples
-
By using database from labs write expression in Relational agebra and Tuple relational calculus that answer to the following query “Output group numbers of the CS faculty that have lectures in thje 1st week in rooms with number of seats less than number of students in a group”
-
Create the database with the following tables: Database of menu structure:
MENU_BAR – menu bar, MENU_POPUP –menu popup, SUBMENU_POPUP –submenu popup
|
Table name |
Column name |
Data type |
Length (precis.) |
Scale |
Column integrity constraint |
|
MENU_BAR |
ItemNo |
NUMBER |
3 |
|
PRIMARY KEY |
|
Item_Name |
VARCHAR2 |
30 |
|
UNIQUE, Cannot be NULL |
|
|
Item_Color |
NUMBER |
3 |
|
Cannot be NULL, is in interval 20-400 |
|
|
BackgrType |
CHAR |
1 |
|
Cannot be NULL. Take values from the list (‘Р‘,‘F‘,‘C, ‘W‘,‘K‘ ‘) |
|
|
Table integrity constraint |
Triple of columns (Name, Item_Color, BackgrType) is unique - UNIQUE |
||||
|
MENU_POPUP |
MPNo |
NUMBER |
3 |
|
PRIMARY KEY |
|
Com_Name |
VARCHAR2 |
30 |
|
Cannot be NULL |
|
|
Com_Color |
NUMBER |
3 |
|
Cannot be NULL. Cannot be less than 0 |
|
|
MN_BARNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column ItemNo of the table MENU_BAR. If menu bar is deleted then all its child menu popups are deleted too. Cannot be NULL |
|
|
Table integrity constraint |
Pair of columns (Com_Name, MN_BARNo) is unique – UNIQUE |
||||
|
SUBMENU_POPUP |
SMPNo |
NUMBER |
3 |
|
PRIMARY KEY |
|
Com_Name |
VARCHAR2 |
30 |
|
Cannot be NULL |
|
|
Com_Color |
NUMBER |
3 |
|
Cannot be NULL. Cannot be less than 0 |
|
|
SM_BARNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column MPNo of the table MENU_POPUP. If the Menu POPup is deleted then all referenced SUBMenu PopUp are deleted too. Cannot be NULL |
|
|
|
HomePNo |
NUMBER |
3 |
|
FOREIGN KEY, references to the column HPNo of the table HOME_PAGE. If the Home Page is deleted then all referenced SUBMenu PopUps are set too NULL. |
|
Table integrity constraint |
Triple of columns (Com_Name, Com_Color, SM_BARNo) is a primary key |
||||
Card 10
