Name:-Maaz Shaikh roll.
no:-244117 div:-B subject:-
crdbms
Q.1 create the following tables with necessary constraint.
Hostel(hid,hname,total capacity,warden)
Room(rid,hid,[Link],[Link],status)
Charges(hid,[Link],charges)
Students(sid,sname,faculty,hid,rid,calss)
Fees(sid,[Link],[Link])
*Query:-
1. Create above tables with appropriate constrain.
2. Add check constraint to room table so that the room
type allows only ‘s’ for single,’d’ for doubles,’f’ for
striple.
3. Display the total number of rrom that are presently
vacant.\4.
4. Display hostel which have at least one single aseted
room.
5. Display the warden name and hostel address of
students of computer science department.
6. Display details of students who have still not paid fees.
7. List details about students who are staying in the
double seated rooms of Chanakya hostel.
8. Display detail about students who have paid fees in the
month of nov.2023.
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Q2 write a PL/SQL block that will accept an employee
number from the user and deduct a salary by Rs.1000 from
the input employee number. If employee has a ,inimum
salary of Rs.500 after salary is deducted the display
message “SALARY IS NOT ENOUGH TO DEDUCT” otherwise
deduct the salary. Use the table
EMP(EMPNO,NAME,ADDRESS,MONO,SALARY).
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Q.3 write a program in PL/SQL to FETCH single record and
single column from a table.
Q.4 write a program inPL/SQL to find the number of rows
effected by the use of SQL%ROWCOUNT attributes of an
implicit cursor.
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms
Q.5 write a program in PL/SQL to find the number of
SQL%FOUND to determine if a DELECT statement affected of
an implicit cursor.
Q.6 write a PL/SQL block to find employee(s) having
minimum salary(without using min function).(take
appropriate table and columns as oer requirement).
Name:-Maaz Shaikh [Link]:-244117 div:-B subject:-
crdbms