Skip to main content

GRADE XII - MYSQL PRACTICE QUESTIONS

 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

Popular posts from this blog

CS - SORTING/SEARCHING ALGORITHMS

  SORTING ALGORITHMS                       SORTING ALGORITHM PDF LINK #Bubble Sort          ·        The outer loop iterates through the entire array. ·        The inner loop compares adjacent elements and swaps them if they are out of order. ·        The outer loop runs n times, and each pass moves the largest element to its correct position. arr=[3,8,5,2,1] n = len(arr) print(n) for i in range(n):  #traverse through all the elements         # Last i elements are already sorted, no need to check them         for j in range(0, n-i-1):              # Swap if the element found is greater than the next element              if arr[j] > arr[j+1]:               ...

GRADE XI - NESTED FOR LOOP

                                                         NESTED FOR LOOP 1. for var1 in range(3):      print(var1,"OUTER LOOP")          # 0 outer loop       1 outer loop      2 outer loop          for var2 in range(2):                  print(var2+1,"INNER LOOP")    #1  2 inner loop     1  2  inner loop   1 2 inner loop  2. Print the following pattern using for loop: 1  1 2  1 2 3  1 2 3 4  Sol: for r in range(1,5):   #ROWS     for c in range(1,r+1):   #COLUMNS         print(c,end=" ")     print() 3. Print the following pattern using for loop: @  @ @  @ @ @...