Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 4

Basic SQL:

1. Create and insert the records in table EMPLOYEE having columns


Empno(Primary Key), ename, job, hiredate, basic sal, comm, dept.

2. Create and insert the records in the table DEPT having columns
deptno(primary key), dname, loc.

3. Create and insert the records in table Client_Master. Attributes are


Client_no(Primary Key), name(not null),, Addres1, Address2,City, Pincode,
state, Balance.

4. Create and insert the records in Table Product_Master. Attributes are


Prod_no, Desc, Profit_perc, Unit, Qty_available, Reorder_level, sell_cost,
cost_price.

5. Create and insert the records in table Salesman_master . Attributes are


Salesman_no, name, address1, address2, city, pincode, state, sale_amt,
target, unit_sold, remarks.

6. Create and insert the records in table STUDENT having columns


Srollno(Primary Key), Sname, Branch,Address1,Address2,City,Pincode,State.

Questions:

1. Find name of all client form client_master table.


2. Retrieve the list of names , address, city of all clients from client_master.
3. List all client who are staying in the Delhi.
4. List the names of employe who have a salary less than 3000 from
employee table.

5. List the employee name, job and dept no of everyone whose name fall in the
alphabetical category range C to L from employee table.

6. List the employees whose name starts with letter k form employee table.
7. List the department name which is located in Noida and banglore from dept
table.

8. List the employee name working in department D002 , D003 from employee
table.

9. List the employees whaose name start with A and end with D from employee

table.

10. List all managers and salesman with salary over 5000 from employee table.
11. Display all employees names in alphabetical order from employee table.
12. List all employee who were hired during 1999 from employee table.
13. Rename the employee table.
14. Delete all salesman from the salesman_master whose salaries are equal to RS
2000.

15. Write a query to undo the above delete query.


16. Write all products from product _master where the Qty_Available is equal to
100.

17. Write aquery such that the above query can not undone.
18. Delete all employees from employee where basic salary is less than 2000.
19. Implement Update command on the above given tables.
20. Add a column in the table employee.
21. Remove a column from the employee table.
22. Change the size of the attribute 1 in the employee table.
23. Retrieve the entire contents of STUDENT table.
24. Change the City of Rollno 10056 to Kanpur.
25. Delete the Sname of table STUDENT where State=kerala.
26. Add the column pass_year into table STUDENT
27. Change the name of column Branch to Specialization.
28. Create a view VI from employee table.
29. Drop the above created view .
30. Create an index for client _no on client_master.
31. Create a view as V2 from employee table with basic sal, emp no and ename.
32. Use different SQL*Plus functions.

Relation, Join, Reports:

1. [DONE] Create and insert the records in table Client_Master. Attributes are
Client_no(Primary Key and First letter must be start with C), name(not null),,
Addres1, Address2,City, Pincode, state, Balance.

2. [DONE ] Create and insert the records in Table Product_Master. Attributes


are Prod_no(Primary Key and First letter must be start with P), Desc(not
null), Profit_perc(not null), Unit(not null), Qty_available(not null),
Reorder_level(not null), sell_cost(not null, cannot be 0), cost_price(not null,
cannot be 0).

3. [DONE] Create and insert the records in table Salesman_master34 . Attributes


are Salesman_no (Primary Key and First letter must be start with S) , name
(not null), address1 (not null), address2 , city, pincode, state, sale_amt (not
null, cannot be 0), target (not null, cannot be 0), unit_sold(not null), remarks.

4. Createand insert the records in table sales_order having attribute


order_no(primary key and first letter must be start with O),ord_dat,
Client_no (foreign key references client_no of client master table),
Delivery_add(part (p)/full F Default F) , salesman_no( foreign key references
salesman _no of salesman_master table), Delivery_type, Billed_yn,
Del_date(cant be less than ord_date), Order_status(under process,
completed, cancealled, back order).

5. Create and insert records in table sales_order_detail having attributes


oredre_no(primary key / foreign key references order_no of the sales_order
table), prod_no (primary key/ foreign key references product_no of the
product_mast table), Qty_ordered, Qty_disp, Product_cost.
Questions:

1. Display the desc and total qty sold for each product.
2. Calculate the average qty sold for each client that has a maximum order
value of 3000.

3. Find out the sum total of all the billed orders for the month of February.
4. Find out the products which have been sold to harry.
5. Find the products and their quantities that will have to be delivered in the
june month.

6. Find the name of clients who have purchased RAM.

7. List the product_no and order_no of customers having qty_orederd less than
8 from the sales_order_detail table for the product RAM.

8. Create the report of Product_master table with total sell price and cost
price .

9. Create report of client_master table with total balance.


10. Create the report of salesman_master table with table sales_amt and total
units_sold.

11. Find the names of client who have placed order before the month of june 04.
12. Find the names of client who have placed order worth RS. 3000 or more.
13. Find the products and their quantities for the order placed by harry and
potter.

14. Find the products and their quantities for the orders placed by client_no
c001 and c003.

15. Find the customer name, city and pin code for the client who placed order no
0001.

PL/SQL

1. Write a PL/SQL Block to print the Fibonacci series.


2. Write a PL/SQL block to calculate gross salary on the basis of basic salary if
the DA is 40% of basic, HRA is 20% of basic and PF is 12% of basic salary.

3. Write a PL/SQL block to calculate the sum of digits of a number entered


through the keyboard.

4. Write a PL/SQL block. Take the salary of an employee into a variable and
check if his or salary is less than 3000 than update the salary with 5140.

You might also like