0% found this document useful (0 votes)
17 views

Keshav Lab 4

The document describes creating an employee table with fields like employee number, name, designation, hire date, salary, and incentive. It provides instructions to modify the size of an existing column, add constraints like a default value, insert records, add a phone number column, view constraints, update salaries, and perform various queries on the table like finding max salary, experience, and averages.

Uploaded by

Keshav Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Keshav Lab 4

The document describes creating an employee table with fields like employee number, name, designation, hire date, salary, and incentive. It provides instructions to modify the size of an existing column, add constraints like a default value, insert records, add a phone number column, view constraints, update salaries, and perform various queries on the table like finding max salary, experience, and averages.

Uploaded by

Keshav Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

Create table employee_040 Field name Emp_no Ename Designation Hiredate Salary Incentive Field type Number Varchar2

2 Varchar2 Date Number Number 7,2 7 Size 4 20 10 Constraint Primary key

Creation of table:-

1. Modify the definition of an existing size of column incentive as (5,2)

2. Add the following constraints: Default on column incentive as 0 value

b) Insert atleast 10 records in a table

(C)Queries 3 - Add a new column ph_no(7,0)

4 - Insert a new row with ename as null

5 Write a command to view the constraints of the table along with the column name

6 Find out the employees whose incentive is null

7 Update the salary with RS 500.

8 Find out the experience of each employee in the company

9 Find out the average salary of the employees.

10 Find out the name and sum of salary and incentives of each employee and give the alias name as gross_salary

11 Count the number of employees who got 0 incentives.

12 Count the number of employees

13 Count the number of jobs in the company.

14 Find out the employee who who got maximum annual salary

15 Find out the name and salary of each employee Display should be like this: ename salary is salary

16 List all the employees who are not professor sorted by name.

17 Count the number of employees whose experience>5

18 Find out the name and length of name for each employee.

19 Display the hiredate of each employee. Eg: 12th-Apr-97

20 Find the date ,15 days after todays date.

21 Display

the hire date as spelling. E.g.: one, twelve etc

22. Find out the user name and user id.

You might also like