Anda di halaman 1dari 3

ADBMS EXPERIMENT 2 Aim :- To perform an experiment related to advanced SQL commands.

Software Requirement :OS :- Windows Database :- Oracle 10g Express Edition. 1] Create a table called student_info having following information.
Roll_no number(3) 201 201 202 203 210 215 225 205 Name varchar2(10) Mahesh Mahesh Manali Mayur Rajiv Rakesh Ramesh Vaishali Year varchar2(3) S.E S.E S.E S.E S.E S.E S.E S.E Book_name varchar2(8) DBMS CG MATHS AOA DBMS DBMS CG OS Bid varchar2(4) B201 B202 B203 B204 B205 B206 B207 B208

2] Create a table called faculty having following information Faculty_id number(1) 1 2 3 4 5 6 7 Faculty_name varchar2(10) Nalawade Dhawale Jadhav Vardam Khadilkar Dhawale Jadhav Book_name varchar2(8) ADC AOA OS CG DBMS WT ADBMS Book_id varchar2(4) B101 B102 B103 B104 B105 B106 B107

3] Create a table called Books having following information Book_id varchar2(4) B201 B202 B203 B204 B205 B206 B207 B208 B101 B102 B103 B104 Book_name varchar2(8) DBMS CG MATHS AOA DBMS DBMS CG OS ADC AOA OS CG ISBN number(8) 1050 2011 2017 1075 3217 1235 1165 1257 1236 2223 3252 2315

B105 DBMS 2017 B106 WT 3253 B107 ADBMS 2233 Q4] Find name and book they have taken of all students. Q5] Show all information of faculty name & book_id of taken book. Q6] Find the names of all students who have taken the same book as faculty vardam. Q7] Create a join between Books and Student_info table. Q8] Take a join between Books and Student_info table using column Bid. Q9] Take a join between Books and Student_info table using ON clause. Q10] Take a left outer join between Student_info & Books. Q11] Take a right outer join between Student_info & Books. Q12] Find Book_name of books which are borrowed by student whose name ends with sh. Q13] Take a cross join between Faculty and Student_info table. Q14] Find Roll_no and name of student who has taken a book which has ISBN between 2001 and 3000. Q15] Find Book_name and Book_id of books which are taken by faculty Dhawale. Q16] Create a table customer and insert following information into it. Cust_id varchar2(3) Cname varchar2(10) Salary number(6) Purchased_total number(5) C1 Manisha 15000 C2 Rakesh 20000 2000 C3 Rushi 12000 3500 C4 Rajan 11000 1500 C5 Ranjan 18000 5000 Q17] Show the names of all customers who either do not purchased anything or whose names starts with Ra. Q18] Find total number of rows in customer table usingncname. Q19] Find total number of rows in customer table using purchased_total Q20] Find the total purchased amount,Average purchased amount,Min & Max purchased amount in the customer table. Theory :Theory will be related to following points. 1] Types of Joins :- Cross join Natural Join Left , right and full outer join Join by USING clause Join by ON clause 2] Between Clause 3] Aggregate functions 4] Like clause 5] NVL function Conclusion :Thus we have studied advanced SQL commands and performed an experiment related to.

Anda mungkin juga menyukai