SlideShare a Scribd company logo
1 of 29
Download to read offline
NORTHERN ILLINOIS
UNIVERSITY
OMIS 652
Business Applications of Database Management System
3rd
Deliverable - Database Diagram & Queries
Submitted by,
Akarsh Vinod Ghanathay (Z1804713)
Nikhilesh Methuku (Z1807570)
Shaik Nisar Ahmed (Z1780816)
Syed Mahmood Hasan (Z1774742)
The Database Diagram
Intern Table
Catalog table
Customer table
Employee table
Inventory requirement order table
Inventory details table
Logistic partner table
Order table
Payment table
Product table
Raw material table
Shipping table
Supplier table
Workshop table
1. Write a query to find the employeeid and customerid whose name matches with customer’sfirst
name?
select e.empid,c.cusid,e.name
from final_employee e join final_order o
on e.orderID = o.orderID join final_customer c
on o.cusID = c.cusID and e.name=c.fname
2. Write a query to display customer id, first name and last name of all the customers who were involved
in more than one purchase.
select cusID, fname, lname
from final_customer
where cusID in
(select cusID
from final_order
group by cusID
having count (cusID)>1)
3. Write a query to display the total sum of sales for each product type
select p.productType, sum(o.price)
from final_product p join final_order o
on p.productID = o.productID
group by p.productType
4. Write a query to find the list of customers with their id, firstname, lastname who have purchased shoes
that are made of ‘leather’.
select cusID, fname, lname
from final_customer
where cusID in
(select cusID
from final_order
where orderID in (
select orderID
from final_product
where material like 'leather'))
5. Write a query to display name of the logistic partner who delivered the synthetic products.
select name
from final_logistics
where logisticID in (
select logisticID
from final_shipping
where orderID in (
select orderID
from final_order
where productID in (
select productID
from final_product
where material='synthetic')))
6. Display the name of employees who were involved in manufacturing orders in workshop type
‘backpack’.
Select name
From final_employee
Where empID in (
Select empID
From final_workshop
Where workshoptype = 'backpack')
7. List the name of the material which is supplied from California.
select name
from final_rawmaterial
where materialID in (
select materialID
from final_intventoryrequireorder
where requirementorderID in (
select requirementorderID
from final_supplier
where location = 'california'))
8. List the highest quote for leather.
select s.requirementorderID, MAX(quote)
from final_supplier s join final_intventoryrequireorder i on s.requirementorderID=i.requirementorderID
join final_rawmaterial f on i.materialID = f.materialID
and f.name = 'leather'
group by s.requirementorderID
9. Find the name of the raw material which was procured by the supplier id ‘401’.
select name
from final_rawmaterial
where materialID in (
select materialID
from final_intventoryrequireorder
where requirementorderID in (
select requirementorderID
from final_supplier
where supplierID = 401))
10. Find the status of the order by the employee name ‘Show’.
select status
from final_shipping
where orderID in
(select orderID
from final_employee
where orderID in
(select orderID
from final_employee
where name = 'show'))
11. Write a query to display the logistic partner who delivered the digital leather watch.
select name
from final_logistics
where logisticID in (
select logisticID
from final_shipping
where orderID in (
select orderID
from final_order
where productID in (
select productID
from final_product
where material='leather' and [desc]='digital')))
12. Write a query to display the employee who processed the orders that were delivered by DHL.
select empID, e.name, l.name
from final_employee e, final_order o, final_shipping s, final_logistics l
where e.orderID = o.orderID and o.orderID = s.orderID and s.logisticID = l.logisticID and l.name = 'DHL'
13. Display the list of intern that worked on watches
select i.name
from final_intern i, final_workshop w, final_employee e, final_order o, final_product p
where i.orderID = w.orderID and w.orderID = e.orderID and e.orderID = o.orderID and o.productID =
p.productID and productType = 'watch'
14. List the Number of transactions with watches.
select productType, count(transactionID) as NumberofTransactions
from final_payment p, final_order o, final_product pr
where p.orderID = o.orderID and o.productID = pr.productID and productType = 'watch'
group by productType
15. List the Number of orders delivered by DHL.
select i.name as interName, e.name employeeName, e.empID
from final_intern i, final_employee e, final_workshop w
where i.workshopID = w.workshopID and e.empID = w.empID and i.name = e.name
16. List the name of the inventory where synthetic materials are stored.
select name
from final_inventory_details
where inventoryID in (
select inventoryID
from final_rawmaterial
where name = 'synthetic')
17. List the name of the products whose inventory was are stored in north.
select name, [desc],productID
from final_product
where materialID in (
select materialID
from final_rawmaterial
where inventoryID in (
select inventoryID
from final_inventory_details
where name = 'north'))
18. List the name of the supplierID who supplies leather.
select supplierid
from final_supplier
where requirementorderID in (
select requirementorderID
from final_intventoryrequireorder
where materialID in (
select materialID
from final_rawmaterial
where name = 'leather'))
19. Write a query to display the customer id who bought leather bags.
select cusid
from final_customer
where cusID in (
select cusID
from final_order
where productID in (
select productID
from final_product
where productType = 'bag' and material = 'leather'))
20. Display the transaction id that dealt with customer first name sam.
select transactionid
from final_payment
where cusID in (
select cusID
from final_customer
where fname = 'sam')

More Related Content

Viewers also liked

Living and Working in Australia
Living and Working in AustraliaLiving and Working in Australia
Living and Working in AustraliaMorgan McKinley
 
Project Manager [PMP] Reference Projects
Project Manager [PMP] Reference Projects Project Manager [PMP] Reference Projects
Project Manager [PMP] Reference Projects Maged Habashy
 
Usabilidad en redes sociales para empresas
Usabilidad en redes sociales para empresasUsabilidad en redes sociales para empresas
Usabilidad en redes sociales para empresasFreelance
 
Ntic integracion curricular sesion 3
Ntic integracion curricular sesion 3Ntic integracion curricular sesion 3
Ntic integracion curricular sesion 3jpajenny
 
Morgan McKinley’s 2011 Salary Guide
Morgan McKinley’s 2011 Salary GuideMorgan McKinley’s 2011 Salary Guide
Morgan McKinley’s 2011 Salary GuideMorgan McKinley
 

Viewers also liked (8)

Salidapedagogica
SalidapedagogicaSalidapedagogica
Salidapedagogica
 
Living and Working in Australia
Living and Working in AustraliaLiving and Working in Australia
Living and Working in Australia
 
Project Manager [PMP] Reference Projects
Project Manager [PMP] Reference Projects Project Manager [PMP] Reference Projects
Project Manager [PMP] Reference Projects
 
Usabilidad en redes sociales para empresas
Usabilidad en redes sociales para empresasUsabilidad en redes sociales para empresas
Usabilidad en redes sociales para empresas
 
Ntic integracion curricular sesion 3
Ntic integracion curricular sesion 3Ntic integracion curricular sesion 3
Ntic integracion curricular sesion 3
 
5. unidad n°2 movimiento curvilineo parte ii
5. unidad n°2 movimiento curvilineo parte ii5. unidad n°2 movimiento curvilineo parte ii
5. unidad n°2 movimiento curvilineo parte ii
 
Morgan McKinley’s 2011 Salary Guide
Morgan McKinley’s 2011 Salary GuideMorgan McKinley’s 2011 Salary Guide
Morgan McKinley’s 2011 Salary Guide
 
Politics in the STEM Classroom
Politics in the STEM ClassroomPolitics in the STEM Classroom
Politics in the STEM Classroom
 

Similar to OMIS-652 Database Development Project

ConFoo 2024 - Need for Speed: Removing speed bumps in API Projects
ConFoo 2024  - Need for Speed: Removing speed bumps in API ProjectsConFoo 2024  - Need for Speed: Removing speed bumps in API Projects
ConFoo 2024 - Need for Speed: Removing speed bumps in API ProjectsŁukasz Chruściel
 
Store management along with output
Store management along with outputStore management along with output
Store management along with outputAnavadya Shibu
 
SECTION D2)Display the item number and total cost for each order l.docx
SECTION D2)Display the item number and total cost for each order l.docxSECTION D2)Display the item number and total cost for each order l.docx
SECTION D2)Display the item number and total cost for each order l.docxkenjordan97598
 
ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENTLori Moore
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Tablesapdocs. info
 
03 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp0203 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp02tabish
 
03 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp0103 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp01wingsrai
 
Do something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appDo something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appBruce McPherson
 
You are to write a program that computes customers bill for hisher.docx
 You are to write a program that computes customers bill for hisher.docx You are to write a program that computes customers bill for hisher.docx
You are to write a program that computes customers bill for hisher.docxajoy21
 
CodingSerbia2014-JavaVSPig
CodingSerbia2014-JavaVSPigCodingSerbia2014-JavaVSPig
CodingSerbia2014-JavaVSPigDusan Zamurovic
 
UG_Receiving-OF_ESAB
UG_Receiving-OF_ESABUG_Receiving-OF_ESAB
UG_Receiving-OF_ESABDeb Martina
 

Similar to OMIS-652 Database Development Project (13)

ConFoo 2024 - Need for Speed: Removing speed bumps in API Projects
ConFoo 2024  - Need for Speed: Removing speed bumps in API ProjectsConFoo 2024  - Need for Speed: Removing speed bumps in API Projects
ConFoo 2024 - Need for Speed: Removing speed bumps in API Projects
 
Store management along with output
Store management along with outputStore management along with output
Store management along with output
 
SECTION D2)Display the item number and total cost for each order l.docx
SECTION D2)Display the item number and total cost for each order l.docxSECTION D2)Display the item number and total cost for each order l.docx
SECTION D2)Display the item number and total cost for each order l.docx
 
ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENT
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
 
03 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp0203 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp02
 
03 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp0103 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp01
 
Do something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing appDo something in 5 with gas 3-simple invoicing app
Do something in 5 with gas 3-simple invoicing app
 
You are to write a program that computes customers bill for hisher.docx
 You are to write a program that computes customers bill for hisher.docx You are to write a program that computes customers bill for hisher.docx
You are to write a program that computes customers bill for hisher.docx
 
CodingSerbia2014-JavaVSPig
CodingSerbia2014-JavaVSPigCodingSerbia2014-JavaVSPig
CodingSerbia2014-JavaVSPig
 
UG_Receiving-OF_ESAB
UG_Receiving-OF_ESABUG_Receiving-OF_ESAB
UG_Receiving-OF_ESAB
 
RESTful services Design Lab
RESTful services Design LabRESTful services Design Lab
RESTful services Design Lab
 
Data mining
Data miningData mining
Data mining
 

Recently uploaded

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 

OMIS-652 Database Development Project

  • 1. NORTHERN ILLINOIS UNIVERSITY OMIS 652 Business Applications of Database Management System 3rd Deliverable - Database Diagram & Queries Submitted by, Akarsh Vinod Ghanathay (Z1804713) Nikhilesh Methuku (Z1807570) Shaik Nisar Ahmed (Z1780816) Syed Mahmood Hasan (Z1774742)
  • 5. Inventory requirement order table Inventory details table
  • 10. 1. Write a query to find the employeeid and customerid whose name matches with customer’sfirst name? select e.empid,c.cusid,e.name from final_employee e join final_order o on e.orderID = o.orderID join final_customer c on o.cusID = c.cusID and e.name=c.fname
  • 11. 2. Write a query to display customer id, first name and last name of all the customers who were involved in more than one purchase. select cusID, fname, lname from final_customer where cusID in (select cusID from final_order group by cusID having count (cusID)>1)
  • 12. 3. Write a query to display the total sum of sales for each product type select p.productType, sum(o.price) from final_product p join final_order o on p.productID = o.productID group by p.productType
  • 13. 4. Write a query to find the list of customers with their id, firstname, lastname who have purchased shoes that are made of ‘leather’. select cusID, fname, lname from final_customer where cusID in (select cusID from final_order where orderID in ( select orderID from final_product where material like 'leather'))
  • 14. 5. Write a query to display name of the logistic partner who delivered the synthetic products. select name from final_logistics where logisticID in ( select logisticID from final_shipping where orderID in ( select orderID from final_order where productID in ( select productID from final_product where material='synthetic')))
  • 15. 6. Display the name of employees who were involved in manufacturing orders in workshop type ‘backpack’. Select name From final_employee Where empID in ( Select empID From final_workshop Where workshoptype = 'backpack')
  • 16. 7. List the name of the material which is supplied from California. select name from final_rawmaterial where materialID in ( select materialID from final_intventoryrequireorder where requirementorderID in ( select requirementorderID from final_supplier where location = 'california'))
  • 17. 8. List the highest quote for leather. select s.requirementorderID, MAX(quote) from final_supplier s join final_intventoryrequireorder i on s.requirementorderID=i.requirementorderID join final_rawmaterial f on i.materialID = f.materialID and f.name = 'leather' group by s.requirementorderID
  • 18. 9. Find the name of the raw material which was procured by the supplier id ‘401’. select name from final_rawmaterial where materialID in ( select materialID from final_intventoryrequireorder where requirementorderID in ( select requirementorderID from final_supplier where supplierID = 401))
  • 19. 10. Find the status of the order by the employee name ‘Show’. select status from final_shipping where orderID in (select orderID from final_employee where orderID in (select orderID from final_employee where name = 'show'))
  • 20. 11. Write a query to display the logistic partner who delivered the digital leather watch. select name from final_logistics where logisticID in ( select logisticID from final_shipping where orderID in ( select orderID from final_order where productID in ( select productID from final_product where material='leather' and [desc]='digital')))
  • 21. 12. Write a query to display the employee who processed the orders that were delivered by DHL. select empID, e.name, l.name from final_employee e, final_order o, final_shipping s, final_logistics l where e.orderID = o.orderID and o.orderID = s.orderID and s.logisticID = l.logisticID and l.name = 'DHL'
  • 22. 13. Display the list of intern that worked on watches select i.name from final_intern i, final_workshop w, final_employee e, final_order o, final_product p where i.orderID = w.orderID and w.orderID = e.orderID and e.orderID = o.orderID and o.productID = p.productID and productType = 'watch'
  • 23. 14. List the Number of transactions with watches. select productType, count(transactionID) as NumberofTransactions from final_payment p, final_order o, final_product pr where p.orderID = o.orderID and o.productID = pr.productID and productType = 'watch' group by productType
  • 24. 15. List the Number of orders delivered by DHL. select i.name as interName, e.name employeeName, e.empID from final_intern i, final_employee e, final_workshop w where i.workshopID = w.workshopID and e.empID = w.empID and i.name = e.name
  • 25. 16. List the name of the inventory where synthetic materials are stored. select name from final_inventory_details where inventoryID in ( select inventoryID from final_rawmaterial where name = 'synthetic')
  • 26. 17. List the name of the products whose inventory was are stored in north. select name, [desc],productID from final_product where materialID in ( select materialID from final_rawmaterial where inventoryID in ( select inventoryID from final_inventory_details where name = 'north'))
  • 27. 18. List the name of the supplierID who supplies leather. select supplierid from final_supplier where requirementorderID in ( select requirementorderID from final_intventoryrequireorder where materialID in ( select materialID from final_rawmaterial where name = 'leather'))
  • 28. 19. Write a query to display the customer id who bought leather bags. select cusid from final_customer where cusID in ( select cusID from final_order where productID in ( select productID from final_product where productType = 'bag' and material = 'leather'))
  • 29. 20. Display the transaction id that dealt with customer first name sam. select transactionid from final_payment where cusID in ( select cusID from final_customer where fname = 'sam')