To Perform various data manipulation commands, aggregate functions and sorting
concept on all created tables in previous tutorial.
Queries
List total deposit from deposit.
- select sum(amount)from deposit_gtu;
List total loan from karolbagh branch
- select sum(amount) from deposit_gtu where bname='Andheri';
Give maximum loan from branch vrce.
- select max(amount) from borrow_gtu where bname='VRCE';
Count total number of customers.
- select count(cname) from customers;
Count total number of customer’s cities.
- select count(DISTINCT city) from customers;
Create table supplier from employee with all the columns.
- create table supplier as select * from employee;
Create table sup1 from employee with first two columns.
- create table sup1 as (select * from employee WHERE EMP_NO<103 );
Create table sup2 from employee with no data.
- create table sup2 as select * from employee WHERE 1=2;
Insert the data into sup2 from employee whose second character should be ‘n’
and string should be 5 characters long in employee name field.
- INSERT INTO sup2 SELECT * FROM employee where emp_name like '_n___';
Delete all the rows from sup1.
Delete the detail of supplier whose sup_no is 103.
- delete from supplier where emp_no=103;
Ossum
ReplyDeleteSuperb....
ReplyDelete