Assignment2_DBMS
Assignment2_DBMS
Assignment - 2
Database Management Systems (DBMS) - CS262
1. Create Table: Create a table student details with the following columns:
• student id (5 characters)
• student name (up to 30 characters)
• department (up to 20 characters)
• cgpa (up to 4.2 format, e.g., 9.2)
2. SELECT Operation:
(a) Retrieve the details of all students with a CGPA greater than 8.0.
(b) Retrieve the names of students who belong to the Civil department.
(c) Find the details of the student with student id = S102.
3. PROJECT Operation:
4. Create Another Table: Create a table course details with the following columns:
• course id (5 characters)
• course name (up to 25 characters)
• department (up to 20 characters)
1
• (C101, Algorithms, Computer Science)
• (C102, Thermodynamics, Mechanical)
• (C103, Concrete Structures, Civil)
• (C104, Circuit Analysis, Electrical)
• (C105, Cyber Security, IT)
5. Cartesian Product: Write a query to combine student details and course details
using Cartesian Product. Show only the first 5 rows of the resulting table.
6. Rename Operation:
7. Natural Join:
(a) Perform a natural join between student details and course details based
on the department column and display the following:
• student name, course name, and department.
(b) List the courses taken by students in the IT department.
8. Combining Operations:
(a) Using SELECT, PROJECT, and NATURAL JOIN, find the names of students
and the courses they are eligible for.
(b) Find all departments that have both students and courses using NATURAL
JOIN.