DBS Final Exam - S2020
DBS Final Exam - S2020
DBS Final Exam - S2020
Database Systems-IT2421
02 July, 2020
GOOD LUCK
Task 1 – Introduction 5M
(a) Why we use Data Model in database systems? Give one example application
where/when we use Network and Relational data models? 2.5M
1
(b) Why we use constraints in database? What types of constraints used in RDBMS?
Provide any basic example with your own understanding. 2.5M
2
You are asked to create a database for the university administration. They
describe that they want the following objects in their system:
Course having title, number, and quarter
Student having name and year of study
Teaching Assistant having name and contract
PhD Student having name and thesis topic
Lecturer having name and position
They also describe the relationships between these objects: Each course is
taught by a lecturer and a teaching assistant. Students follow a number of
courses. Each PhD student is associated with a lecturer who is his supervisor.
Keep in mind that both PhD students and teaching assistants are students.
(a) Create an E/R diagram capturing the objects and relationships described above.
Describe all constraints. Please use the notation for E/R diagrams introduced in
the course book.
(b) Transfer the E/R diagram from (a) to the relational model. Describe the process
you have made.
3
Task 3 – Relational model, SQL for Data-Definition, DML, Queries 4M
4
(b) The price of a car has to be a positive integer. Give a CREATE
TABLE statement for creating the table Car that respects this.
(c) Write a SQL statement that lists the names of all sales-men together
with the number of their sales.
(d) Write one SQL statement that increases the price of all Fords by
15%.
(e) What is a wild-card query in SQL? Where we use it? Give one example
with your own understanding. 3M
5
Task-4 JOINS using SQL, Relational Algebra 3M
Write the possible Relational Algebra queries as well as SQL queries for the following
statements!
(a) Who teaches cs1200 and ma3000?
(b) What are the names of students who are taking a subject not taught by
Roger?
6
What is the resultant table of following snippet? 2M
Task 5 – Normalization 5M
7
amount of time. The table below lists the time spent by each of the
company’s employees at other companies to carry out projects. The
National Insurance Number (NIN) is unique for every member of staff.
8
9
10