GRADE XII
MYSQL PRACTICE QUESTIONS
1.For the following table answer the following questions
RTNO | AREA_COVERED | NO_OF_STUD | DISTANCE | TRANSPORTER | CHARGES
1 Rajiv Chowk 50 10 Anand Travel 10000
2 Old GGn 54 20 Bhalla Co. 20000
Que 1 . For the following table answer the following questions
a. 1. Display
all the bus details of those bus where no of students travelled is more than
100
b. 2. Display
route no and area of those bus whose charges is more than 50000
c. 3. Reduce
the charges of all those buses by 12% whose area covered starts with ‘V’
d. 4. Display
the details of the anand travels and Bhalla co. transporters
e. 5. Delete
all the records in which no of students travelled are less than 50
f. 6. Display
all the records arranged in descending order of no of students
g. 7. Display
the name of transporters who are providing service
h. 8. Increase
the charges by 5% of those transports whose charges are between 40000 and
50000
i. 9. Add
another column comment varchar(50) in the table
j. 10. Change
the contents of comment column with ‘satisfactory’ for those routes whose
distance is more than 30
a. Sol: 1.Select * from bus;
2 2.Select * from bus where no_of_students>100;
3. 3.Select Rtno, area_covered from bus where charges>50000;
4. 4.update bus set chrges=charges-0.12* charges where area_covered like 'v%';
5. 5. Select * from bus where transporter IN ('Anand Travels','Bhalla Co.');
6. 6.Delete from bus where no_of_students<50;
7. 7. Select * from bus order by no_of_students desc;
8. 8. Select distinct(transporter) from bus;
9. 9. Update bus set charges=charges+0.05 * charges where charges between 40000 and 50000;
10 10. Alter table bus add comment varchar(50);
11 11.Update bus set comment="Satisfactory" where distance >30;
Comments
Post a Comment