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

PYTHON - MYSQL CONNECTIVITY CODE

  #INSERTION OF DATA import mysql.connector mydb = mysql.connector.connect( host="localhost", user="root", passwd="root", database="school" ) print("Successfully Connected") #print(mydb) mycursor=mydb.cursor()   v1=int(input("enter ID:")) v2=input("enter name:") v3=input("enter Gender:") v4=int(input("enter age:")) sql='insert into TEACH values("%d","%s","%s","%s")'%(v1,v2,v3,v4) print(sql) mycursor.execute(sql) mydb.commit() print("record added") #MYSQL Connection code – Deletion on database SOURCE CODE: s=int(input("enter id of TEACHER to be deleted:")) r=(s,) v="delete from TEACH where id=%s" mycursor.execute(v,r) mydb.commit() print("record deleted") MYSQL Connection code – Updation on database SOURCE CODE: import mysql.connector mydb = mysql.connector.c...

GRADE XII CS - VIVA QUESTIONS

  VIVA QUESTIONS GRADE XII CS Dear All Be thorough with your project and practical files, as the viva can be asked from anywhere. Stay calm, don’t get nervous, and be confident in front of the examiner. 1. Tell me about your project. 2. Which concepts you have used for your project? 3. What do you mean by front end and back end? How they are important in developing any such projects? 4  Mention the modules and built-in functions you have used in your project. 5. Which real world problems are solved by your project? 6. Explain the most important feature of your project. 7. Name a few mutable data types of python. Lists, Sets, and Dictionaries 8. Name a few immutable data types of python. Strings, Tuples, Numeric 9. Name ordered and unordered data type of python. Ordered – String, List, Tuples Unordred – Set, Dictionaries 10. What is the significance of a pass statement in python? pass is no operation python statement. This is used where python requires syntax but logic requires...