0% found this document useful (0 votes)
17 views

DBMS Assignment 2 Questions

The document outlines a DBMS assignment consisting of multiple questions related to database design and queries. It includes tasks such as creating an ER diagram for a soccer team application, writing relational algebra expressions for medical prescriptions, formulating SQL queries for student and faculty data, analyzing functional dependencies for normalization, and checking schedule serializability. Each question requires specific outputs and considerations based on the provided data structures.

Uploaded by

Nikhitha Niki
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)
17 views

DBMS Assignment 2 Questions

The document outlines a DBMS assignment consisting of multiple questions related to database design and queries. It includes tasks such as creating an ER diagram for a soccer team application, writing relational algebra expressions for medical prescriptions, formulating SQL queries for student and faculty data, analyzing functional dependencies for normalization, and checking schedule serializability. Each question requires specific outputs and considerations based on the provided data structures.

Uploaded by

Nikhitha Niki
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

DBMS Assignment 2 Questions

Mention date as 2-5-25

1. Assume we have the following application that models soccer teams, the games they
play, and the players in each team. In the design, we want to capture the following:
 We have a set of teams, each team has an ID (unique identifier), name, main
stadium, and to which city this team belongs.
 Each team has many players, and each player belongs to one team. Each player
has a number (unique identifier), name, DoB, start year, and shirt number that he
uses.
 Teams play matches, in each match there is a host team and a guest team. The
match takes place in the stadium of the host team.
 For each match we need to keep track of the following:
 The date on which the game is played
 The final result of the match
 The players participated in the match. For each player, how many goals he
scored, whether or not he took yellow card, and whether or not he took red
card.
 During the match, one player may substitute another player. We want to
capture this substitution and the time at which it took place.
 Each match has exactly three referees. For each referee we have an ID (unique
identifier), name, DoB, years of experience. One referee is the main referee and
the other two are assistant referee.
Design an ER diagram to capture the above requirements. State any assumptions
you have that affects your design and Make sure cardinalities and primary keys
are clear.

2. Consider the following relations:


Doctor(SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)
Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)
Medicine(TradeName, UnitPrice, GenericFlag)
Prescription(Id, Date, Doctor_SSN, Patient_SSN)
Prescription_Medicine(Prescription Id, TradeName, NumOfUnits)
Write the relational algebra expressions for the following queries
1. List the trade name of generic medicine with unit price less than $50.
2. For medicines written in more than 20 prescriptions, report the tradename and
the total number of units prescribed.
3.List the first and last name of patients whose primary doctor named ʻJohn
Smithʼ.
4.List the SNN of distinct patients who have ʻAspirinʼ prescribed to them by
doctor named ʻJohn Smithʼ.
5.List the first and last name of patients who have no prescriptions written by
doctors other than their primary doctors.

3. Consider the following relations:


Student(Snum, Sname, Branch, level, age)
Class(Cname, meet_at, room, fid)
Enrolled(Snum, Cname)
Faculty(fid, fname, deptid)
Write the following queries in SQL. No duplicates should be printed in any of the
answers.
(i) For all levels except JR, print the level and the average age of students for that level.
(ii) For each faculty member that has taught classes only in room R128, print the faculty
member’s name and the total number of classes he or she has taught.

4. Given a relation R( P, Q, R, S, T, U, V, W, X, Y) and Functional Dependency set


FD = { PQ → R, PS → VW, QS → TU, P → X, W → Y }, determine whether the given
R is in 2NF? If not convert it into 2 NF.

5. Check whether the given schedule S is view serializable or not

You might also like