Dbms
Dbms
Dbms
7. Destroying tables.
8. Inserting Data into Tables:
40) Find the all customers who have either an account or a loan (but not
both) at the bank.
LAB 4
TABLE EMPL
Table Employee
Q1 List name and designation of all
employees from department 4
LAB 8
Q1 Execute a query that does
cross join on both the tables
Q2 List department details of all
employees. What type of join is
this ?
This is an example of left join, wherein all columns of relation Employee are
kept in view regardless of them matching with those in Dept table .
DEPARTMENT INSTRUCTOR
CONSISTS
DEPARTMENT
COURSE
CONSISTS
OFFERS STUDENT
COURSES Taugh
INSTRUCTOR
t
ENROLLS Name
Dep_name
ID
STUDENT
Q2. Construct an ER diagram for a
hospital with a set of patients and a
set of medical doctors. Associated
with each patient, there is a log of
the various tests and examinations
conducted.
SPECIALI Name Patient_n
SATION o
DOCTOR
Examine
TREATS
Prescription
Patient_n
o PATIENT TESTED
NAME
Type TEST
Descriptio
n
Q3. Design ER diagram for keeping track of
performance of your favourite sports team.
You should store the matches played, the
scores in each match, the player in each
match and individual player statistics for
each match.
Match
Score
TEAM
Time
Date PART
OF CAPTAIN
Place
PLAYER
Q4. Information about a bank is
about customers and their
account. Customer has a name,
address which consists of house
number, area and city and one or
more phone numbers. Account
has number, type and balance. We
need to record jointly. Clearly
indicate attributes, keys and the
cardinality ratios and
participation constraints.
House_no Area City
Q5.A database is to be constructed to keep
track of the team. A team has a number of
players,
Name not all of then participate Phone_n
ADDRESS ino each
game. It is desired to keep track of the
players. Create ER diagram.
CUSTOMER
1:N
HAS AN
1:1
ACCOUNT
Account_no
Balance
Type
Name id
TEAM
Belongs
Part to
Plays
GAME
PLAYER
Location
P_name
Time P_num
Q6 Construct ER diagram for a
car-insurance company whose
customers own one or more cars
each. Each car has associated
with it, zero to any number of
recorded accidents.
Liscense_ Phone_n
ADDRESS
no o
Name
CUSTOMER
OWNS Has an
CAR
Meet
s
ACCIDENT
Car_id
Location
C_id
number
Model color