Page 36 - Modular_V2.0_SQL_Flipbook
P. 36
2. Perform the following activities in the table of previous question:
a. Display all records in which gender is F. Use = relational operator.
b. Check and display all records who have got average marks more than 90 and less than 100.
c. Display details of all those students whose name contains an ‘A’ or ‘a’.
3. Consider the following table and write SQL statements
ID Item Description Price
P001 Sambar Vada South Indian 40
P002 Dal Makhani North Indian 150
P003 Noodles Chinese 100
P004 Idli Sambar South Indian 50
P006 Sarson Saag North Indian 170
P007 Dosa South Indian 120
P008 Pizza Italian 200
i. To add a new row with the following data
“P009”, “Lemon Rice”, “South Indian”, 140
ii. Display details of all Menu items in the descending order of Price
iii. Display Item and Description of those Items whose price is between 100 and 150
4. Consider the following Student table:
Table Name: STUDENT
Stud_id Student_name Class Marks Bonus Marks Age Teacher_id
1001 AMIT X 90 NULL 17 NULL
1009 SUMIT XI 88 4 18 1205
1004 AJAY XII 78 7 19 1206
1002 ARUN IX 94 NULL 16 1203
1006 NIRAJ VII 85 9 14 1201
1005 RISHI X 89 NULL 17 1207
1003 ABHIJEET XII 87 10 18 1206
Write SQL commands for the following:
i. Create table in SQL for the above details given.
ii. Insert all the details in the table as shown above.
iii. Show distinct classes from the table Student.
iv. Show the description for the table.
v. Show all details of the student table.
Teacher's Corner
1. Explain the students about different operators with different examples.
2. Help them to practise handling records in MySQL.
34
Touchpad MODULAR (Ver. 2.0)

