0% found this document useful (0 votes)
25 views2 pages

Assignment 3 IT402

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)
25 views2 pages

Assignment 3 IT402

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/ 2

ASSIGNMENT SET – 3

Time: 30 min M.M. – 20


Instructions:
• All Questions are compulsory
In SQL order by clause is used to arrange record in _____ order.
a. only ascending
Q1 1
b. only descending
c. either ascending or descending
Q2. What is the use of distinct clause in MySQL? 1
Q3. Give two examples of DDL command. 1
Q4. What do you mean by degree in MySQL? 1
Write command to create the following table : Book
Field Name Datatype Constraint
BNo Integer(4) primary Key
Q5 2
Bname Varchar(20)
Author Varchar(30)
Price float(4,2)
Write the query for the following

Q6 a. To delete a column “Bname” from table “Book” in MySQL. 2


b. To display records of table “Book” in descending order of
price(field name “bprice”)
Write the output of the following query (i) and also write queries for
(ii-iii) on the basis of following tables: Table : Employee
Emp_id Emp_Sal Emp_desig Emp_name
1 20000 Manager Amod
2 15000 Clerk Anil

Q7 Table : Job
3
job_id city job_type Emp_id
j1 Delhi Permanent 1
J2 Goa Temporary 2

1. Select Emp_Sal, Emp_name from Employee where Emp_desig in


(“Manager”, “Clerk”)
2. Display the names of employees who lives in Goa.
3. Display total salary of all clerk.
Write SQL commands for the following:
Table : Teacher

TID TName TSal TDept TDesig


1 Amit 2000 IT PGT
2 Sumit 1500 History TGT
Q8. 4
3 Naina 1800 Math PGT

a. Write the degree and cardinality of Table : Teacher


b. Identify the primary key in given Table.
c. Dislay records of all PGT Staff
d. Increase the salary of teachers of Math department.
Write SQL commands for the following queries (i) to (v) based on the
relations Teacher and Student given below:
Teacher :

T_id T_name T_sal T_desig

Student :
Q9. Adm_no S_name S_class T_id 5

Display the details of teachers whose name starts from ‘A’


Display the count of teachers who received salary more than 24000.
Display the details of teachers who received maximum and minimum
salary.
Display the teacher name, teacher salary who teaches class IX.
Display the average salary of teachers.

You might also like