0% found this document useful (0 votes)
62 views8 pages

SQL Practical Assignment

This document contains instructions for creating a database and relation called KHMS, populating the relation with sample data, and performing various queries on the relation. The relation tracks information about teachers including name, subject taught, periods, date of joining, and experience. The document lists 16 tasks or queries to perform on the relation and provides sample answers for 4 theoretical questions.

Uploaded by

Chaitanya Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views8 pages

SQL Practical Assignment

This document contains instructions for creating a database and relation called KHMS, populating the relation with sample data, and performing various queries on the relation. The relation tracks information about teachers including name, subject taught, periods, date of joining, and experience. The document lists 16 tasks or queries to perform on the relation and provides sample answers for 4 theoretical questions.

Uploaded by

Chaitanya Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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