You are on page 1of 2

Subject no.

73

1. Indicate the correct answers:


1.) A DBMS is: (a.) a hardware system; (b.) the total number of tables within the database; (c.) a
software system; (d.) a computerized system; (e.) a system that treats all the database access
requests.
2.) The term "secondary memory" refers to: (a.) special types of memories with fast access, for
the temporary storage of the data; (b.) Random Access Memories (RAM) (c.) a type of
memory usually employed for the permanent storage of the data; (d.) special types of slow
memories usually employ for data archiving; (e.) the cache memory.
3.) The term "aggregation" refers to: (a.) the connections between the tables; (b.) the whole-part
relationship; (c.) the possibility to define subtypes starting form a generic type; (d.) the
possibility to define a class of entities starting from its' sub-classes; (e.) the possibility to
define a class starting from entities which have the same attributes

2. Translate the following E-R diagram into relational model, by indicating the schemes of
the resulting tables (table names and field names between round parentheses, specifying PK
for the primary key and FK for the foreign key) and the type of the relations between the
resulting tables (e.g. Student-Groups 1-n; Student-Teachers m-n):

3. Given the relation schemes:

Students (Stud_Id, Name, Surname, Date_of_birth)


Disciplines (Disc_Id, Name, Type)
Marks(Stud_Id, Disc_Id, Mark, Date_of_exam)

Solve the following queries in Relational Algebra (upload the file with the solution to
Assignments):
a. The names of the students who sustained the exam at Computer Programming.
b. The names of the disciplines for which the student Petrescu passed the exam.
c. The names of the students who failed the exams at Databases and Computer
Programming, but passed the exam at Mathematics.
4. 1.) Indicate the correct answers:
If a database is in the 2nd Normal Form, then: (a.) all the attributes are atomic; (b.)
there don’t exist functional dependencies between the attributes; (c.) there don't exist
multi-value dependencies between the attributes; (e.) there don't exist partial
dependencies between the primary key and the non-key attributes; (d.) every determinant
is a key;
2.) Consider the table with the following structure: Student_Disciplines (Student_Id,
Discipline_Id, Discipline_type, Mark, Date_of_Exam). The primary key is constituted
from the fields (Student_Id, Discipline_Id). Is the database in the 2nd Normal Form?
Motivate your answer. If the database is not in the 2nd NF, transform the initial table in
order to get this NF. Indicate the schemes of the resulting tables and the type of the
relationship between them.

5. Solve the queries below in the Structured Query Language (SQL), considering the following
schema (primary and forieg keys are indicated, as usual):
Person(pId PK, name, address)
Title(titleId PK, name, yearPublished)
Item(item_number PK, titleId FK, dateAcquired, pricePaid)
Borrowing(book_item PK, FK, dateBorrowed, borrower_Id PK, FK, dateReturned, penalty)
This table contains data about current and past borrowings. If the book is not returned,
dateReturned is empty. Penalty contains the fine paid if the book was not returned in time. It is 0
(zero) if there was no penalty. Solve the following queries using SQL:

a. List the titles and the number of items for each title. For those titles with no items, the 0 value
should be displayed.
b. List the titles published in the current year, or three years ago.
c. List the persons who have borrowed all the books in the database.
d. How many items are there in the library database?

You might also like