Documente Academic
Documente Profesional
Documente Cultură
1
Column Name Data Type Size
client_no INT 6
Name Varchar 20
Address Varchar 30
City Varchar 15
Pincode INT 8
State Varchar 15
Bal_due Double 10,2
b. Table Name: Product_master
b) product_master
Qty_disp INT 8
Product_rate Double 10,2
3
Machine Exercise-2
1. Find out the names of all the clients in the client_master table.
2. Retrieve the entire contents of salesman_master table.
3. Retrieve the list of names and cities of all the clients.
4. List the various products available from product_master table.
5. List all clients who are located in Pune.
6. Find the names of salesman who have salary greater than Rs. 3000.
7. List all information about all employee of EMP table.
8. List all employee names along with their salaries from emp table.
9. List all information about all departments from dept table.
10.List all deptno,empno,mgr from emp table.
Machine Exercise-3
4
Machine Exercise-4
2. List the employee details not belonging to department number 10,30 and 40.
3. List the employee’s names and salary whose salary is between 1000 and 2000.
4. List the employee’s names who are not eligible for commission.
5. List the names of employees and designation (job) of the employee who doesn’t
report to anybody (managers is NULL).
6. List the employees not assigned to any department.
7. List the employee who are eligible for commission.
8. List the details of employes whose salary is greater than 2000 and commission
is NULL.
9. List the employees who names start with ‘S’(not ‘s’).
10. List the names of employees whose names have exactly 5 characters.
Machine Exercise-5
1. List the employee names having ‘I’ as the 2nd character.
2. List the name ,salary and PF amount of all the employees(PF is calculated
as 10% of salary).
3. List the names of employees who are more than 2year old in the
organization
4. List the Clients having no balance.
5. List the client information of those clients whose name have 2nd character as
‘a’.
6. List the actual profit from product_master.
7. List the actual cost price for each product.
8. List the product information for those items in which the actual profit (Rs.)
is more than 50.
9. Retrieve the total cost for each product.(Total Cost= qty X cost price).
10. Retrieve the sales amount of ‘excellent’ salesman.
5
11.Retrieve the contents of the column product_no, description and compute
5% of the values contained in the column sell_price and 1.05% of values
contained in the field sell_price for each row from the table product_master.
12. Rename sell_price * 0.05 filed as Increase and sell_price *1.05 as new price
in the above query.
13. Retrive the contents of colum product_no ,description ,profit_percent from
the table product_master where the values contained in the field
profit_percent is between 10 and 20 both inclusive.
14. List specified client information for the clients who are not in ‘Bombay’.
15. List the information of clients whose name includes ‘g’ as a character.
Machine Exercise-6
1. Update the table Client_Master change the contents of the Field name to ‘Vijay
Kadam’ and the contents of the field address to ‘SCT jay Apartments’ for the
Record identified by the field Client_no containing the value’c02000’;
2. Give every employee a bonus of 15%. Calculate the 15% amount based on the
value held in the column basic_sal of the table emp_master and update the
values held in the column net_sal.
3. Add the fields Client_tel,which is the field that can hold a number up to 8 digits
in length and Client_fax that can hold number up to 15 digits in length.
4. Modify the field Client_name of the table Client_master to now hold a
maximum of 25 character values.
5. Rename the table Client_master to Client_master 1;
6. Destroy the table Client_master and all the data held in it;
7. Delete rows from the table Client_Master where the value in the Bal_due field
is less than 500;
8. Promote the employee who has empno ‘7876’ to ‘ANALYST’
9. Increment the salary of ‘james’ by 10% of existing pay of emp table.
6
10. Update the record of ‘SMITH’ in such a way that salary of ‘smith’ should be
incremented by 20% and commission allocation is 5% of existing salary.
11. Rename the table ‘dept’ to ‘Department’.
Machine Exercise-7
Machine Exercise-8
1. Return String with first letter in Upper Case of “AMRITSAR
ENGINEERING COLLEGE” with heading AS Title Name.
2. Return char, with all letters in upper case of “Amritsar College ” with a
heading as Upper.
3. Return a portion of char “ENGINEERING”, beginning at character ‘4’
exceeding upto end.
4. Return a portion of char “ENGINEERING”, beginning at character ‘4’
exceeding upto ‘9’ character.
7
5. Return the Length of character “ENGINEERING”.
6. Return the Length of character “AMRITSAR COLLEGE”.
7. Remove characters from left to char with initial chars removed upto first
character not in set of “COLLEGE”.
8. Return char with final character removed after the last character not in set
of “COLLEGE”.
9. Return char, left padded to length ‘20’ with ‘*’ inserted in padded space
of word “ENGINEERING”.
10. Return the greatest of the following values (20, ‘8’, -3)
Machine Exercise-9
1. Return the least value in the list of expressions (‘lord’ , ‘LORD’, ‘b’ , ‘xyz’).
2. Update the comm as null where comm is 0 in the employee table.
3. Return ename, sal, comm.,sal+comm gross, sal+NVL as New Gross from
employee table.
4. Translate the character e in the ename column of employee table to 1.
5. Translate the character a in the ename table such that a gets removed
from wherever it exists in the ename column of employee table.
6. Replace the Job clerk to executive and manager to RM in the employe
table.
7. Display the order number and day on which clients placed their orders.
8. Display the month (in alphabets) and date the order must be delivered.
9. Display the order_date in the format ‘DD-Month-YY’ . e.g. 12-
February-96.
10. Find the Date, 15 days after today’s date.
11. Find the number of days elapsed between today’s date and the delivery
date of the orders placed by the clients.