NAME: Ahana Basu
UNIV ROLL: 11500120098
SUBJ: DBMS LAB
DATE: 20-01-2023
Assignment :2
1. Display the entire department information.
select * from Department;
2. Display the department with allotted student number more than 100.
select * from Department where StudentAlloted > 100;
3. Display all students’ detail of CSE.
SELECT * FROM Student where DeptCode = 'CSE';
4. Display students name along with department code and semester who admitted in 2018.
select Name,DeptCode,Semester from Student where YearOfAdm = '2018';
5. Show the name and semester of the CSE students who do not have phone numbers.
select Name,Semester from Student where DeptCode = 'CSE' and PhoneNo is null;
6. Show name and phone numbers students whose name starts with ‘R’.
select Name,PhoneNo from Student where Name like 'R%';
7. Show name and phone numbers students with Surname ‘Kumar’.
select Name,PhoneNo from Student where Name like '%KUMAR';
8. Show name, year of admission, deptcode of the student with second alphabet of name is ‘A’.
select Name,YearOfAdm,DeptCode from Student where Name like '_A%';
9. Show student details of CSE resident of KOLKATA, who born before 2000.
select * from Student where DeptCode = 'CSE' and Address like '%Kolkata' and
to_char(BirthDate,'YYYY') < 2000;
10. Show student details of 2nd year who born in first day of a month.
select * from Student where (Semester = 'SEM3' or semester = 'SEM4') and
to_char(BirthDate,'DD') = '01';
11. Display the students list of IT department who resides in ‘KOLKATA’ and admitted in 2017.
select * from Student where DeptCode = 'IT' and Address like '%Kolkata' and YearOfAdm = '2018';
12. Show the phone no, year of admission and birth date of CSE students born in ‘JUNE’.
select PhoneNo,YearOfAdm,BirthDate from Student where DeptCode = 'CSE' and
to_char(BirthDate,'MM') = '06';
13. Display the list of ECE 3rd year students whose birthday is 20 th October.
select * from Student where (Semester = 'SEM5' or semester = 'SEM6') and DeptCode = 'ECE' and
to_char(BirthDate,'DD') = 20 and to_char(BirthDate,'MM') = 10;
14. Show student details who born in either May, June, September or December.
select * from Student where to_char(BirthDate,'MM') = 06 or to_char(BirthDate,'MM') = 05 or
to_char(BirthDate,'MM') = 09 or to_char(BirthDate,'MM') = 12;
15. Display the students name, department, semester whose age is more than 20 year.
select Name,DeptCode,Semester from Student where
(MONTHS_BETWEEN(SYSDATE,BirthDate))/12 > 20;