Write a SQL statement that displays the customer code, customer first name, customer last name and customer balance for each customer. Sort the results by customer code and use the alias "Amount Owed" instead of customer balance.

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

Use Figure 3 provided in the handout to answer this question.

Write a SQL statement that displays the customer code, customer first name, customer last name and customer balance for each customer. Sort the results by customer code and use the alias "Amount Owed" instead of customer balance.

 

 

Figure 3
Relational diagram
CUSTOMER
PRODUCT
LINE
VENDOR
PK Cs Code
INVOICE
PK Code
PK y Code
PK In Number
PK,FKI Iny Number
Line Number
Cus LName
Cus FName
Cus Initial
Cus AreaCode
Cus Phone
Cus Balance
H-O
FK1 Cus Code
Inv Date
bo-H-
P_Descript
PInDate
P_Code
Line Units
Line_Price
V_Name
V Contact
V Areacode
V Phone
V State
V Order
FK2
P_Min
PPrice
PDiscount
FKI V_Code
Table name: VENDOR
Table name: CUSTOMER
V.CODE VNAME V.CONTACTVAEACODE VHONE VSTATE V.ORDER
as coce s N s NAME as NA as AREACODE S PONE CS ALANCE
21225 Bryon, e
Son
223-324 TN
25s L
22-3245 TN
615
Aed
A
00
212 Spertoe, e Pustg
21231 DE Sty
04
IN
Sng
oteg
Snh 01
1001 Durne Lea
0.0
100 S y
214 ome ron
22567 Done Se
015
se9-2546 MY
IN
toer Ow
GA
1004 Or Mran
220-162
000
23119 Randets Ld
Anderson
901
GA
100S Oran Amy
44
713
24004 Brcman Bros
Brownng
228-1410
TN
10nson e
221 1
H
24 OREVA, ne
254) ,
615
8-124
20-256
Seh
904
227-0090
216 55
25501 Danal Seples Se
615
TN
N
100
0.00
259S Rcon Systens Orton
904
456-002
PL
Table name: INVOICE Table name: LINE
Table name: PRODUCT
WE OSCODE DATE
1 16
10 16
1000 1
10 17-
one 17
NMMEER LIE NMER PCODE LE UNTS LNE E
11GERO Powe prte
13-0 2 per
10
000
2
100
15
140
005 24
13 12
15an 1s
15a 2 S
Dec-7 S 10
24De- S 00s 2
12 0 2
2 2
0a S 1 0s
15De-T 2 00
1 22PD
15-a d c 1on 0
22oorY BO , 12 tlade
zore e , n
2moro , 10
1006
2
2 15-002
24
oer ns 11a
104
hanne 1
SAT2 n e
12
2 220orY
1092
2
SM 2e t , s
w 25 w e,
at a 000 2
1or
1490
S 11
2 4778-21
PVC
490
18
25
1000
11
100
100
Transcribed Image Text:Figure 3 Relational diagram CUSTOMER PRODUCT LINE VENDOR PK Cs Code INVOICE PK Code PK y Code PK In Number PK,FKI Iny Number Line Number Cus LName Cus FName Cus Initial Cus AreaCode Cus Phone Cus Balance H-O FK1 Cus Code Inv Date bo-H- P_Descript PInDate P_Code Line Units Line_Price V_Name V Contact V Areacode V Phone V State V Order FK2 P_Min PPrice PDiscount FKI V_Code Table name: VENDOR Table name: CUSTOMER V.CODE VNAME V.CONTACTVAEACODE VHONE VSTATE V.ORDER as coce s N s NAME as NA as AREACODE S PONE CS ALANCE 21225 Bryon, e Son 223-324 TN 25s L 22-3245 TN 615 Aed A 00 212 Spertoe, e Pustg 21231 DE Sty 04 IN Sng oteg Snh 01 1001 Durne Lea 0.0 100 S y 214 ome ron 22567 Done Se 015 se9-2546 MY IN toer Ow GA 1004 Or Mran 220-162 000 23119 Randets Ld Anderson 901 GA 100S Oran Amy 44 713 24004 Brcman Bros Brownng 228-1410 TN 10nson e 221 1 H 24 OREVA, ne 254) , 615 8-124 20-256 Seh 904 227-0090 216 55 25501 Danal Seples Se 615 TN N 100 0.00 259S Rcon Systens Orton 904 456-002 PL Table name: INVOICE Table name: LINE Table name: PRODUCT WE OSCODE DATE 1 16 10 16 1000 1 10 17- one 17 NMMEER LIE NMER PCODE LE UNTS LNE E 11GERO Powe prte 13-0 2 per 10 000 2 100 15 140 005 24 13 12 15an 1s 15a 2 S Dec-7 S 10 24De- S 00s 2 12 0 2 2 2 0a S 1 0s 15De-T 2 00 1 22PD 15-a d c 1on 0 22oorY BO , 12 tlade zore e , n 2moro , 10 1006 2 2 15-002 24 oer ns 11a 104 hanne 1 SAT2 n e 12 2 220orY 1092 2 SM 2e t , s w 25 w e, at a 000 2 1or 1490 S 11 2 4778-21 PVC 490 18 25 1000 11 100 100
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Multiple 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
  • SEE MORE 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