0% found this document useful (0 votes)
12 views12 pages

section b

The document contains a series of SQL queries organized into sets, focusing on creating and manipulating an Employee database and table. It includes tasks such as creating a database, inserting records, displaying records in various orders, and performing aggregate functions. Additionally, it covers operations on another set of tables related to items and suppliers.

Uploaded by

shaheem.syed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views12 pages

section b

The document contains a series of SQL queries organized into sets, focusing on creating and manipulating an Employee database and table. It includes tasks such as creating a database, inserting records, displaying records in various orders, and performing aggregate functions. Additionally, it covers operations on another set of tables related to items and suppliers.

Uploaded by

shaheem.syed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Section-B ( MYSQL )

Set1: 23/09/2024

1 Write SQL query to create database Employee and show all the databases.

2. Write SQL query to open database Employee.


3. Write SQL query to create the following Table name Employee.

Employee_Code Integer, Not Null and primary key

Employee_Name Char(20)

Designation Char(20)

Salary Decimal

4. Write SQL query to show the structure of the table.

5. Add one or more attribute Joining_date with data type date


6. Insert the following records into table Employee

Employee_Code Employee_Name Designation Salary Joining_Date

1001 Rahul Accountant 25,000 2011-5-25

1002 Krishna Clerk 20,000 2010-6-19

1003 Akshat Accountant 22,000 2012-7-22

1004 Apoorvi Clerk 18,000 2013-3-11

1005 Nishant Supervisor 24,000 2016-4-23

1006 Sanam Accountant 22,000 2010-5-24

1007 Diha Manager 38,000 2012-6-18


Set 2: 23/09/2024

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.

4. To display distinct designation 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

1. To display the total number of records in the table Employee

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

1. To display details of all employee in descending order of their DOJ

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

6. To display the employee name,designation and salary from both tables


employees and sagrade where DOJ is from 2009 to 2010.
SET 5: 30/09/2024

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’.

6. To delete the column Rate from store

You might also like