section b
section b
Set1: 23/09/2024
1 Write SQL query to create database Employee and show all the databases.
Employee_Name Char(20)
Designation Char(20)
Salary Decimal
Consider the following Employee table and write queries based on it.
Table :Employee
1. To display all the records from table Employee in the alphabetic order of their
names
2. To display employee code and employee name from table Employee in the reverse
alphabetic order of their names
3. To display Employee no, Employee name ,Salary, and Salary*12 as Annual Salary
from table employee.
5. To display Employee Name and designation where Employee code equal to 1006 and
Salary less than 24000
6. To display Employee Name and designation where salary between 21000 and 25000
Set 3: 26/09/2024
2. To display the maximum and minimum salary of each designation from table
Employee
3. To display sum of salary and designation from table Employee and group by
Designation where sum of salary greater than 50000
4. To display the total salary and average salary of each designation from table
Employee
5. To display the total no of Designation in the table Employee by avoiding repetition
or null values
6. To display the sum of salary of the employees from employee table where the
employee name has the letter “A”
Set 4: 26/09/2024
2. display NAME AND DESIG of those employees whose sgrade is either “S02” or S03”
3. To display NAME, DESIG, SGRADE of those employees who joined in the year
2009
4. To increment the HRA by 2000 for those employees whose sgrade is s01.
5. To display number of employee working in each SALGRADE from table
EMPLOYEE
Consider the following tables, write the query for (1) to (6) statements.
1.To display minimum and maximum rate of items for each Supplier individually as per
Scode from the table Store.
2. To display ItemNo, Item Name and Sname from the tables with their
corresponding matching Scode.
3. To display Item Name and Sname,rate from the tables with their corresponding
matching Scode and the Quantity is more than 100.
4.To delete the entire details of the item where item number is 2004;
5. Display the item name,scode and sname from both the tables where item name
contains the word ‘Pen’.