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

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter13: Views
Section: Chapter Questions
Problem 4MC
icon
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)
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.
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
steps

Step by step

Solved in 6 steps with 7 images

Blurred answer
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
Bartleby Expert
SEE 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
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
Bartleby Expert
SEE 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
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
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Table
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
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Database Systems: Design, Implementation, & Manag…
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…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning