0% found this document useful (0 votes)
63 views3 pages

Relational Databases First Midterm Exam 21.11.2023 Group 6

The document outlines the first midterm exam for a course on relational databases at the University for Information Science and Technology. It includes tasks such as writing a relational model from an ER diagram, creating an ER diagram for a beauty salon database, and performing relational algebra queries on given relational models. The exam consists of various questions focusing on database design and query formulation.

Uploaded by

Mila Lozhankoska
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)
63 views3 pages

Relational Databases First Midterm Exam 21.11.2023 Group 6

The document outlines the first midterm exam for a course on relational databases at the University for Information Science and Technology. It includes tasks such as writing a relational model from an ER diagram, creating an ER diagram for a beauty salon database, and performing relational algebra queries on given relational models. The exam consists of various questions focusing on database design and query formulation.

Uploaded by

Mila Lozhankoska
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/ 3

UNIVERSITY FOR INFORMATION SCIENCE AND TECHNOLOGY

“St. Paul the Apostle” – Ohrid


Relational databases
21.11.2023 -First Midterm Exam-

1. For the given ER diagram, write the relational model. Also, identify the primary and foreign
key(s) (underline primary key(s), and put an asterisk symbol (*) on foreign key(s)). (30 points)
Result
Team2
TName
Placement
Team1

Coach
Matches
MatchID
1 M 1 1 M
Teams
Doctor
RName

1 1 1
PlayID Round Type RTypeID

FirstName
M
DetID
LastName M
Players 1 M Detail
DateBirth
M M

CurrClub
Position
Groups ActID
1 1
Name
Activity
City
Type

Stadium 1 SchID

Schedule Date

Time
Referee

Stadium City
2. Draw an ER diagram to create a beauty salon database, which will contain the following
information: (30 points)
• The ER diagram will keep track of the employees, customers, products and their
services.
• For each employee the beauty salon will keep track of a unique employee ID, their
first and last name, phone number, date of birth, specialty, city and salary.
• For each customers the beauty salon will keep track of a costumer ID, their first and
last name and their phone number.
• For each product the beauty salon will keep track of unique product ID, type of the
product and the product name.
• The beauty salon keeps track of services.
• Every customer can make an appointment. Many customers can make many
appointments. The appointment will keep track of time and the date when the
appointment is scheduled.
• One service can be made by one employee.
• While working one employee can use many products.
• Many customers can buy many products.

3. Consider the following relational model:

WORKER (ID, Fname, Lname, Salary, position)


PROJECT (ProjNo, Project_Name, duration)
WORKER_PROJECT (ID*, ProjNo*, No_hours)

Write the relational algebra expressions for the following queries:

a. Find the last names of the workers who work on a project titled “Automated Attendance
System”. (5)
b. Find the names of the workers who have not participated in any project. (5)
c. Find all workers with first name “Ardit” and last name “Bekteshi”. (5)
d. Find the duration of a project titled “Banking Bot Project”. (5)
e. Find the position of a workers with salary less and equal to 25000 denars. (5)
4. Consider the following database:

Publisher

Author

Book

a) How many tuples will be returned by the following relational algebra query? Explain! (3)

PubID, Publisher (Publisher)

b) What is the result of the following relational algebra query? Explain! (4)
PubID(Book) – PubID(Publisher)

c) How many tuples will be returned by the following relational algebra query? Explain! (4)
Author x Publisher x Book

d) What is the result of the following query? Explain! (4)


publisher, AuthorName ((date>=’1967’ (Book)) Author Publisher )

You might also like