Page 326 - IT 402 v2.0 class 10
P. 326
Write SQL commands:
a. To show all the information about IT teachers.
b. To list the details of all the teachers who are getting salary between 20000 to 35000.
c. To display the subject of all the teachers whose age is more than 40 years.
d. To display the list of names of all the teachers in alphabetical order. [CBSE Sample Paper, 2022]
Ans. a. Select * from Teachers where subject = " CO M P U T E R" ;
b. Select * from teachers where salary >= 20000 and salary <= 35000;
c. Select Subject from Teachers where age > 40;
d. Select * from Teachers order by name
lication ased uestions:
L if e s k il l & v al ue
1. Create table Employee:
mpId har
mpName archar 5
esig varchar
Salary Decimal
Ans. CRE AT E T AB L E E M P L O Y E E
(
EmpId char(4),
EmpName varchar(15),
Desig varchar(20),
Salar y D ecimal
) ;
2. Give the SQL statement to create a table STUDENT with Admission Number, Name, Age and Marks.
Ans. CRE AT E T AB L E ST U D E NT
(
Ad mn_ No I NT ,
Name Varchar(25),
Age INT,
M ar k s I NT
) ;
3. Write the output of the following query:
T : SS I S
o ame Price ID
A01 Mother Board 12000 S01
A02 Hard Disk 5000 S01
A03 Keyboard 500 S02
A04 Mouse 300 S01
A05 Mother Board 1300 S02
i. SE L E CT * F RO M ACCE SSO RI E S
ii. SELECT * FROM ACCESSORIES WHERE PRICE>=5000
324 Touchpad Information Technology-X

