0% found this document useful (0 votes)
6 views2 pages

DBMS_SQL_Lab_Work_4

The document provides MySQL commands for various operations on the STUDENTS table. It includes commands to list students in Class IX, display a report of students sorted by score, count the number of students, and insert a new student. Additionally, it outlines queries to select students with scores above 380, count distinct streams, and list students with grade 'A'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

DBMS_SQL_Lab_Work_4

The document provides MySQL commands for various operations on the STUDENTS table. It includes commands to list students in Class IX, display a report of students sorted by score, count the number of students, and insert a new student. Additionally, it outlines queries to select students with scores above 380, count distinct streams, and list students with grade 'A'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Consider the table STUDENTS given below.

Write commands in MySQL


for (i) to (iv) and output for (v) to (vii).
TABLE STUDENTS

(i) To list the StudentName whose Class is IX.


(ii) To display a report listing StudentName, Class and Score in
descending order of Score.
(iii) To count the number of Students.
(iv) To insert a new row in the table STUDENTS.
7, ‘Divya Prakash’, ‘Science’, 355, ‘C’;
(v) SELECT StudentName, Stream FROM STUDENTS WHERE Score
>380;
(vi) SELECT COUNT (DISTINCT Stream) FROM STUDENTS;
(vii) SELECT StudentName, Class FROM STUDENTS WHERE Grade = ‘A’;
Answer:
(i) SELECT StudentName
FROM STUDENTS
WHERE Class = IX’ ;
(ii) SELECT StudentName, Class, Score
FROM STUDENTS
ORDER BY Score DESC;
(iii) SELECT COUNT(* )
FROM STUDENTS;
(iv) INSERT INTO STUDENTS VALUES (7, ‘Divya Prakash’, ‘Science’, 355,
‘C’);

You might also like