Practical 3 & 4 DDL Commands & Constraints
Practical 3 & 4 DDL Commands & Constraints
Practical 3 & 4 DDL Commands & Constraints
DESC graduate_candidates;
INSERTING VALUES-
EXERCISE – 1
EXERCISE – 2
(A) List the different jobs (designations) available in the EMP table.
(A) List the employee names, who are not eligible for commission.
(B) List the name of the employees and designation (job) of the employee,
who does not report to anybody (manager is NULL).
(E) List the details of employees, whose salary is greater than 2000 and
commission is NULL.
QUERY- SELECT * FROM EMP WHERE SAL> 2000 AND COMM IS NULL;
(C) List the names of employees whose names have exactly 5 Characters.
(A) List the name, salary and PF amount of all the employees (PF is
calculated as 10% of salary).
(B) List the names of employees, who are more than 2 years old in the
organization.
(B) List the employee name and hiredate in descending order of Hiredate.
(C) List the employee name, salary, job and department No. in ascending
order of Department No. in ascending order of Department No and then on
descending descending order of salary.
Branch table-
Account table-
Depositor table-
Borrower table-
Exercise-
(A) Find customer ids of those customers who are borrower from the banks and
who appear in the list of account holders.
(D) Get the Customer Id and name of those customers who have both account
and loan from the bank.
(E) Get Branch Name of the branch having highest average balance amongst
all branches.
Exercise -1:
(A) Write SQL query that displays the total and average payments of all
the credit orders.
(B) Write SQL query that displays the total and average payments
grouped by type of payment.
(C) How many order dates are represented compared to the total number
of orders?
(D) Write SQL query that displays the lowest and highest payments of all
the orders
The Net
net
FROM DUAL;
FROM DUAL
FROM DUAL;
(E) Starting with the string “Oracle Internet Academy”, pad the
string to create
****Oracle****Internet****Academy****
QUERY- SELECT REPLACE(RPAD(LPAD('Oracle Internet Academy', 27,
'*'),31,'*'),' ', '****') AS "Result" FROM DUAL;
(G) 7. Display employee last_name and salary for those employees who
work in department 80. Give each of them a raise of 5.333% and truncate the
result to two decimal places