Sei sulla pagina 1di 1

UNIVERSITY OF INFORMATION TECHNOLOGY LAB EXAM – SET 1 (MSIS4013.H21.

CTTT)
DEPARTMENT OF INFORMATION SYSTEMS TERM II, ACADEMIC YEAR 2016-2017
Database system design, management and
administration
Duration: 60 minutes (References are not allowed)
For the following relation schema:
Employee (employee-name, street, city)
Works (employee-name, company-name, salary)
Company (company-name, city)
Manages (employee-name, manager-name)
1. Consider the above relational database schema and write the required DDL statements (Oracle). Include
the required primary key, foreign key constraints. Use any valid data types. Add your sample data into
tables. (3 points)
2. Write a SQL query to list the names, street address for all employees who work for companies located
in the "New York" city. (2 points)
3. Write a PL/SQL block to print the names of all employees who earn more than the average salary of
all employees of their company. Assume that all people work for at most one company (5 points).
Lecturer

UNIVERSITY OF INFORMATION TECHNOLOGY LAB EXAM – SET 2 (MSIS4013.H21.CTTT)


DEPARTMENT OF INFORMATION SYSTEMS TERM II, ACADEMIC YEAR 2016-2017
Database system design, management and
administration
Duration: 60 minutes (References are not allowed)
For the following relation schema:
Employee (employee-name, street, city)
Works (employee-name, company-name, salary)
Company (company-name, city)
Manages (employee-name, manager-name)
1. Consider the above relational database schema and write the required DDL statements (Oracle). Include
the required primary key, foreign key constraints. Use any valid data types. Add your sample data into
tables. (3 points)
2. Write a SQL query to list the names, street address, and cities of residence for all employees who work
for 'First Bank Corporation' and earn more than $10,000. (2 point)
3. Write a PL/SQL block to print each of the company name (company-name), total number of
employee of which. Only list companies which have total number of employee more than 3. Assume
that all people work for at most one company (5 points).
Lecturer

Potrebbero piacerti anche