MENU
Question -

Consider the followingtables SCHOOL and ADMIN and answer this question :
Table : SCHOOL

CODE

TEACHERNAME

SUBJECT

DOJ

PERIODS

EXPERIENCE

1001

Ravi Shankar

English

12/3/2000

24

10

1009

Priya Rai

Physics

03/09/1998

26 ,

12

1203

Lisa Anand

English

09/04/2000

27

5

1045

Yashraj

Maths

24/08/2000

24

15

1123

Ganan

Physics

16/07/1999

28

3

1167

Harish B

Chemistry

19/10/1999

27

5

1215

Umesh

Physics

11/05/1998

22

16

Table : Admin

Code

Gender

Designation

1001

Male

Vice Principal

1009

Female

Coordinator

1203

Female

Coordinator

1045

Male

HOD

1123

Male

Senior Teacher

1167

Male

Senior Teacher

1215

Male

HOD

Write SQL statementsfor the following :

1.   To displayTEACHERNAME, PERIODS of all teachers whose periods are more than 25.

2.   To display all theinformation from the table SCHOOL in descending order of experience.

3.   To display DESIGNATIONwithout duplicate entries from the table ADMIN.

4.   To displayTEACHERNAME, CODE and corresponding DESIGNATION from tables SCHOOL and ADMIN ofMale teachers.

 



Answer -

1. To display TEACHERNAME, PERIODS of all teachers whose periods are more than 25.
SELECT TEACHERNAME, PERIODS
FROM SCHOOL WHERE PERIODS >25.
2.To display all the information from the table SCHOOL in descending order of experience.

SELECT * FROM SCHOOL;
3.To display DESIGNATION without duplicate entries from the table ADMIN.
SELECT DISTINCT DESIGNATION FROM ADMIN;
4.To display TEACHERNAME, CODE and corresponding DESIGNATION from tables SCHOOL and ADMIN of Male teachers.
SELECT TEACHERNAME.CODE
DESIGNATION FROM SCHOOL.CODE = ADMIN.CODE
WHERE GENDER = MALE;

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×