Dbms-Practice-Case-Studies-For Practical
Dbms-Practice-Case-Studies-For Practical
Example 3b : Customer:
10 Brighton
20 Downtown
30 Mianus
40 North Town
Write SQL statement with Output for the following:
1. Create Customer and Branch table with above mentioned schema.
2. Insert all tuples in both the tables.
3. Modify the width of assets to number (6) player table.
4. Modify the Assets attribute value by 25% of balamt of all customers.
5. List the names of customer of branch code 10 and stays in Rye city.
6. Display name of the customer which contains ‘N’ character in customer name.
7. List the acno, Customer name, balamt, and Interest of all customers. (interest is 7% of balamt)
8. List the Different customer street present in customer table.
9. List the Names of customer ending with ‘S’.
10. List the Customer Name and balamt, whose balamt is in the range of 3000 and 5000.
11. List the total balamt, highest balamt and average balamt of customer branch code wise for the
branch code 20 and display only those rows having average balamt grater than 1500 and arrange
the result in Descending order of the total balamt.
12. Display the acno, customer name, branch code , Branch name for all customer.
13. List the names of customer who account in the same branch as that of Adams.
14. Write PL SQL program to find area of circle for radius 5.
15. Display the different City present in Branch code 20 and 30.
Dept of Computer Engg. Sub : DBMS Practical & Oral Exam
-----------------------------------------------------------------------------------------------------------------------------
Example No: 1a Employee Table (Data)
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPT NO
(Primary Varchar2(20) Varchar2(20) Number(4) Date Number(9,2) Number(9,2) Number(2)
key)
Number(4)
7369 Smith Clerk 7902 17-DEC-80 800 - 20
7499 Allen Salesman 7698 20-FEB-81 1600 - 30
7521 Ward Salesman 7698 22-FEB-81 1250 300 30
7566 Jones Manager 7839 02-APR-81 2975 500 20
7654 Martin Salesman 7698 28-SEP-81 1250 - 30
7698 Blake Manager 7839 01-MAY-81 2850 1400 30
7782 Clark Manager 7839 09-JUN-81 2450 - 10
7783 Scott Analyst 7566 09-DEC-82 3000 - 20
7839 King President - 17-NOV-81 5000 - 10
7844 Turner Salesman 7698 08-SEP-81 1500 0 30
7876 Adams Clerk 7788 12-JAN-83 1100 20
7900 James Clerk 7698 03-DEC-81 950 30
7902 Ford Analyst 7566 04-DEC-81 3000 20
7934 Miller Clerk 7782 23-JAN-82 1300 10
Department-TABLE (Data)
DEPT NO DNAME LOC
Primary key Varchar2(20) Varchar2(10)
Number(2)
10 Accounting New York
20 Research Dallas
30 Sales Chicago
40 Operations Boston
Department-TABLE (Data)
DEPT NO DNAME LOC
Primary key Varchar2(20) Varchar2(10)
Number(2)
10 Accounting New York
20 Research Dallas
30 Sales Chicago
40 Operations Boston