class 11 revision test
class 11 revision test
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.
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.
12. Change name to “Anitha” and marks to 89.0 of the student whose roll number is 2.
15. Display roll number, name and marks of the students whose roll number is 2 and 4
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.
Rollno INT,
Name VARCHAR(20),
Gender CHAR(1),
Marks DECIMAL(4,1)
);
DESCRIBE STUDENT;
SHOW TABLES;
SELECT 7 + 8 / 3 AS result;
-- 6. Display details of the male students who have secured less than 90.
SELECT * FROM STUDENT WHERE Gender = 'M' AND Marks < 90;
-- 7. Display all the details in descending order of marks and in ascending order of Name.
-- 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.
-- 12. Change name to “Anitha” and marks to 89.0 of the student whose roll number is 2.
-- 15. Display roll number, name and marks of the students whose roll number is 2 and 4.
SELECT Rollno, Name, Marks FROM STUDENT WHERE Rollno IN (2, 4);
-- 17. Display the student details in the following format: Deepa ‘has secured’ 86.5
SELECT CONCAT(Name, ' has secured ', Marks) AS Details FROM STUDENT;
-- 18. Display names of the students having five letters and ending with ‘a’.
SELECT Name FROM STUDENT WHERE Name LIKE '____a';
-- 19. Add a new row with Rollno =10 , name=’Shakthi’ and Gender=’M’.
INSERT INTO STUDENT (Rollno, Name, Gender, Marks) VALUES (10, 'Shakthi', 'M', NULL);
-- 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.
CREATE TABLE BOYS AS SELECT Name, Marks FROM STUDENT WHERE Gender = 'M';