Abhiman LAB
Abhiman LAB
ASSIGNMENT
Abhiman Singh-
E23CSEU0174
Questions:
1. Display the details of students sorted by age in
ascending order.
2. Display the number of students in each semester.
3. Display the courses which are having more than 2
credits sorted in descending order.
4. Display courses offered in semesters 3 and 5 ordered by
course code.
5. List courses by descending order of credits and then
ascending order of semesters.
6. Find the maximum credits among courses for each
instructor.
7. Display the number of courses offered by each instructor
in semester 3.
8. Create a view that lists instructors and the number of
courses they teach.
9. Create a view that lists students and the number of
courses they are registered for.
CODES:
CREATE DATABASE University;
USE University;
SELECT *
FROM Students
ORDER BY Age ASC;
SELECT *
FROM Courses
WHERE Credits > 2
ORDER BY Credits DESC;
SELECT *
SELECT *
FROM Courses
ORDER BY Credits DESC, Semester ASC;