CBSE Class 11 Informatics Practices My Sql Worksheet
Type and execute SQL commands to do the following :
1. Create a table STUDENT with the following fields :
Rollno (int), Name (varchar(20)), Gender (char(1)) and Marks (Decimal(4,1))
2. Add the following rows to the table
3. Display the structure of the table
4. Display all tables in the database
5. Display the result of the expression 7+8/3
6. Display details of the male students who have secured less than 90.
7. Display all the details in descending order of marks and in ascending order of Name.
8. Add a new column Grade (char(1)) to the table.
9. Set the Grade as ‘A’ for those students whose mark is above 90.
10. Display the names of the students who do not have a grade.
11. Delete the students whose mark is below 80.
12. Change name to “Anitha” and marks to 89.0 of the student whose roll number is 2.
13. Modify the data type of column Name to varchar(30)
14. Delete the column Grade.
15. Display roll number, name and marks of the students whose roll number is 2 and 4
16. Display name and marks-3 for all students.
17. Display the student details in the following format Deepa ‘has secured’ 86.5
18. Display names of the students having five letters and ending with ‘a’
19. Add a new row with Rollno =10 , name=’Shakthi’ and Gender=’M’
20. Display names of the students whose marks are entered in the table.
21. Create a table BOYS which will have name and marks of all the boys from STUDENT table.
22. Display the contents of BOYS table.
23. Add a PRIMARY KEY data constraint on the column Name.
24. Change Name column in BOYS table to B_NAME.