0% found this document useful (0 votes)
6 views8 pages

SQL Queries for Data Management Tasks

The document outlines a series of SQL tasks related to data management, including creating tables, inserting and deleting student records, querying student marks, and generating reports on employees. It provides specific questions and requests for SQL code to perform operations such as grouping, ordering, and joining tables. Each question is numbered and requires a corresponding source code solution.

Uploaded by

lavaniasunita
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)
6 views8 pages

SQL Queries for Data Management Tasks

The document outlines a series of SQL tasks related to data management, including creating tables, inserting and deleting student records, querying student marks, and generating reports on employees. It provides specific questions and requests for SQL code to perform operations such as grouping, ordering, and joining tables. Each question is numbered and requires a corresponding source code solution.

Uploaded by

lavaniasunita
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

Shaurya Agarwal

Data Management
Q-1. Create a student table with the student id, name, and
marks as attributes where the student id is the primary key.

Source Code:

Q-2. Insert the detail of a new student in the above table.

Source Code:

Q-3. Delete the details of a student in the above table.

Source Code:
[Link] the select command to get the details of the students
with marks more than 80.

Source Code:

Q-5. Find the min, max, sum and average of the marks in the
student marks table.

Source Code:
Q-6. Find the total number of customers from each country
in the table (Customer ID, Customer Name and Country)
using group by.

Source Code:

Q-7. Write a SQL query to order the (Student ID, Marks)


table in descending order of the marks.

Source Code:
Q-8. Create a new table(Order ID, Customer Name and
Order Date) by joining two tables(Order ID, Customer ID
and Order Date) and (Customer ID, Customer Name,
Contact Name, Country ).

Source Code:

Q-9. Create a foreign key in one of the two tables mentioned


above.

Source Code:
Q-10. Create a new table(name, date of birth) by joining two
tables(Student ID, Name) and (Student ID, Date of Birth).

Source Code:

Q-11. Display a report showing ename, empno, job, sal,


bonus (10%sal) for all employees in descending order of
ename.

Source Code:
Q-12. Display all details of all employees whose name contain
alphabets “A”.

Source Code:

Q-13. Write a query to calculate the number of employees,


sum of their salary and average of their salary from EMPL
table.

Source Code:
Q-14. Calculate the number of employees in each grade
(JOB).

Source Code:

Q-15. Find the location “Anoop”.

Source Code:

You might also like