DBMS Lab 2
DBMS Lab 2
1. Create the Student table (Roll, Name, City, Age, Branch, Contact).
2. Add CGPA column using Alter command.
3. Display distinct cities from the table.
4. Change the name of the column Roll to Roll No.
5. Update CGPA of roll no 102 to 9.
6. Sort the records in ascending order of CGPA.
7. Increase the field size of Name column.
8. Delete the record of student with roll no. 212.
9. Display name and roll no. of students whose city is Bhubaneswar.
10. Display the age of all students increased by 5 years under ‘Age after 5 years’ column.
11. Add a new column ‘Hostel Address’ containing values in the format: ‘KP1’, ‘QC4’ etc.
12. Display Roll No and Names of Students whose names start with S or ends with A.
13. Display Roll No and Names of Students whose age is between 20 to 25.
14. Display Roll No and Names of Students whose name contains a in the 3rd position.
15. Display Roll No and Names of Students whose Age is null.
16. Display Roll No and Names of Students whose names start with S or ends with A.
17. Display Roll and CGPA concatenated under column ‘Roll & CGPA’.
18. Display Roll No and Names of Students whose age is less than 20 or greater than 25.
19. Create a new table CSE_Students from existing Student table containing student details of CSE
branch only.