C. Refunds_697 REFUNDID ORDERID REFUNDDATE REFUNDAMOUNT 1 1 02-SEP-16 5 2 18-SEP-16 18 Refunds RefundID Customers Orders |CustomerID FirstName LastName OrderlD OrderID CustomerID OrderDate OrderAmount RefundDate RefundAmount
C. Refunds_697 REFUNDID ORDERID REFUNDDATE REFUNDAMOUNT 1 1 02-SEP-16 5 2 18-SEP-16 18 Refunds RefundID Customers Orders |CustomerID FirstName LastName OrderlD OrderID CustomerID OrderDate OrderAmount RefundDate RefundAmount
Chapter8: Sql Functions And Procedures
Section: Chapter Questions
Problem 9TD
Related questions
Question
![Note : OrderDate is a Date Type
с.
Refunds_697
REFUNDID
ORDERID
REFUNDDATE
REFUNDAMOUNT
1
1
02-SEP-16
5
2
3
18-SEP-16
18
Customers
CustomerID
FirstName
LastName
Orders
OrderID
CustomerID
OrderDate
OrderAmount
Refunds
RefundID
OrderID
RefundDate
RefundAmount
Now Perform the following JOIN Operations
1. Find the Details of the Customers and their orders (only the Customers with orders)
CUSTOMERID FIRSTNAME LASTNAME
ORDERID
CUSTOMERID
ORDERDATE ORDERAMOUNT
Sara
Davis
1
1
01-SEP-16
10
2
Rumi
Shah
2
2
02-SEP-16
12.5
2
Rumi
Shah
3
е3-SEP-16
18
3
Paul
Johnson
4
3
15-SEP-16
20
4
Samuel
Martinez
5
4
21-NOV-20
20
Why Customer 2 appear twice ?
Why Customer 5 not appear in the output ?
2. Find the details of the customers with orders and refunds (join all 3 tables)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff1f39aa5-4e0b-40b7-807a-db76580272f9%2F722177de-6ec2-479e-a75f-50a07ee31f4c%2Fy4pm7at_processed.png&w=3840&q=75)
Transcribed Image Text:Note : OrderDate is a Date Type
с.
Refunds_697
REFUNDID
ORDERID
REFUNDDATE
REFUNDAMOUNT
1
1
02-SEP-16
5
2
3
18-SEP-16
18
Customers
CustomerID
FirstName
LastName
Orders
OrderID
CustomerID
OrderDate
OrderAmount
Refunds
RefundID
OrderID
RefundDate
RefundAmount
Now Perform the following JOIN Operations
1. Find the Details of the Customers and their orders (only the Customers with orders)
CUSTOMERID FIRSTNAME LASTNAME
ORDERID
CUSTOMERID
ORDERDATE ORDERAMOUNT
Sara
Davis
1
1
01-SEP-16
10
2
Rumi
Shah
2
2
02-SEP-16
12.5
2
Rumi
Shah
3
е3-SEP-16
18
3
Paul
Johnson
4
3
15-SEP-16
20
4
Samuel
Martinez
5
4
21-NOV-20
20
Why Customer 2 appear twice ?
Why Customer 5 not appear in the output ?
2. Find the details of the customers with orders and refunds (join all 3 tables)
![Perform the following operations using ORACLE and provide relevant screen shots
in each case
Use appropriate syntax and datatypes
1. Create the following table(s) and enter given data values for each table using a SQL
Scripts
a. Customers_697(697 is last 3 digits of your student Number)
CUSTOMERID
FIRSTNAME
LASTNAME
1
Sara
Davis
Rumi
Shah
Paul
Johnson
Samuel
Martinez
sagara
Samarawickrama
** Customer ID 5 Enter your First Name and Last_Name
b.
Orders_697
ORDERID
CUSTOMERID
ORDERDATE ORDERAMOUNT
1
e1-SEP-16
10
e2-SEP-16
12.5
ез-SEP-16
18
4
15-SEP-16
20
21-NOV-20
20
Hint : TO_DATE('2020-11-21', 'YYYY/MM/DD') can be used to convert / insert date type
2.
2.
2.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff1f39aa5-4e0b-40b7-807a-db76580272f9%2F722177de-6ec2-479e-a75f-50a07ee31f4c%2F7f5wwfd_processed.png&w=3840&q=75)
Transcribed Image Text:Perform the following operations using ORACLE and provide relevant screen shots
in each case
Use appropriate syntax and datatypes
1. Create the following table(s) and enter given data values for each table using a SQL
Scripts
a. Customers_697(697 is last 3 digits of your student Number)
CUSTOMERID
FIRSTNAME
LASTNAME
1
Sara
Davis
Rumi
Shah
Paul
Johnson
Samuel
Martinez
sagara
Samarawickrama
** Customer ID 5 Enter your First Name and Last_Name
b.
Orders_697
ORDERID
CUSTOMERID
ORDERDATE ORDERAMOUNT
1
e1-SEP-16
10
e2-SEP-16
12.5
ез-SEP-16
18
4
15-SEP-16
20
21-NOV-20
20
Hint : TO_DATE('2020-11-21', 'YYYY/MM/DD') can be used to convert / insert date type
2.
2.
2.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 6 steps with 7 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
Why only sara and rumi appear in the output at last?
Solution
Follow-up Question
![FIRSTNAME
LASTNAME
ORDERDATE
ORDERAMOUNT
REFUNDDATE
REFUNDAMOUNT
Sara
Davis
01-SEP-16
10
02-SEP-16
5
Rumi
Shah
03-SEP-16
18
18-SEP-16
18
Explain the output
Why only Sara and Rumi apper in the output
3. Find the details of the Customers orders and refunds irrespective of whether they place
orders or having refunds
FIRSTNAME
LASTNAME
ORDERDATE
ORDERAMOUNT
REFUNDDATE
REFUNDAMOUNT
Sara
Davis
01-SEP-16
10
02-SEP-16
5
Paul
Johnson
15-SEP-16
20
Samuel
Martinez
21-NOV-20
20
Sagara
Samarawickrama
Rumi
Shah
02-SEP-16
12.5
Rumi
Shah
03-SEP-16
18
18-SEP-16
18
Explain the output
Why we see NULL values in certain columns](https://content.bartleby.com/qna-images/question/f1f39aa5-4e0b-40b7-807a-db76580272f9/29dabb03-0a32-4b0c-b4a4-61343340d922/m8ntlt7_thumbnail.png)
Transcribed Image Text:FIRSTNAME
LASTNAME
ORDERDATE
ORDERAMOUNT
REFUNDDATE
REFUNDAMOUNT
Sara
Davis
01-SEP-16
10
02-SEP-16
5
Rumi
Shah
03-SEP-16
18
18-SEP-16
18
Explain the output
Why only Sara and Rumi apper in the output
3. Find the details of the Customers orders and refunds irrespective of whether they place
orders or having refunds
FIRSTNAME
LASTNAME
ORDERDATE
ORDERAMOUNT
REFUNDDATE
REFUNDAMOUNT
Sara
Davis
01-SEP-16
10
02-SEP-16
5
Paul
Johnson
15-SEP-16
20
Samuel
Martinez
21-NOV-20
20
Sagara
Samarawickrama
Rumi
Shah
02-SEP-16
12.5
Rumi
Shah
03-SEP-16
18
18-SEP-16
18
Explain the output
Why we see NULL values in certain columns
Solution
Follow-up Question
![FIRSTNAME
LASTNAME
ORDERDATE
ORDERAMOUNT
REFUNDDATE
REFUNDAMOUNT
Sara
Davis
01-SEP-16
10
02-SEP-16
5
Rumi
Shah
03-SEP-16
18
18-SEP-16
18
Explain the output
Why only Sara and Rumi apper in the output
3. Find the details of the Customers orders and refunds irrespective of whether they place
orders or having refunds
FIRSTNAME
LASTNAME
ORDERDATE
ORDERAMOUNT
REFUNDDATE
REFUNDAMOUNT
Sara
Davis
01-SEP-16
10
02-SEP-16
5
Paul
Johnson
15-SEP-16
20
Samuel
Martinez
21-NOV-20
20
Sagara
Samarawickrama
Rumi
Shah
02-SEP-16
12.5
Rumi
Shah
03-SEP-16
18
18-SEP-16
18
Explain the output
Why we see NULL values in certain columns](https://content.bartleby.com/qna-images/question/f1f39aa5-4e0b-40b7-807a-db76580272f9/f1b45bef-062e-4202-8409-a5a4d30d8da9/v2fvsc_thumbnail.png)
Transcribed Image Text:FIRSTNAME
LASTNAME
ORDERDATE
ORDERAMOUNT
REFUNDDATE
REFUNDAMOUNT
Sara
Davis
01-SEP-16
10
02-SEP-16
5
Rumi
Shah
03-SEP-16
18
18-SEP-16
18
Explain the output
Why only Sara and Rumi apper in the output
3. Find the details of the Customers orders and refunds irrespective of whether they place
orders or having refunds
FIRSTNAME
LASTNAME
ORDERDATE
ORDERAMOUNT
REFUNDDATE
REFUNDAMOUNT
Sara
Davis
01-SEP-16
10
02-SEP-16
5
Paul
Johnson
15-SEP-16
20
Samuel
Martinez
21-NOV-20
20
Sagara
Samarawickrama
Rumi
Shah
02-SEP-16
12.5
Rumi
Shah
03-SEP-16
18
18-SEP-16
18
Explain the output
Why we see NULL values in certain columns
Solution
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![A Guide to SQL](https://www.bartleby.com/isbn_cover_images/9781111527273/9781111527273_smallCoverImage.gif)
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
![Oracle 12c: SQL](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781285196145/9781285196145_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
![A Guide to SQL](https://www.bartleby.com/isbn_cover_images/9781111527273/9781111527273_smallCoverImage.gif)
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
![Oracle 12c: SQL](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781285196145/9781285196145_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781305627482/9781305627482_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning