Professional Documents
Culture Documents
SQL Practical
Write the SQL commands for (1) to (10) and write the output for (11) to (15), On the basis of table
EMPLOYEE.
(1).To create table with the mentioned attribute names with primary key constraints on ECODE.
(2).To display details of all Employees from the table EMPLOYEE.
(3).To display ECODE, ENAME and SALARY from the table EMPLOYEE.
(4).To display all Employees from the city ‘Delhi’.
(5).To display employees’ details having grades ‘E2’ or ‘E3’ from table EMPLOYEE.
(6).To display list of Employees having salary more than 2500 in the alphabetical order.
(7).To display number of Employee in each JOB.
(8).To insert new set of values into the table EMPLOYEE for all attributes.
(9).To double the salary of employee of grade ‘E3’;
(10). To delete the definition of table EMPLOYEE from Database.
Ans.(11). 6
Ans.(12).
ECODE ENAME ESEX EJOB EGRADE ESALARY ECITY
102 Anil M Manager E2 4000 Hyderabad
103 Mauhar M Manager E2 4000 Dholpur
104 Sangle M Manager E2 4000 Mumbai
Ans.(13).
ECODE ENAME ESEX EJOB EGRADE ESALARY ECITY
101 Jacob M President E1 5000 Bangalore
102 Anil M Manager E2 4000 Hyderabad
103 Mauhar M Manager E2 4000 Dholpur
104 Sangle M Manager E2 4000 Mumbai
105 Rajnikanth M Clerk E3 3000 Ahmedabad
106 Deepak M Clerk E3 3000 Delhi
Ans.(14). 2000
Ans.(15).
EJOB COUNT
President 1
Manager 3
Clerk 2