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
Research, Types and objectives of research
PDF
Sql queries questions and answers
PDF
Dbms 10: Conversion of ER model to Relational Model
PPT
Fundamentals of Database ppt ch01
PDF
Html / CSS Presentation
PPTX
Classification of Apple diseases through machine learning
PPTX
Chapter 1 microprocessor introduction
PDF
Primary & Secondary Data
Research, Types and objectives of research
Sql queries questions and answers
Dbms 10: Conversion of ER model to Relational Model
Fundamentals of Database ppt ch01
Html / CSS Presentation
Classification of Apple diseases through machine learning
Chapter 1 microprocessor introduction
Primary & Secondary Data

What's hot (20)

PPTX
introdution to SQL and SQL functions
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Sql commands
PPTX
SQL(DDL & DML)
PPTX
The Relational Database Model
PPT
Sql ppt
PPTX
Sql queries presentation
PPT
Introduction to structured query language (sql)
PDF
Sql tutorial
PPT
Introduction to-sql
ODP
PPTX
University er-diagram
PPT
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
PDF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
PPTX
Presentation slides of Sequence Query Language (SQL)
DOC
SQL practice questions set - 2
PPTX
SQL Queries Information
PDF
SQL Overview
PPTX
Normal forms
PDF
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
introdution to SQL and SQL functions
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Sql commands
SQL(DDL & DML)
The Relational Database Model
Sql ppt
Sql queries presentation
Introduction to structured query language (sql)
Sql tutorial
Introduction to-sql
University er-diagram
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Presentation slides of Sequence Query Language (SQL)
SQL practice questions set - 2
SQL Queries Information
SQL Overview
Normal forms
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Ad

Similar to Dbms practical list (20)

DOCX
HOLMES INSTITUTE FACULTY OF HIGHER EDUCATION.docx
DOC
Cis336 week 7 i lab 7
DOCX
Page 1 of 13 HS2021 Database Design and Use Individ.docx
PDF
FP304 DATABASE SYSTEM FINAL PAPER
DOCX
Book HH - SQL MATERIAL
DOCX
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
DOC
Dbms assignment 2
DOCX
ECET 450 Laboratory 2Part BPurposeThis laborato.docx
PPTX
SQL NAD DB.pptx
PPT
Higher isdd revision presentation
DOCX
PDF
Public Training SQL Implementation & Embedded Programming in IBM i
PDF
Public Training SQL Implementation & Embedded Programming in IBM i (05-09 Jun...
PDF
Avoiding cursors with sql server 2005 tech republic
PDF
Bsop 330 all weeks discussion questions
PDF
Database Management Systems Lab manual (KR20) CSE.pdf
PDF
Sample Paper Class XI (Informatics Practices)
PDF
PL/SQL New and Advanced Features for Extreme Performance
PDF
Problem based DBMS lab report || Fahim Tahmid Rupak || Daffodil International...
PDF
What’s New in MariaDB TX 3.0
HOLMES INSTITUTE FACULTY OF HIGHER EDUCATION.docx
Cis336 week 7 i lab 7
Page 1 of 13 HS2021 Database Design and Use Individ.docx
FP304 DATABASE SYSTEM FINAL PAPER
Book HH - SQL MATERIAL
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
Dbms assignment 2
ECET 450 Laboratory 2Part BPurposeThis laborato.docx
SQL NAD DB.pptx
Higher isdd revision presentation
Public Training SQL Implementation & Embedded Programming in IBM i
Public Training SQL Implementation & Embedded Programming in IBM i (05-09 Jun...
Avoiding cursors with sql server 2005 tech republic
Bsop 330 all weeks discussion questions
Database Management Systems Lab manual (KR20) CSE.pdf
Sample Paper Class XI (Informatics Practices)
PL/SQL New and Advanced Features for Extreme Performance
Problem based DBMS lab report || Fahim Tahmid Rupak || Daffodil International...
What’s New in MariaDB TX 3.0
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)

DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
Transform Your Business with a Software ERP System
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
medical staffing services at VALiNTRY
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Design an Analysis of Algorithms I-SECS-1021-03
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Navsoft: AI-Powered Business Solutions & Custom Software Development
Patient Appointment Booking in Odoo with online payment
Why Generative AI is the Future of Content, Code & Creativity?
Transform Your Business with a Software ERP System
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Choose the Right IT Partner for Your Business in Malaysia
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Advanced SystemCare Ultimate Crack + Portable (2025)
Monitoring Stack: Grafana, Loki & Promtail
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Design an Analysis of Algorithms II-SECS-1021-03
CHAPTER 2 - PM Management and IT Context
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Autodesk AutoCAD Crack Free Download 2025
Salesforce Agentforce AI Implementation.pdf
medical staffing services at VALiNTRY
17 Powerful Integrations Your Next-Gen MLM Software Needs
Design an Analysis of Algorithms I-SECS-1021-03

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