SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
PRACTICAL LAB ASSIGNMENT: 1 (Required Lab Hours : 4)
A. Create a relational database that contains the following tables and insert the following data into
these tables.
STUD_MEMBER
Roll_No FName MName SName Dept_ID Semester Contact_No Gender
1 Ankur Samir Kahar 1 1 272121 M
2 Dhaval Dhiren Joshi 1 1 232122 M
3 Ankita Biren Shah 1 1 112121 F
10 Komal Maheshkumar Pandya 2 3 123123 F
13 Amit Jitenkumar Mehta 3 3 453667 M
23 Jinal Ashish Gandhi 2 1 323232 M
22 Ganesh Asha Patel 2 3 124244 M
4 Shweta Mihir Patel 3 1 646342 F
7 Pooja Mayank Desai 3 3 328656 F
8 Komal Krishnaraj Bhatia 2 3 257422 F
43 Kiran Viraj Shah 1 1 754124 F
DEPARTMENT
Dept_ID Dept_Name
1 Information Technology
2 Electrical
3 Civil
4 Mechanical
5 Chemical
B. Now, solve the following SQL Queries.
1. Display the names and contact numbers of all student members.
2. Give the names and roll numbers of all students of Information Technology who are members.
3. Display names of Departments whose students are members.
4. Display names of Departments for which no students are members.
5. Display names of all Departments.
6. Find the number of students of Electrical Department who are members.
7. Display information of student members whose name begins with the letter “A”.
8. Display all details of Male members only.
9. Display data of student members who are currently in semester „3‟.
10. Display data of student female members in alphabetical order.
PRACTICAL LAB ASSIGNMENT (SQL): 2 (Required Lab
Hours : 4)
Table: sales
OrderID
1
2
3
4
5
6
7
OrderDate
12/22/2005
08/10/2005
07/13/2005
07/15/2005
12/22/2005
10/2/2005
11/03/2005
OrderPrice
160
190
500
420
1000
820
2000
OrderQuantity
2
2
5
2
4
4
2
CustomerName
Smith
Johnson
Baldwin
Smith
Wood
Smith
Baldwin
Solve following queries using Aggregate Function for above table:
1. Count how many orders have made a customer with CustomerName of Smith.
2. Find number of unique customers that have ordered from the store.
3. Find out total no. of items ordered by all the customers.
4. Find out average number of items per order.
5. Find out the average OrderQuantity for all orders with OrderPrice greater than 200
6. Find out what was the minimum price paid for any of the orders.
7. Find out the highest OrderPrice from the given sales table
8. List out unique customers‟ name only from the table.
9. List out name of the customers who have given order in the month of DECEMBER
10. Find out the total amount of money spent for each of the customers.
11. Select all unique customers, who have spent more than 1200 in the store.
12. Select all customers that have ordered more than 5 items in total from all their orders.
13. Select all customers who have spent more than 1000, after 10/01/2005.
14. Select orders in increasing order of order price.
15. Select orders in decreasing order of order price.
PRACTICAL LAB ASSIGNMENT (SQL): 3 (Required Lab
Hours : 6)
Table: sales
OrderID
1
2
3
4
5
6
7
8
9
OrderDate
12/22/2005
08/10/2005
07/13/2005
07/15/2005
12/22/2005
10/2/2005
11/03/2005
12/22/2002
12/29/2004
OrderPrice
160
190
500
420
1000
820
2000
1000
5000
OrderQuantity
2
2
5
2
4
4
2
4
4
CustomerName
Smith
Johnson
Baldwin
Smith
Wood
Smith
Baldwin
Wood
Smith
Table: products
Product_id OrderId Manufacture_Date Raw_Material Vender_id
AZ145 2 12/23/2005 Steel 1
CS784 4 11/28/2005 Plastic 2
AZ147 6 08/15/2002 Steel 3
FD344 3 11/03/2005 Milk 1
GR233 3 11/30/2005 Pulses 2
FD123 2 10/03/2005 Milk 2
CS783 1 11/03/2004 Plastic 2
CS435 5 11/04/2001 Steel 1
GR567 6 09/03/2005 Pulses 2
FD267 5 21/03/2002 Bread 4
FD333 9 12/12/2001 Milk 1
Table: vender_info
Vender_id Vender_name
1 Smith
2 Wills
3 Johnson
4 Roger
Table: venders
Raw_Material Venders Vender_id
Steel Smith 1
Plastic Wills 2
Steel Johnson 3
Milk Smith 1
Pulses Wills 2
Bread Roger 4
Bread Wills 2
Milk Wills 2
1. Display product information which are ordered in the same year of its manufacturing year.
2. Display product information which are ordered in the same year of its manufacturing year where vender
is „smith‟.
3. Display total no. of orders placed in each year.
4. Display total no. of orders placed in each year by vender Wills.
5. Display the name of all those persons who are venders and customers both.
6. Display total no. of food items ordered every year.
7. Display total no. of food items ordered every year made from Bread.
8. Display list of product_id whose vender and customer is different.
9. Display all those customers who are ordering products of milk by smith.
10. Display total no. of orders by each vender every year.
11. Display name of those venders whose products are sold more than 2000 Rs. Every year.
PRACTICAL LAB ASSIGNMENT (PL/SQL Exercise): 4 (Required Lab
Hours : 6)
1. Write a simple PL/SQL script that displays “Hello World”.
2. Write a PL/SQL stored procedure to display “Hello World”.
3. Write a PL/SQL script that performs simple arithmetic like Addition, Subtraction, Multiplication &
Division of input numbers.
4. Create two tables as shown below:
Table 1 : product (product_id, product_name, supplier_name, unit_price)
Table 2: product_price_history(product_id, product_name, supplier_name, unit_price)
Insert appropriate data into Table 1 i.e. the „product‟ table.
Now write a PL/SQL trigger that automatically copies a row from product table to
product_price_history table whenever the unit price of a product is changed in the product table. Note:
„product‟ table contains new updated value of unit price while „product_price_history‟ table contains
the old value.
5. Write a PL-SQL script to compare three given numbers and display them in ascending order.
6. Create the following table:
Emp(E_ID, E_Name, E_Dept, E_Salary)
Insert appropriate data into Emp table.
The attribute E_Dept contains values like ( I.T. , Accounts, Sales)..
Write a PL-SQL cursor that increments the salary of employees of I.T. Dept. by 20%.

More Related Content

PDF
Complete dbms notes
DOC
Dbms lab Manual
PDF
18CSL58 DBMS LAB Manual.pdf
PPT
Codd's rules
DOCX
Advanced Database Management Systems Project Report
PDF
Data Mining & Data Warehousing Lecture Notes
PPTX
Decomposition using Functional Dependency
PPTX
Crash recovery in database
Complete dbms notes
Dbms lab Manual
18CSL58 DBMS LAB Manual.pdf
Codd's rules
Advanced Database Management Systems Project Report
Data Mining & Data Warehousing Lecture Notes
Decomposition using Functional Dependency
Crash recovery in database

What's hot (20)

PDF
Normalization in DBMS
PPTX
PPTX
Computer Organization and Architecture.pptx
PPTX
Functioning of computer
PDF
Deterministic Finite Automata (DFA)
PPTX
database language ppt.pptx
PPTX
1.1. the central concepts of automata theory
PPTX
joins in database
PDF
8086 microprocessor lab manual
PPTX
Stream classes in C++
PPTX
Solutions to byzantine agreement problem
PPTX
Floating point representation
PPTX
Formatted Console I/O Operations in C++
DOC
Dbms lab questions
PPTX
Normalization in DBMS
PPTX
memory reference instruction
PPTX
Control unit
DOCX
Control Units : Microprogrammed and Hardwired:control unit
PPT
Computer Organization and Architecture.
PPT
Introduction to data structures and Algorithm
Normalization in DBMS
Computer Organization and Architecture.pptx
Functioning of computer
Deterministic Finite Automata (DFA)
database language ppt.pptx
1.1. the central concepts of automata theory
joins in database
8086 microprocessor lab manual
Stream classes in C++
Solutions to byzantine agreement problem
Floating point representation
Formatted Console I/O Operations in C++
Dbms lab questions
Normalization in DBMS
memory reference instruction
Control unit
Control Units : Microprogrammed and Hardwired:control unit
Computer Organization and Architecture.
Introduction to data structures and Algorithm
Ad

Similar to Dbms practical list (20)

PDF
SQL Database Design & Querying
PDF
Sql wksht-5
DOCX
PROG3040 Assignment 1 – Fall 2013 Glenn Paulley – 2A605, x25.docx
PDF
FOUNDATION OF DATA SCIENCE SQL QUESTIONS
DOC
Dbms assignment 2
PDF
Module 3 design and implementing tables
DOCX
CIS/336 ilab 5 of 7
DOCX
Dbms record
PDF
Sql wksht-1
DOCX
Cis 336 cis336 week 5 i lab 5 devry university
DOCX
SQL-RDBMS Queries and Question Bank
PDF
DBMS Lab
DOC
SQL practice questions set - 2
PDF
SQL Practice Question set
PDF
DBMS PRACTICAL ASSIGNMENTS WITH ANSWERS.pdf
DOC
Cis336 week 5 i lab 5
DOC
Cis336 week 5 i lab 5
DOC
Cis336 week 5 i lab 5
DOC
Cis336 week 5 i lab 5
DOC
Sql All Tuts 2009
SQL Database Design & Querying
Sql wksht-5
PROG3040 Assignment 1 – Fall 2013 Glenn Paulley – 2A605, x25.docx
FOUNDATION OF DATA SCIENCE SQL QUESTIONS
Dbms assignment 2
Module 3 design and implementing tables
CIS/336 ilab 5 of 7
Dbms record
Sql wksht-1
Cis 336 cis336 week 5 i lab 5 devry university
SQL-RDBMS Queries and Question Bank
DBMS Lab
SQL practice questions set - 2
SQL Practice Question set
DBMS PRACTICAL ASSIGNMENTS WITH ANSWERS.pdf
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5
Sql All Tuts 2009
Ad

More from RajSingh734307 (8)

DOCX
Series direction blood relation
PDF
Nitesh singh internshalaresume
DOCX
Wc crypto and puzzles
DOCX
DOCX
DOCX
Mettl prg
PDF
Iare ds lecture_notes_2
Series direction blood relation
Nitesh singh internshalaresume
Wc crypto and puzzles
Mettl prg
Iare ds lecture_notes_2

Recently uploaded (20)

PDF
Understanding Forklifts - TECH EHS Solution
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administration Chapter 2
PPTX
Transform Your Business with a Software ERP System
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
L1 - Introduction to python Backend.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
history of c programming in notes for students .pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Understanding Forklifts - TECH EHS Solution
PTS Company Brochure 2025 (1).pdf.......
Odoo Companies in India – Driving Business Transformation.pdf
CHAPTER 2 - PM Management and IT Context
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administration Chapter 2
Transform Your Business with a Software ERP System
Which alternative to Crystal Reports is best for small or large businesses.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
2025 Textile ERP Trends: SAP, Odoo & Oracle
L1 - Introduction to python Backend.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
history of c programming in notes for students .pptx
Wondershare Filmora 15 Crack With Activation Key [2025
How Creative Agencies Leverage Project Management Software.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises

Dbms practical list

  • 1. PRACTICAL LAB ASSIGNMENT: 1 (Required Lab Hours : 4) A. Create a relational database that contains the following tables and insert the following data into these tables. STUD_MEMBER Roll_No FName MName SName Dept_ID Semester Contact_No Gender 1 Ankur Samir Kahar 1 1 272121 M 2 Dhaval Dhiren Joshi 1 1 232122 M 3 Ankita Biren Shah 1 1 112121 F 10 Komal Maheshkumar Pandya 2 3 123123 F 13 Amit Jitenkumar Mehta 3 3 453667 M 23 Jinal Ashish Gandhi 2 1 323232 M 22 Ganesh Asha Patel 2 3 124244 M 4 Shweta Mihir Patel 3 1 646342 F 7 Pooja Mayank Desai 3 3 328656 F 8 Komal Krishnaraj Bhatia 2 3 257422 F 43 Kiran Viraj Shah 1 1 754124 F DEPARTMENT Dept_ID Dept_Name 1 Information Technology 2 Electrical 3 Civil 4 Mechanical 5 Chemical B. Now, solve the following SQL Queries. 1. Display the names and contact numbers of all student members. 2. Give the names and roll numbers of all students of Information Technology who are members. 3. Display names of Departments whose students are members. 4. Display names of Departments for which no students are members. 5. Display names of all Departments. 6. Find the number of students of Electrical Department who are members. 7. Display information of student members whose name begins with the letter “A”. 8. Display all details of Male members only. 9. Display data of student members who are currently in semester „3‟. 10. Display data of student female members in alphabetical order.
  • 2. PRACTICAL LAB ASSIGNMENT (SQL): 2 (Required Lab Hours : 4) Table: sales OrderID 1 2 3 4 5 6 7 OrderDate 12/22/2005 08/10/2005 07/13/2005 07/15/2005 12/22/2005 10/2/2005 11/03/2005 OrderPrice 160 190 500 420 1000 820 2000 OrderQuantity 2 2 5 2 4 4 2 CustomerName Smith Johnson Baldwin Smith Wood Smith Baldwin Solve following queries using Aggregate Function for above table: 1. Count how many orders have made a customer with CustomerName of Smith. 2. Find number of unique customers that have ordered from the store. 3. Find out total no. of items ordered by all the customers. 4. Find out average number of items per order. 5. Find out the average OrderQuantity for all orders with OrderPrice greater than 200 6. Find out what was the minimum price paid for any of the orders. 7. Find out the highest OrderPrice from the given sales table 8. List out unique customers‟ name only from the table. 9. List out name of the customers who have given order in the month of DECEMBER 10. Find out the total amount of money spent for each of the customers. 11. Select all unique customers, who have spent more than 1200 in the store. 12. Select all customers that have ordered more than 5 items in total from all their orders. 13. Select all customers who have spent more than 1000, after 10/01/2005. 14. Select orders in increasing order of order price. 15. Select orders in decreasing order of order price.
  • 3. PRACTICAL LAB ASSIGNMENT (SQL): 3 (Required Lab Hours : 6) Table: sales OrderID 1 2 3 4 5 6 7 8 9 OrderDate 12/22/2005 08/10/2005 07/13/2005 07/15/2005 12/22/2005 10/2/2005 11/03/2005 12/22/2002 12/29/2004 OrderPrice 160 190 500 420 1000 820 2000 1000 5000 OrderQuantity 2 2 5 2 4 4 2 4 4 CustomerName Smith Johnson Baldwin Smith Wood Smith Baldwin Wood Smith Table: products Product_id OrderId Manufacture_Date Raw_Material Vender_id AZ145 2 12/23/2005 Steel 1 CS784 4 11/28/2005 Plastic 2 AZ147 6 08/15/2002 Steel 3 FD344 3 11/03/2005 Milk 1 GR233 3 11/30/2005 Pulses 2 FD123 2 10/03/2005 Milk 2 CS783 1 11/03/2004 Plastic 2 CS435 5 11/04/2001 Steel 1 GR567 6 09/03/2005 Pulses 2 FD267 5 21/03/2002 Bread 4 FD333 9 12/12/2001 Milk 1 Table: vender_info Vender_id Vender_name 1 Smith 2 Wills 3 Johnson 4 Roger
  • 4. Table: venders Raw_Material Venders Vender_id Steel Smith 1 Plastic Wills 2 Steel Johnson 3 Milk Smith 1 Pulses Wills 2 Bread Roger 4 Bread Wills 2 Milk Wills 2 1. Display product information which are ordered in the same year of its manufacturing year. 2. Display product information which are ordered in the same year of its manufacturing year where vender is „smith‟. 3. Display total no. of orders placed in each year. 4. Display total no. of orders placed in each year by vender Wills. 5. Display the name of all those persons who are venders and customers both. 6. Display total no. of food items ordered every year. 7. Display total no. of food items ordered every year made from Bread. 8. Display list of product_id whose vender and customer is different. 9. Display all those customers who are ordering products of milk by smith. 10. Display total no. of orders by each vender every year. 11. Display name of those venders whose products are sold more than 2000 Rs. Every year.
  • 5. PRACTICAL LAB ASSIGNMENT (PL/SQL Exercise): 4 (Required Lab Hours : 6) 1. Write a simple PL/SQL script that displays “Hello World”. 2. Write a PL/SQL stored procedure to display “Hello World”. 3. Write a PL/SQL script that performs simple arithmetic like Addition, Subtraction, Multiplication & Division of input numbers. 4. Create two tables as shown below: Table 1 : product (product_id, product_name, supplier_name, unit_price) Table 2: product_price_history(product_id, product_name, supplier_name, unit_price) Insert appropriate data into Table 1 i.e. the „product‟ table. Now write a PL/SQL trigger that automatically copies a row from product table to product_price_history table whenever the unit price of a product is changed in the product table. Note: „product‟ table contains new updated value of unit price while „product_price_history‟ table contains the old value. 5. Write a PL-SQL script to compare three given numbers and display them in ascending order. 6. Create the following table: Emp(E_ID, E_Name, E_Dept, E_Salary) Insert appropriate data into Emp table. The attribute E_Dept contains values like ( I.T. , Accounts, Sales).. Write a PL-SQL cursor that increments the salary of employees of I.T. Dept. by 20%.