Professional Documents
Culture Documents
Exp6sql - PDF 20231027 140132 0000
Exp6sql - PDF 20231027 140132 0000
Task to be Done – columns: Name, Grade and Mark. Ketty doesn't want the NAMES of those students
who received a grade lower than 8. The report must be in descending order by grade -- i.e. higher grades
are entered first. If there is more than one student with the same grade (8-10) assigned to them, order those
particular students by their name alphabetically. Finally, if the grade is lower than 8, use "NULL" as their
name and list them by their grades in descending order
Experiment 6: -
1.First, we have to create a database name exp6
use EXP6;
Min_Mark INT,
Max_Mark INT
);
VALUES
(1, 0, 9),
(2, 10, 19),
Marks INT
);
4.Then we put values in that table
VALUES
5.we write a query to perform. higher grades are entered first . If there is more than one student with
the
same grade (8-10) assigned to them, order those particular students by their name alphabetically. Finally,
if the grade is lower than 8, use "NULL" as their name and list them by their grades in descending order
SELECT
CASE
ELSE 'NULL'
END AS Name,
Grades.Grade,
Students.Marks
FROM Students
OR Grades.Grade IS NULL
LEARNING OUTCOMES
We learn that how to write a query with joins and conditions .
We learn that how to write query for printing higher value first then lesser value
We learn that how to write complex query in joins and fetch data according to that.