Write a query to display names, street, city, state, zip code of any customer who purchased a Danish Oil between 2017-9-1 and 2017-10-31. If customer purchased more than one such product only show one information per customer. Sort your output by customer state.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a query to display names, street, city, state, zip code of any customer who purchased a Danish Oil between 2017-9-1 and 2017-10-31. If customer purchased more than one such product only show one information per customer. Sort your output by customer state.

department
line
product
brand
DEPT_NUM DECIMAL(5,0)
INV_NUM DECIMAL(38,0)
* PROD_SKU VARCHAR(15)
BRAND ID DECIMAL (4,0)
DEPT NAME VARCHAR(50)
O DEPT_MAIL_BOX VARCHAR(3)
O DEPT PHONE VARCHAR(9)
* LINE_NUM DECIMAL(10,0)
PROD_DESCRIPT VARCHAR(255)
BRAND_NAME VARGCHAR(100)
O PROD_SKU VARCHAR(15) +
O PROD TYPE VARCHAR (255)
O BRAND TYPE VARCHAR(20)
O LINE_QTY DECIMAL (10,0)
PROD_BASE VARCHAR(255)
Indexes
EMP_NUM DECIMAL(6,0)
OLINE_PRICE DECIMAL(8,2)
+O PROD_CATEGORY VARCHAR(255)
Indexes
Indexes
O PROD_PRICE DECIMAL(10,2)
O PROD_QOH DECIMAL(10,0)
O PROD_MIN DECIMAL(10,0)
O BRAND ID DECIMAL (4,0)
O vendor
employee
D invoice
Indexes
VEND_ID DECIMAL(6,0)
INV_NUM DECIMAL (38,0)
INV DATE DATE
O CUST CODE DECIMAL (38,0)
EMP_NUM DECIMAL(6,0)
VEND_NAME VARCHAR(255)
EMP_FNAME VARCHAR(20)
OVEND STREET V ARCHAR(50)
%23
VEND CITY VARCHAR(50)
EMP_LNAME VARCHAR(25)
O EMP EMAIL VARCHAR(25)
EMP_PHONE VARCHAR(20) H-
O INV_TOTAL DECIMAL(11,2)
OVEND_STATE VARCHAR(2)
O EMPLOYEE_ID DECIMAL (6,0)
O VEND ZIP VARCHAR(5)
I supplies
PROD_SKU VARCHAR(15)
VEND_ID DECIMAL(6,0)
EMP HIREDATE DATE
Indexes
Indexes
O EMP TITLE VARCHAR (45)
O EMP_COMM DECIMAL (2,2)
O DEPT NUM DECIMAL(5,0)
Indexes
Indexes
customer
* CUST_CODE DECIMAL (38,0)
O CUST_FNAME VARCHAR(20)
O CUST_LNAME VARCHAR(20)
O CUST_STREET VARCHAR(70)
O CUST_CITY VARCHAR(50)
O CUST STATE CHAR(2)
O CUST_ZIP CHAR(5)
|salary_history
EMP_NUM DECIMAL(6,0)
P SAL_FROM DATE
SAL_END DATE
O SAL_AMOUNT DECIMAL(10,2)
Indexes
O CUST BALANCE DECIMAL (8,2)
Indexes
Transcribed Image Text:department line product brand DEPT_NUM DECIMAL(5,0) INV_NUM DECIMAL(38,0) * PROD_SKU VARCHAR(15) BRAND ID DECIMAL (4,0) DEPT NAME VARCHAR(50) O DEPT_MAIL_BOX VARCHAR(3) O DEPT PHONE VARCHAR(9) * LINE_NUM DECIMAL(10,0) PROD_DESCRIPT VARCHAR(255) BRAND_NAME VARGCHAR(100) O PROD_SKU VARCHAR(15) + O PROD TYPE VARCHAR (255) O BRAND TYPE VARCHAR(20) O LINE_QTY DECIMAL (10,0) PROD_BASE VARCHAR(255) Indexes EMP_NUM DECIMAL(6,0) OLINE_PRICE DECIMAL(8,2) +O PROD_CATEGORY VARCHAR(255) Indexes Indexes O PROD_PRICE DECIMAL(10,2) O PROD_QOH DECIMAL(10,0) O PROD_MIN DECIMAL(10,0) O BRAND ID DECIMAL (4,0) O vendor employee D invoice Indexes VEND_ID DECIMAL(6,0) INV_NUM DECIMAL (38,0) INV DATE DATE O CUST CODE DECIMAL (38,0) EMP_NUM DECIMAL(6,0) VEND_NAME VARCHAR(255) EMP_FNAME VARCHAR(20) OVEND STREET V ARCHAR(50) %23 VEND CITY VARCHAR(50) EMP_LNAME VARCHAR(25) O EMP EMAIL VARCHAR(25) EMP_PHONE VARCHAR(20) H- O INV_TOTAL DECIMAL(11,2) OVEND_STATE VARCHAR(2) O EMPLOYEE_ID DECIMAL (6,0) O VEND ZIP VARCHAR(5) I supplies PROD_SKU VARCHAR(15) VEND_ID DECIMAL(6,0) EMP HIREDATE DATE Indexes Indexes O EMP TITLE VARCHAR (45) O EMP_COMM DECIMAL (2,2) O DEPT NUM DECIMAL(5,0) Indexes Indexes customer * CUST_CODE DECIMAL (38,0) O CUST_FNAME VARCHAR(20) O CUST_LNAME VARCHAR(20) O CUST_STREET VARCHAR(70) O CUST_CITY VARCHAR(50) O CUST STATE CHAR(2) O CUST_ZIP CHAR(5) |salary_history EMP_NUM DECIMAL(6,0) P SAL_FROM DATE SAL_END DATE O SAL_AMOUNT DECIMAL(10,2) Indexes O CUST BALANCE DECIMAL (8,2) Indexes
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Single 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.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education