0% found this document useful (0 votes)
13 views6 pages

DBMS - Lab Manual - Sol

The document outlines a practical set of SQL commands for managing and querying database tables related to deposits, branches, borrowers, and customers. It includes commands to describe tables, select data, filter results based on conditions, and modify table structures. The commands demonstrate various SQL operations such as SELECT, DESC, and ALTER TABLE for database management tasks.

Uploaded by

fabodi9727
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views6 pages

DBMS - Lab Manual - Sol

The document outlines a practical set of SQL commands for managing and querying database tables related to deposits, branches, borrowers, and customers. It includes commands to describe tables, select data, filter results based on conditions, and modify table structures. The commands demonstrate various SQL operations such as SELECT, DESC, and ALTER TABLE for database management tasks.

Uploaded by

fabodi9727
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Practical set - 1

1. Describe tables DEPOSIT and BRANCH


DESC DEPOSIT;
DESC BRANCH;

2. Describe tables BORROW and CUSTOMERS


DESC BORROW;
DESC CUSTOMERS;

3. List all data from table DEPOSIT


SELECT * FROM DEPOSIT;
4. List all data from table BORROW
SELECT * FROM BORROW;

5. List all data from table CUSTOMERS


SELECT * FROM CUSTOMERS;

6. List all data from table BRANCH


SELECT * FROM BRANCH;
7. Display all the table names currently in database
SELECT table_name FROM user_tables;

8. Give account no and amount of depositors


SELECT ACTNO, AMOUNT FROM DEPOSIT;

9. Give borrower details having branch name ‘Andheri’


SELECT * FROM BORROW WHERE BNAME = 'ANDHERI';
10. Give name of depositors having amount greater than 4000
SELECT CNAME FROM DEPOSIT WHERE AMOUNT > 4000;

11. Give name of customers who opened account after date '1-12-
96'
SELECT CNAME FROM DEPOSIT WHERE ADATE > TO_DATE('01-DEC-1996', 'DD-MON-YYYY');

12. Display customer names at branch ‘Virar’


SELECT D.CNAME FROM DEPOSIT D JOIN BRANCH B ON D.BNAME = B.BNAME WHERE
B.BNAME = 'VIRAR';

13. Display all the branches in city Bombay


SELECT * FROM BRANCH WHERE CITY = 'BOMBAY';
14. List all the customers from city ‘Nagpur’
SELECT * FROM CUSTOMERS WHERE CITY = 'NAGPUR';

15. Display the borrower detail in branch ‘Ajni’


SELECT * FROM BORROW WHERE BNAME = 'AJNI';

16. Display distinct cities from branch table


SELECT DISTINCT CITY FROM BRANCH;

17. Add contact_no field in table CUSTOMERS with data type


VARCHAR2 and size 15
ALTER TABLE CUSTOMERS ADD contact_no VARCHAR2(15);
18. Change the data type of contact_no field to NUMBER and size to
20
ALTER TABLE CUSTOMERS MODIFY contact_no NUMBER(20);

19. Drop contact_no field in table CUSTOMERS


ALTER TABLE CUSTOMERS DROP COLUMN contact_no;

You might also like