Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

S74-Subiect Examen Baze de Date

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Subject no.

74

1. Indicate the correct answers:


1.) The term functional dependency refers to: (a.) the uniqueness of the values at
table level; (b.) the connections between the tables; (c.) the relations between the attributes; (d.)
the fact that one attribute uniquely determines another attribute; (e.) The number of attributes
within the table.
2.) The logical data independence implies that: (a.) The database is normalized; (b.)
The changes that occur at the conceptual level of the database do not affect the users and the
applications at the external level; (c.) The changes that occur at the physical level of the database
do not affect the logical level; (d.) The conceptual schema hides details about the structures used
for storing the data on the disk, as well as about choosing the indexes; (e.) the database occupies
a minimum space on the disk
3.) The concept of data refers to: (a.) The content of the database; (b.) The values
of the data gathered from the real world as a result of observations and measurements; (c.) The
processing of the data from the database; (d.) The candidate key values; (e.) The interpretation of
the data gathered from the real world, which stands at the basics of decision making

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, as well as primary and
foreign keys - PK and FK) 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 Tuple Relational Calculus (TRC):


(a.) The names of the students that didn't pass the exams at Databases.
(b.) The names of the students that obtained at Computer Programming a highest mark
than Petrescu George achieved at Databases.
(c.) The names of the disciplines at which student Petrescu Gheorghe Ion failed the exam.

• 1.) Indicate the correct answers:


If a database is in the 3rd Normal Form (3NF), then: (a.) all the attributes are
atomic; (b.) there don't exist functional dependencies between the attributes; (c.) there
don't exist functional dependencies between the non-key attributes; (d.) every field is a
candidate key; (e.) Every foreign key is a primary key.

2.) Consider the table with the following structure: Employee (Student_id PK,
Student_name, Faculty_name, Faculty_address). Is the database in the 3rd normal form?
(Motivate your answer). If the answer is no, perform the corresponding modifications in
order to bring it to the 3rd normal form. Provide the schemes of the resulting table(s),
indicating the primary and foreign keys and the relations between them, if necessary.

5. Consider the following relations:


Student(snum: integer PK, sname: string, major: string, level: string, age: integer,
num_supervisor_stud: integer FK)
Class(name: string PK, meets at: time, room: string, fid: integer FK)
Enrolled(snum: integer FK, cname: string FK)
Faculty(fid: integer PK, fname: string )
The key fields are indicated and the domain of each field is listed after the field name.
The meaning of these relations is straightforward; for example, Enrolled has one record
per student-class pair such that the student is enrolled in the class. Write the following
queries in SQL:

a.) Find the names of all Seniors (Level = SR) that have Literature as a major.
b.) Find the names of those students, who are not enrolled in at least two classes.
c.) Print the class and the number of students, for each class. The classes without
students, if they exists, should be listed as well.
d.) Find the names of the classes that meet in the same time, but in different rooms.

You might also like