SQL Practical Assignment

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

CS

ASSIGMEN
T
SQL

-Chaitanya
XII-A
4
Q6. Consider the following Relation in a database named KHMS

a) Create a database named KHMS


b) Create the relation SCHOOL SHOWN ABOVE
c) Give command for showing the structure of relation SCHOOL
d) Populate the relation with data as shown above
e) DISPLAY all the records
f) Display records sorted according to periods
g) Display records sorted according to experience
h) Display records sorted according to DOJ
i) Display only those records where experience is not given
j) Display only those records where experience is given
k) Display names and DOJ of all physics teachers
l) Display records for those teachers who have experience between 5 to 10 years
m) Display subjects in such a way that subject name appears only once.
n) Degree of Relation SCHOOL
o) Cardinality of Relation SCHOOL
p) Why attribute SUBJECT cannot be used as Primary Key?

NOTE : Answer the options given in RED theoretically.


a)

b)

c)

d)
e)

f)
g)

h)
i)

j)

k)
l)

m)

n) Degree of School is 6.

o) Cardinality of School is 7.
p) Attribute Subject cannot be used as primary key as
primary key need to be unique and subject attribute can be
same for various entries.

You might also like