0% found this document useful (0 votes)
67 views

DatabaseSystem II

The document is a past exam paper for a Database Systems II theory exam. It contains 5 questions testing knowledge of database concepts like foreign keys, data manipulation language, relationships, aggregate functions, SQL commands, and creating database objects like tables and views using SQL. It also covers topics like triggers, stored procedures, cursors, transactions, and the roles and responsibilities of a database administrator.

Uploaded by

Ernest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

DatabaseSystem II

The document is a past exam paper for a Database Systems II theory exam. It contains 5 questions testing knowledge of database concepts like foreign keys, data manipulation language, relationships, aggregate functions, SQL commands, and creating database objects like tables and views using SQL. It also covers topics like triggers, stored procedures, cursors, transactions, and the roles and responsibilities of a database administrator.

Uploaded by

Ernest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

All rights reserved.

Tertiary and Vocational Education Commission


NVQ Level 05 – Semester II

Information & Communication Technology

Database Systems II – Theory K72T001M02 Three Hours

Answer only 04 questions (Question 01 and 02 are COMPULSORY).

Question 01

1.) Explain the following terms briefly. (Marks 12)


a) Foreign key
b) DML (Data Manipulation Language)
c) Many-to-many relationship
2.) Explain any four aggregate functions with example. (Marks 08)
3.) List two data manipulation (DML) commands in SQL. (Marks 05)

Consider the following relations for Question 02 and Question 03:

Employee (emp_id:integer, emp_name:varchar(15), designation: varchar(10), dob: date,


hire_date:date, salary:decimal(10,2), commission: decimal(7,2), dep_id:integer)
Department (dep_id: integer, dep_name: varchar(20), dep_location: varchar(15))
Salary_Grade (grade: integer, min_salary: integer, max_salary: integer)

Question 02

1.) Write SQL statement to create a Department table with the PRIMARY KEY constraint.
(Marks 05)
2.) Write the following queries in SQL using above relations:

a) Display the salaries of all the employees’ with employee name and designation
according to ascending order of employee name.
(Marks 05)
b) Display the unique designations for the employees. (Marks 05)
c) List out all the employee names whose designation is ‘CLERK’. (Marks 05)
d) Find the employee names whose salaries are less than 3500. (Marks 05)

Page 1 of 2
Question 03

Write the following queries in SQL using above relations:

1.) Find the average salaries of all the employees who work as ‘ANALYST’.
(Marks 04)
2.) Find the employee names whose are either ‘CLERK’ or ‘MANAGER’ designation.
(Marks 04)
3.) Find the employee names, designations and salaries with department names.
(Marks 05)
4.) Find the employee names whose salary grade is 4.
(Marks 06)
5.) List all the employee names except ‘CLERK’ and ‘MANAGER’ designations according to
the descending order of salaries. (Marks 06)

Question 04

Consider following Employee table for the sections 2 and 3

Employee (emp_id:integer, emp_name:varchar(15), designation: varchar(10), dob: date,


salary:decimal(10,2))

1.) What is a Trigger? (Marks 05)

2.) Create a stored procedure to get the employee name, and dob of all employees from the
above Employee table. (Marks 07)

3.) Create a view employee with emp_id, emp_name and salary where salary=55000 from
employee table. (Marks 07)

4.) What is difference between DELETE and TRUNCATE commands? (Marks 06)

Question 05

1.) What is Cursor? (Marks 06)


2.) What is the difference between COMMIT and ROLLBACK? (Marks 06)
3.) Write two ways in which a database developer might increase the performance of database
transactions. (Marks 07)
4.) Write two responsibilities of Database Administrator (DBA). (Marks 06)

Page 2 of 2

You might also like