pdf4
pdf4
1. CREATE COMMAND:
SYNTAX:
EXAMPLE:
2.INSERT COMMMAND:
SYNTAX:
EXAMPLE:
LAB EXPERIMENT-2
1.Create a table EMPLOYEE with following schema: (Emp_no, E_name, E_address, E_ph_no,
Dept_no, Dept_name,Job_id , Salary);
SYNTAX:
EXAMPLE:
EXAMPLE:
3.Change the datatype of JOB_ID from char to varchar.
SYNTAX:
EXAMPLE:
EXAMPLE:
5.Modify the column width of the job field of emp table.
SYNTAX:
EXAMPLE:
LAB EXPERIMENT-3
EXAMPLE:
SYNTAX:
EXAMPLE:
SYNTAX:
DELETE FROM table-name WHERE CONDITION;
EXAMPLE:
6. Display the complete record of employees working in SALES Department.
SYNTAX:
EXAMPLE:
LAB EXPERIMENT -4
1. Display all the dept numbers available with the dept and emp tables avoiding
duplicates.
SYNTAX:
2. Display all the dept numbers available with the dept and emp tables.
SYNTAX:
UNION ALL
EXAMPLE:
3. Display all the dept numbers available in emp and not in dept tables and vice versa.
SYNTAX:
UNION
EXAMPLE:
LAB EXPERIMENT-5
Create a table EMPLOYEE with following schema: (Emp_no, E_name, E_address, E_ph_no,
Dept_no, Dept_name,Job_id, Designation , Salary) Write SQL statements for the following
query.
1. List the E_no, E_name, Salary of all employees working for MANAGER.
SYNTAX:
EXAMPLE:
2. Display all the details of the employee whose salary is more than the Sal of any IT
PROFF.
SYNTAX:
EXAMPLE:
3. List the employees in the ascending order of Designations of those joined after 1981.
SYNTAX:
EXAMPLE:
4. List the employees along with their Experience and Daily Salary.
SYNTAX:
EXAMPLE:
EXAMPLE:
7. List the employees who are working for the Deptno 10 or20.
SYNTAX:
EXAMPLE:
8. List the Enames those are starting with ‘S’ .
SYNTAX:
EXAMPLE:
9. Display the name as well as the first five characters of name(s) starting with ‘H’
SYNTAX:
EXAMPLE:
10. List all the emps except ‘PRESIDENT’ & ‘MGR” in asc order of Salaries.
SYNTAX:
EXAMPLE: