0% found this document useful (0 votes)
1 views14 pages

202251062_DBMS_WEEK4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views14 pages

202251062_DBMS_WEEK4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

 INITIAL CODE OF MAKING TABLE AND INSERT DATA IN

TABLE :-
1.

2.

3.

4.
5.

 NOW PRINT THE GIVEN TABLE :-

1. Write and execute an SQL query to list all the student’s Rollno,
Name, and Gender who are enrolled in course DBMS and OS.

2. Write and execute an SQL query to list the number of female


students in sports.
3. Write and execute an SQL query to list all the details of the
students who are enrolled in the DBMS course and have also
participated in some sports.

4. Write and execute a query to list details of the students who are
playing chess and are born between month November and December.

5. Write and execute a query that gives Courses details, Sports


participation details by a student whose name starts with ‘A’.
6. Give the count of the students in each sport in descending order
with the name of the student, and the name of the sport.

7. Give the count of students enrolled in each course and show it in


ascending order.

8. Give the count of students in each Branch and show it in


descending order.
9. Write and execute an SQL query that gives the name and count of
courses in which more than 3 students are enrolled.

10. Write and execute an SQL query that gives the name and course
code of courses whose credits are either 2 or 1.

11. Write and execute an SQL query that gives details of students who
are enrolled in courses whose credits are either 2 or 1.
12. Write and execute an SQL query to list name of the students who
are playing same sports (Hint : use self-join).

13. Write and execute an SQL query that shows details of students
who are playing chess and are not enrolled for Maths and Statistics.

14. Write and execute an SQL query to update a student detail whose
rollno is 111222 and show that rollno 111222 exists in the student
table.
15. Write and execute an SQL query to Delete the details of students
who have enrolled in course Maths and are playing volleyball from
enrolled Students table.

16. Write a query to display duplicates in CName column in Enrolled


Students table using Exists operator.

17. Write a query to get the name of students whose age is greater
than all the students in playing 'Chess'.
18. Write a query to get the names of students who are playing the
same sport and are enrolled in the same courses.

19. Write a query to get the course name where no student is playing
'Table Tennis'.
20. Write a query to get the names of students who are enrolled in
more than 2 courses.

You might also like