0% found this document useful (0 votes)
4 views3 pages

Unit 3

The document contains a series of SQL query tasks and theoretical questions related to database management. It includes practical queries for retrieving student marks, customer information, and employee details, as well as theoretical explanations of SQL concepts like joins, triggers, and stored procedures. Additionally, it presents derived questions that require advanced SQL skills to analyze data patterns and relationships.
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)
4 views3 pages

Unit 3

The document contains a series of SQL query tasks and theoretical questions related to database management. It includes practical queries for retrieving student marks, customer information, and employee details, as well as theoretical explanations of SQL concepts like joins, triggers, and stored procedures. Additionally, it presents derived questions that require advanced SQL skills to analyze data patterns and relationships.
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/ 3

✅ Query-Based Questions

1. Find average marks of each student, along with the Roll_no of student of
subject code ‘CE2412’.
2. Find how many students have failed in the subject “DBMS”.
3. Construct suitable view on above schema.
4. Write SQL queries for the following:
a. Find the names and address of customers who have a loan.
b. Find the total amount of balance of all the accounts.
c. List all the customers who are borrowers.
d. Find all the accounts of “shivaji nagar” branch of Pune city.
5. Construct the following Queries in SQL:
a. Find out all Doctors who have visited to Hospital in same city in which they
live.
b. Find to which Hospital “Dr. Joshi” has visited.
c. Count no. of Doctors visited to “Shree Clinic” on 1st March 2014.
6. Write SQL queries for the following:
a. Show the name, job, salary and commission of those employee who earn
commission. Sort the data by the salary in descending order.
b. Show the department names, locations, names, job titles and salaries of
employees who work in location 1800.
c. How many employees have a name that ends with an “n”?
d. Show the names and locations for all departments and the number of
employee working in each department. Make sure that departments without
employees are included as well.
7. Write SQL queries for the following:
a. Find the name of supplier who supply some red parts.
b. Find the name of all part whose cost is more than Rs. 250.
c. Find the name of all part whose color is green.
d. Find the name of all part supplied by each supplier.
8. Write SQL queries for the following:
a. List the name of customer who belong to Maharashtra state, sorted on city.
b. What are the name of all customer who placed the order between
01/01/2010 to 31/03/2011?
c. Define constraint on order amount such that it should be always greater than
zero.

📘 Theory-Based Questions
1. Explain on delete cascade command with suitable example.
2. What are different types of joins in SQL? Explain with suitable example.
3. Explain with suitable example SQL aggregate functions.
4. Write the syntax for following SQL commands:
a. create table
b. alter table
c. drop table
d. insert
e. delete
f. update
5. Write and explain SQL function and procedures with sample example.
6. What is trigger? State and explain two categories of Triggers.
7. What is Cursor? State and explain two categories of Cursors and their syntax.
8. Describe circumstances under which you would choose to use Embedded SQL
rather than normal SQL or a general-purpose programming language.
9. Differentiate between:
a. Trigger & stored procedure
b. Embedded SQL and Dynamic SQL
10. Explain the concept of Dynamic and Embedded SQL.
11. Explain in detail with syntax Stored Procedure and Trigger.
12. What is view? List two major problems with processing update operations
expressed in terms of views.
13. Explain need for the following:
• View
• Null values
14. Write a note on:
• Database Modification using SQL
• Set Operation
15. Write a note on SQL Aggregate Functions.
🧠 New Derived Questions (Based on Patterns)
1. Find students who scored above average in subject 'DBMS'.
2. List the names of students who have taken all subjects offered.
3. Create a view showing student name, subject name, and marks for only passed
students.
4. Write a query to find hospitals with the maximum number of doctor visits.
5. List doctors who have visited more than one hospital.
6. List departments that do not have any employees.
7. Find total number of parts supplied by each supplier and their total cost.
8. Display customers who have placed more than 3 orders.
9. List the names of employees who do not report to any manager.
10. Write SQL query to find the second highest salary from the employee table.

You might also like