You are on page 1of 5

Activity -2

Create an employee table with the following fields: Emp_id int , emp_name varchar(25), age int ,
designation varchar(20) , department varchar(20), join_date date, salary int.

Activity-4
Write a code to implement primary key and unique key contraints with alter command.
Activity-5
Write a code to implement NOT NULL contraint with alter command.

Activity-6
Write a code to insert , select and update row and column values.
Activity-7
Write a code to retrieve the the records from the table employee using select statement.

Activity-8
Write a code to display the records using group by clause on “department”.

Activity-9
Write a code to implement having clause on employee table.

Activity-10
Write a code to display the records from the table employee to implement like and where clause
operator.

Activity-11
Write a program to implement a distinct operator.

Activity- 12
Write a program to display the employee records in ascending order using a. order by clause on
“join_date” in ascending order b. order by clause on “dob” in descending order.

Activity-13
Use the following operator on the table employee a. and b. or c. not

Activity-14
Write a code to implement the following functions on the records of an employee a. max() on salary
b. min() on age
Activity-15
Write a code to implement the following functions a. avg() on salary b. count the number of
employees c. sum() on salary.

Activity-16
Write a code to delete an employee from the table having emp_id = 1

Activity-17
Write a code to implement NULL and IS NOT NULL operator.

Activity-18
Write a SQL query to count the number of employees in each department.

Activity-19
Write a sql command to describe the structure of the table employee

Activity-20
Write a sql command to delete the table from database

You might also like