
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Use SQL commands. Include both SQL commands and results in your answers. Include screenshots of the SQL results.
KimTay Pet Supplies
- For each invoice, list the invoice number and invoice date along with the ID, first name, and last name of the customer for which the invoice was created.
- For each invoice placed on November 15, 2021, list the invoice number along with the ID, first name, and last name of the customer for which the invoice was created.
- Use the IN operator to find the ID, first name, and last name of each customer for which as invoice was created on November 15, 2021.

Transcribed Image Text:ITEM
ITEM_ID
AD72
BC33
CA75
DT12
FM23
FS39
FS42
KH81
LD14
LP73
PF19
QB92
SP91
UF39
WB49
DESCRIPTION
Dog Feeding Station
Feathers Bird Cage (12x24x18)
Enclosed Cat Litter Station
Dog Toy Gift Set
Fly Mask with Ears
Folding Saddle Stand
Aquarium (55 Gallon)
Wild Bird Food (25 lb)
Locking Small Dog Door
Large Pet Carrier
Pump & Filter Kit
Quilted Stable Blanket
Small Pet Carrier
Underground Fence System
Insulated Water Bucket
FIGURE 1-2 Sample data for KimTay Pet Supplies
14216
14219
14222
14224
14228
14231
14233
14237
INVOICES
INVOICE_NUM INVOICE_DATE
ON HAND
12
10
15
27
CUST_ID
11/15/2021 125
11/15/2021 227
11/16/2021 294
182
11/16/2021
11/18/2021 435
11/18/2021 125
11/18/2021 435
11/19/2021 616
41
12
5
24
14
23
5
32
18
7
34
FIGURE 1-2 Sample data for
KimTay Pet Supplies (Continued)
CATEGORY
DOG
BRD
CAT
DOG
HOR
HOR
FSH
BRD
DOG
DOG
FSH
HOR
CAT
DOG
HOR
14216
14219
14219
14222
14224
14228
14228
14231
14233
14233
14233
14237
LOCATION
B
B
C
LD14
KH81
FS42
PF19
UF39
KH81
QB92
WB49
LP73
B
C
с
A
С
A
B
A
с
B
A
Copyright 2021 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
itorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it
C
Introduction to Kim Tay Pet Supplies and StayWell Student Accommodation Databases
INVOICE_LINE
INVOICE_NUM ITEM_ID QUANTITY
CA75
AD72
DT12
PRICE
$79.99
$79.99
3
2
$39.99
$39.99
4
1
4
1
1
2
1
4
4
3
$24.95
$39.99
$124.99
$19.99
$49.99
$59.99
$74.99
$119.99
$39.99
$199.99
$79.99
QUOTED_PRICE
$37.99
$79.99
$39.99
$47.99
$18.99
$124.99
$74.99
$189.99
$19.99
$109.95
$74.95
$54.95
5

Transcribed Image Text:CUSTOMER
CUST_FIRST_
ID
126 Joey
182
227
294
375
492
NAME
314 Tom
543
616
Billy
Sandra
435 James
05
10
15
20
Melanie
Samantha Smith
Elmer
Angie
Sally
721 Leslie
795 Randy
LAST_
NAME
Smith
Rufton
Pincher
Rascal
Jackson
Gonzalez
Jackson
Cruz
ADDRESS
17 Fourth St
21 Simple Cir
Smith
53 Verde Ln
22 Jackson
Farm Rd
Hendricks 27 Locklear In
14 Rock Ln
1 Rascal Farm
Rd
199 18th Ave
123 Sheepland
Rd
Blacksmith 75 Stream Rd
SALES REP
REP_ID FIRST NAME LAST NAME ADDRESS
Susan
Richard
Garcia
Miller
Smith
Jackson
Donna
Daniel
CITY
Cody
Garland
42 Blackwater
Way
16 Rockway Rd Wapiti
Powell
Ralston
Cody
Elk Butte
Garland
Powell
Ralston
Elk Butte
Cody
STATE POSTAL EMAIL
WY
WY
WY
WY
WY
WY
WY
WY
WY
WY
82414
82435
82440
82440
82414
82433
82450
82435
82440
82440
WY 82433
WY 82414
CITY
42 Mountain Ln Cody WY
87 Pikes Dr
Ralston WY
312 Oak Rd Powell WY
19 Lookout Dr
Elk Butte WY
jsmith 17@
example.com
billyruff@
example.com
spinch2@
example.com
ssmith5@
example.com
trascal3@
example.com
mjackson5@
example.com
jgonzo@
example.com
ejackson4@
example.com
BALANCE CREDIT_REP
LIMIT ID
$80.68
$500.00 05
Ismith12@
example.com
$43.13 $750.00 10
$156.38 $500.00 15
$58.60
$17.25 $250.00 15
$500.00 10
$252.25 $250.00 05
$230.40 $1,000.00 15
$45.20 $500.00 10
ahendricks7@ $315.00 $750.00 05
example.com
scruz5@
example.com
$8.33 $500.00 15
$166.65 $1,000.00 10
rblacksmith6@ $61.50
example.com
STATE POSTAL CELL PHONE
82414 307-824-1245
82440
82440
82433
307-406-4321
307-982-8401
307-883-9481
$500.00 05
COMMISSION RATE
$12,743.16 0.04
$20,872.11 0.06
$14,912.92 0.04
$0.00 0.04
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps with 8 images

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.Similar questions
- SQL List the item ID, description, and on-hand value of each item whose number of units on hand is more than the average number of units on hand for all items. The output table should have the following column headers: ITEM_ID, DESCRIPTION, and ON_HAND_VALUE. Make sure to create a sub-query to get the average on hand value of all items in the ITEM table in order to determine which items have more than the current average on hand.arrow_forwardplease use the sql to answer the following question 3.Determine which books customer Jake Lucas has purchased. Perform the search using the customer name, not the customer number. If he has purchased multiple copies of the same book, unduplicated(DISCTINC) the result.arrow_forwardQ1. Create a stored procedure that will list all customers (name and number) represented by rep 15. (SQL)arrow_forward
- Show the employees who were in the engineering department as of Jan. 1, 2005 (using SQL)arrow_forwardUsing SQL: List the title_name and book type of books that have the lowest royalty rate.arrow_forwardWrite the SQL code that will produce the results shown as below. Write the SQL code to calculate the ASSIGN_CHARGE values in the ASSIGNMENT table. Note that ASSIGN_CHARGE is a derived attribute that is calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS. Write the SQL code that will yield the total number of hours worked for each employee and the total charges stemming from those hours worked. The result is shown as below.arrow_forward
- Create a stored procedure to include the companyname, last order date, ship address for company names the begin with an A Using NorthWind database in Microsoft SQL serverarrow_forwardanswer with proper explanation and step by step solution. Question write a PL/ SQL program to display the number of products whose price is 100 dh more or less than the price defined the for substitution variable use the define command to specify the price pass this value to the PL/SQL black using a substitution variablearrow_forwardcreate a PL/SQL code to determine which employee works for which city and report their increase based on the city. when employee is in city A ,salary lower then 10000, tey will get 10%more salary in city b ,salary lower then 10000, they will get 15%more salary all others ,they will only get 5% more . how to do this ? display salary , increased salary .salary in one year , first_name last_name ,emp id and city SELECT employee_id, salary, salary*12 , city From employees JOIN departmentsarrow_forward
- Create a SQL query to display the combined customer name, employee id, delivery notes, coinordered and invoice number. In your query only display the results that have any invoice date from 18th May 2021. CUSTOMER EMPLOYEE_ID DESCRIPTION COIN INVOICE_NUM INVOICE_DATE Lucy, Williams emp103 Delivery to work address 1oz Gold Palaeontology 8116 18-MAY-21 Julien, Hendricks emp105 Double packaging requested 1oz Silver Kruger Rand 8117 19-MAY-21 Sam, Clark emp105 Double packaging requested 1oz Silver Kruger Rand 8118 19-MAY-21arrow_forward7. List the shipping city and state for the order that had the longest shipping delay. SQL commandsarrow_forwardInclude both SQL commands and SQL results in your answers: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order is placed. List the invoice number, customer ID, customer first and last names, and the promotion date for each invoice. The promotion date is 20 days after the invoice was placed. Write PL/SQL (or MySQL) procedures to accomplish the following task: The procedure accepts the ID of a customer stored in the input variable named I_CUST_ID and displays the name (first name concatenated with last name) and credit limit of for this customer.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education