0% found this document useful (0 votes)
43 views3 pages

Pool

The document contains instructions for creating database tables, inserting data, and writing queries to retrieve and manipulate data. It includes creating tables for employees with columns like name, id, salary, etc. and for departments; inserting sample records; writing queries to list employee names and salaries between a range, find minimum/maximum salaries, and more. It also provides PL/SQL exercises like finding the sum of digits in a number, swapping numbers, finding the reverse of a number, using comments, and calculating areas of shapes.

Uploaded by

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

Pool

The document contains instructions for creating database tables, inserting data, and writing queries to retrieve and manipulate data. It includes creating tables for employees with columns like name, id, salary, etc. and for departments; inserting sample records; writing queries to list employee names and salaries between a range, find minimum/maximum salaries, and more. It also provides PL/SQL exercises like finding the sum of digits in a number, swapping numbers, finding the reverse of a number, using comments, and calculating areas of shapes.

Uploaded by

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

1.1 Create a table called Employee with the following structure.

Name Type
Empno Number
Ename Varchar2(10)
Job Varchar2(10)
Mgr Number
Sal Number
a. Add a column commission with domain to the Employee table.
b. Insert any five records into the table.
c. Update the column details of job

1.2 Create department table with the following structure.


Name Type
Deptno Number
Deptname Varchar2(10)
location Varchar2(10)
a. Add column designation to the department table.
b. Insert values into the table.
c. List the records of dept table grouped by deptno.

1.3 Create table EMP with the following description :


Name Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(3)
AGE NUMBER(3)
ESAL NUMBER
a. Get the description EMP table.
b. List all employees details.
c. List all employee names and their salaries, whose salary lies between 1500/- and 3500/- both inclusive.

1.4 Create table EMP with the following description :


Name Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(3)
AGE NUMBER(3)
ESAL NUMBER
a. List all employee names , salary and 15% rise in salary.
b. List ename whose manager is not NULL.
c. Find no.of dept in employee table.
2.1 Consider a relation Employee with following attributes:
Name Null Type
-------------------------------- ----------------------- -------------------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(3)
AGE NUMBER(3)
ESAL NUMBER(10)
a. List minimum , maximum , average salaries of employee.
b. What is the difference between maximum and minimum salaries of employees in the
organization?
c. Display all employee names and salary whose salary is greater than minimum salary of
the company and job title starts with ‘M’.

2.2 create table emp with attributes (eidnumber,ename varchar2(10),age number,salary number);
a. Count number of employee names from employee table.
b. Display the Sum of age employee table.
c. Find grouped salaries of employees (group by clause).

2.3 Consider the database for a college. Write the query for the following.
Insert at least 5 tuples into each table.
a. List the details of students in the ascending order of date of birth
b. Display the details of students from computer department
c. List the faculties in the descending order of salary

2.4 Consider the database for a banking enterprise. Write the queries for the below questions.
Insert at least 5 tuples in each table
a. Display the branch details
b. List the customers of ‘Mumbai’ city
c. List the male customers of ‘Kolkata’ city

3.1 Write a PL/SQL block to find Sum of Digits of a given Number

3.2 Write a PL/SQL program to SWAP two numbers with and without using temporary variables.

3.2 Write a PL/SQL program to print reverse of a number. For example: 1234 print as 4321.

3.3 Write a PL/SQL program to the declaration of variables.

3.4 Write a PL/SQL block to explain single and multiline comments.


3.5 Write a PL/SQL program to find area and perimeter of rectangle.

3.6 Write a PL/SQL program to find area of circle.

3.7 Write a PL/SQL program to find odd or even number.

You might also like