0% found this document useful (0 votes)
60 views2 pages

Subiect Examen Baze de Date

The document contains 5 questions about database concepts and relational models: 1. It asks to identify database concepts like domain constraints and entity sets. 2. It asks to translate an E-R diagram with entities like Teacher and relationships like ISA to a relational model. 3. It provides a relational schema and asks to write relational algebra queries like listing students who passed a specific exam or did not pass other exams. 4. It asks about properties of database normalization like third normal form and asks to modify a table to satisfy 3NF. 5. It provides a relational schema and asks to write SQL queries like listing the department with most employees or the average salary of employees

Uploaded by

Ioana Marc
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)
60 views2 pages

Subiect Examen Baze de Date

The document contains 5 questions about database concepts and relational models: 1. It asks to identify database concepts like domain constraints and entity sets. 2. It asks to translate an E-R diagram with entities like Teacher and relationships like ISA to a relational model. 3. It provides a relational schema and asks to write relational algebra queries like listing students who passed a specific exam or did not pass other exams. 4. It asks about properties of database normalization like third normal form and asks to modify a table to satisfy 3NF. 5. It provides a relational schema and asks to write SQL queries like listing the department with most employees or the average salary of employees

Uploaded by

Ioana Marc
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

Subject no.

72
1. Indicate the correct answers;
1.) the term domain constraint refers to: (a.) a field that has unique values at database level; (b.) a field
that has unique values at table level; (c.) an index in the database; (d.) the permitted values for a field; (e.)
the datatype associated to a field.
2.) the term entity set refers to: (a.) a set of entities having the same attributes; (b.) the whole database;
(c.) the relational model; (d.) a table in the database; (e.) the set of attributes having the same data type
within a table
3.) the term view refers to: (a.) a table within the database; (b.) a query; (c.) a virtual table defined
through a query; (d.) a part of the conceptual level of the database; (e.) the external level of the database.

2. Translate the following diagram from E-R model to relational model:

T_id Name Date_of_Birt


h

Teacher

Faculty_grad_mark
Salary
ISA

Permanent teacher Temporary


teacher

3. Given the following relational schema:


Students(Student_Id, Name, Surname, Date_of_birth, Ac_degree)
Disciplines(Discipline_Id, Name, Type)
Marks(Student_Id, Discipline_Id, Mark, Date_of_Exam)
Solve the following queries using relational algebra operations:
a. List the students who sustained the exam at Programing Techniques.
b. List the students that didn’t sustain the exams at Mathematics, but sustained the exam at
Programming Techniques.
c. List those students who didn’t sustain any exam (didn’t receive any marks).

4. 1.) A database in the 3rd Normal Form (3NF) if: (a.) all the attributes are atomic; (b.) there don’t exist
functional dependencies between the attributes; (c.) the database is in the Boyce-Codd-Normal-Form
(BCNF); (d.) the database is in 1NF and there don’t exsit partial dependencied between the non-key
attributes and the primary key; (e.) the database is in 2NF and there don’t exist functional dependencied
between non-key attributes;
2.) Consider the table with the following structure: Disciplines(Discipline_Id, Name, Type,
Teacher_name, Teacher_DateOfBirth). Is the database in 3NF (motivate your answer)? If the answer is no,
provide the appropriate structure modifications in order to get the 3NF.
5. Consider the following relational schema:
Emp(eid: integer, ename: string, age: integer, salary: real)
Works(eid: integer, did: integer)
Dept(did: integer, dname: string, budget: real, managerid: integer)
The key fields are underlined, and the domain of each field is listed after the field name. The meaning of
these relations is straightforward; for example, an employee can work in more than one department. Write
the following queries in SQL:
a. Print that department that have the maximum number of employees.
b. Print the name and age of each employee who works in both ‘Hardware’ and ‘Software’ departments.
c. Print the name of each department and the number of the employees for each department.
d. Print the name of each employee and his average salary over the departments he works in, assuming
that employees usually work in more than 1 department.

You might also like