You are on page 1of 3

PUNJAB UNIVERSITY COLLEGE OF

INFORMATION TECHNOLOGY (PUCIT)

Database Systems Lab 1


IT Morning Fall-15 (New Campus)

Date: 07-03-2017
Instructions:

 Sharing is strictly not allowed in lab work.(As of course it will go in your benefit)
 To seek any help, consult with TAs.
 Solve the lab on blank paper and write your roll number and name… Lots of Luck! 

1-Return a relation consisting of all tuples appearing in either or both relations

ID Name Age Department NIC


J1 Ahmad 23 Sales 245-77-245367
J2 Salman 34 Marketing 234-66-245368
J5 Tariq 29 Admin 245-71-325370

ID Name Age Department NIC


J1 Ahmad 23 Sales 245-77-245367
J2 Salman 34 Marketing 234-66-245368
J4 Tariq 29 Admin 245-71-325370

ID Name Age Department NIC


J1 Ahmad 23 Sales 245-77-245337
J3 Syed 34 Marketing 234-66-265368
J6 Momin 29 Admin 245-71-366370
J2 Slaman 34 Marketig 234-66-245368

2-Define Intersection and return relation of above question.

3-what is cardinality? Write down the cardinality of all tables of Question 1.

4-what is Degree? Write down the degree of all tables of Question 1.

Teaching Assistants: Instructor:


 Abdul Moid – BSEF14A524 Farhan Ahmad Ch.
 Sonia Hayat – BSEF14M515
4-Consider relations A and B such that

– Cardinality of A= 12
– Cardinality of B= 10
– Cardinality of A UNION B = 20

What would be the value of following?

– Cardinality A INTERSECT B
– Cardinality A TIMES B
– Degree of A UNION B
– Cardinality of A MINUS B
– Cardinality of B MINUS A

6-

Relation A

ID FirstName LastName BirthYear

S1 Betsy Adams 1982


S2 Ryan Potter 1974
S3 Arnold Elfis 1962
S4 Ryan Potter 1996
S5 Emily Allen 1979

Relation B
ID FirstName LastName Hire Year
S1 Betsy Adams 2008
S2 Ryan Potter 2010
S3 Arnold Elfis 2008
S4 Ryan Potter 2013
S6 Susan Reyna 2009

Teaching Assistants: Instructor:


 Abdul Moid – BSEF14A524 Farhan Ahmad Ch.
 Sonia Hayat – BSEF14M515
i) Find A Times B
ii) Find (A TIMES B) where IDA > IDB
iii) Find (A TIMES B) where IDA = IDB
iv) Find (A TIMES B) where IDA < IDB
v) Find A-B
vi) Find B-A

Best of Luck 

Teaching Assistants: Instructor:


 Abdul Moid – BSEF14A524 Farhan Ahmad Ch.
 Sonia Hayat – BSEF14M515

You might also like