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

Dbms Tutorial

1. The document discusses assignments related to designing ER schemas and SQL queries for various databases. 2. Assignment 1 involves designing an ER schema for a sports league database to track teams, games, players and their stats. 3. Assignment 2 involves analyzing an ER schema for a bank database and listing entity types, relationships, constraints and user requirements. It also discusses modifying constraints. 4. Assignment 3 involves designing a relational database for a registrar's office to track classes, instructors, students enrolled and their grades. 5. The remaining assignments involve writing SQL queries to retrieve information from provided relational databases describing employees, companies, cars, accidents, and insurance information.
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)
19 views

Dbms Tutorial

1. The document discusses assignments related to designing ER schemas and SQL queries for various databases. 2. Assignment 1 involves designing an ER schema for a sports league database to track teams, games, players and their stats. 3. Assignment 2 involves analyzing an ER schema for a bank database and listing entity types, relationships, constraints and user requirements. It also discusses modifying constraints. 4. Assignment 3 involves designing a relational database for a registrar's office to track classes, instructors, students enrolled and their grades. 5. The remaining assignments involve writing SQL queries to retrieve information from provided relational databases describing employees, companies, cars, accidents, and insurance information.
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

DEPA RTM ENT OF COMPUT ER SCIENCE AND ENGIN EERIN

G
NATIO NAL rNSTIT UTE OF T ECHN OLOG Y , HAMIRPUR (H.P.)

DBMS

ASSIGNMENT I

QI. A database is being constructed to keep track of the teams and games
of a sports league.
A team has a number of players , not all of whom participate in each game.
lt is desired to
keep track of the players participating in each game for each team, the positio
ns they played
in that game, and the result of the game. Try to design an ER schema
diagram for this
application, stating any assumptions you make. Choose your favorite sport
(soccer , football,
baseball, .. .).

Q2. Consider the ER diagram shown in Figure below for part of a BANK
database. Each
bank can have multiple branches, and each branch can have multiple accoun
ts and loans.
1. List the (nonwcak) entity types in the ER diagram.

2. Is there a weak entity type? If so, give its name, its partial key, and
its identifying
relationship.

3. What constraints do the partial key and the identifying relationship of


the weak entity
type specify in this diagram?
4. List the names of all relationship types, and specify the (min,max) constra
int on each
participation of an entity type in a relationship type. Justify your choices.

s. List concisely the user requirements that led to this ER schema design.

6 _ Suppose that every customer must have at least one account but ishrestricte d to at
most two loans at a time, and that a bank branch cannot have more t an 1000 1
oans.
How does this show up on the (min,max) constraints?

BANK
I ~ N BANK-BRANCH
( I ,n ) ~ (I , I )
L - -- - -
(

\ BAl~K. -llRAl~CH
LOAl'l LOAl~S
(0 ,\000 )
/ ----

Q3. Design a rela


tion database for a T . trar's ofti,ce. The office maintains data abou
NI re ts f ~tud t
each class, includin
g the instru ents enro\\ed, and h . d \
of the class meeting. ctor , the nu t e ttme an pa ce
For each student-cla m ~; : grade is recorded.
ss pa '
.
Q4. Cons1~er ~he re . d b f Table \ where th Primary keys are underl
an expression m rela\~tton ata ase O e
' of the follo . ined. Give
tion algebra to expr w ing quenes :
ess each
of a\l employees whO r 1•n the same city and on sa
I. Find the names
we me street
_ ;~ :: :: i: :; ;: ie
2 :i l employees in th
is database who do
bank corporation. not work for the
3. Find the name first
of a\\ employees w
ho earn more than
bank corporation every emp \oyee Of \\
sma
Table 1:
Employee (person-
name, street, city)
Works (person-nam
e, company-name,
salary)
Company (company
-name, city)
Manages (person-na
me, manager-name)

QS . Consider the re
lation database of T
each request: Give able \ . Give an ex
a\\ managers in this pression in the rela
database a lO perc tional algebra for
Q6. Consider the ent salary raise.
insurance database
Construct the fo\\ow of Table 2, where
ing SQL queries fo the primary keys
r this relational da are underlined.
tabase.
l. Find the numbe
r of people who ow
ned cars that were
2. Add a new acci involved in accide
dent to database, as nt in 2007.
3. Delete the SAN sume any values fo
TRO belonging to r requires attribute
"Prateek". .
Table 2:
Person( driv cr-i d,n am c,ad drc ss) Car (license, model, yea r)

Ac cid ent (re por t-nu mb er,data location) Ow ns( driv er-i d,li cen se)
. . '
P arttc1pated (d · ·d age -am oun t)
nver-1 , car, report-number, dam
SQ L que ries for this rela tion al
bConsid er the dat aba se of Table 3. Con stru ct the following
Q?.
d ata ase:
o wo rk first Ban k
nam es and citi es of res idence of all em plo yee s wh
I. Find the
Corporation.
all em plo yee s wh o wo rk for
Fin d the nam e, stre et num ber , and cities of res ide nce of
2.
more than Rs I 0,000.
the "NI T, Ham irpu r" and earn
3.
Table 3:
city)
Em plo yee (person-name, street,
y-n am e, sala ry)
Wo rks (person-name, com pan
)
Co mp any (co mp any -na me , city
er- nam e)
Ma nag es (person-name, ma nag

You might also like