Task 11: List all the columns contained within the system catalog, but only display the first 11 records that are in the KimTay TABLE_SCHEMA.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I am trying to work on Task 11.

Task 11: List all the columns contained within the system catalog, but only display the first 11 records that are in the KimTay TABLE_SCHEMA. 

My query for Tasks 1-10...

TASK 1.

 

CREATE VIEW MAJOR_CUSTOMER AS

SELECT CUST_ID,FIRST_NAME,LAST_NAME, BALANCE, CREDIT_LIMIT, REP_ID

FROM CUSTOMER

WHERE CREDIT_LIMIT <= 500 ;

NEW QUERY

SHOW FULL TABLES WHERE table_type = 'VIEW' and tables_in_KimTay = 'MAJOR_CUSTOMER'

NEW QUERY

SELECT * FROM MAJOR_CUSTOMER

 

 TASK 2.
 

SELECT CUST_ID, FIRST_NAME, LAST_NAME

FROM MAJOR_CUSTOMER

WHERE BALANCE > CREDIT_LIMIT

 

TASK 3.
 

SELECT CUST_ID,FIRST_NAME,LAST_NAME 

FROM CUSTOMER

WHERE CREDIT_LIMIT <= 500;

 

TASK 4.
 

CREATE VIEW ITEM_INVOICE AS

SELECT C.ITEM_ID AS ITEM_ID, DESCRIPTION, PRICE, C.INVOICE_NUM AS INVOICE_NUM, 

INVOICE_DATE, QUANTITY, QUOTED_PRICE

FROM CUSTOMER A INNER JOIN INVOICES B ON A.CUST_ID = B.CUST_ID

INNER JOIN INVOICE_LINE C ON C.INVOICE_NUM = B.INVOICE_NUM

INNER JOIN ITEM D ON D.ITEM_ID = C.ITEM_ID;

NEW QUERY

SHOW FULL TABLES WHERE table_type = 'VIEW' AND tables_in_KimTay = 'ITEM_INVOICE'

 

TASK 5
 

SELECT ITEM_ID, DESCRIPTION, INVOICE_NUM, QUOTED_PRICE 

FROM ITEM_INVOICE WHERE QUOTED_PRICE > 100; 

 

TASK 6
 

SELECT ITEM.ITEM_ID, ITEM.DESCRIPTION, ITEM.PRICE,

INVOICES.INVOICE_NUM, INVOICES.INVOICE_DATE,

INVOICE_LINE.QUANTITY, INVOICE_LINE.QUOTED_PRICE

FROM INVOICES, INVOICE_LINE, ITEM

WHERE INVOICES.INVOICE_NUM = INVOICE_LINE.INVOICE_NUM

AND INVOICE_LINE.ITEM_ID = ITEM.ITEM_ID

AND INVOICE_LINE.QUOTED_PRICE > 100

TASK 7.
 

CREATE VIEW INVOICE_TOTAL AS

SELECT C.INVOICE_NUM AS INVOICE_NUM, SUM(QUANTITY * QUOTED_PRICE ) AS TOTAL_AMOUNT 

FROM CUSTOMER A INNER JOIN INVOICES B ON A.CUST_ID = B.CUST_ID

INNER JOIN INVOICE_LINE C ON C.INVOICE_NUM = B.INVOICE_NUM

INNER JOIN ITEM D ON D.ITEM_ID = C.ITEM_ID 

GROUP BY C.INVOICE_NUM ORDER BY C.INVOICE_NUM;

NEW QUERY

SHOW FULL TABLES WHERE table_type = 'VIEW' and tables_in_KimTay = 'INVOICE_TOTAL'

 

TASK 8 
 

SELECT INVOICE_NUM, TOTAL_AMOUNT

FROM INVOICE_TOTAL 

WHERE TOTAL_AMOUNT > 250;

 

TASK 9

SELECT INVOICES.INVOICE_NUM, SUM(QUANTITY*QUOTED_PRICE) AS TOTAL

FROM INVOICES, INVOICE_LINE

WHERE INVOICES.INVOICE_NUM = INVOICE_LINE.INVOICE_NUM

GROUP BY INVOICES.INVOICE_NUM

HAVING SUM(QUANTITY*QUOTED_PRICE) > 250

 

 

TASK 10

SELECT * FROM INFORMATION_SCHEMA.TABLES

WHERE TABLE_TYPE = "SYSTEM VIEW"

LIMIT 10

 

CUST_ID FIRST_NAME LAST_NAME ADDRESS
125
182
227
294
314
375
435
492
543
616
721
795
Joey
Billy
Sandra
Samantha
Tom
Melanie
James
Elmer
Angie
Sally
Leslie
Randy
Smith
Rufton
Pincher
Smith
Rascal
Jackson
Gonzalez
Jackson
Hendricks
Cruz
Smith
Blacksmith
17 Fourth St
21 Simple Cir
53 Verde Ln
14 Rock Ln
1 Rascal Farm Rd
42 Blackwater Way
16 Rockway Rd
22 Jackson Farm Rd
27 Locklear Ln
199 18th Ave
123 Sheepland Rd
75 Stream Rd
CITY
Cody
Garland
Powell
Ralston
Cody
Elk Butte
Wapiti
Garland
Powell
Ralston
Elk Butte
Cody
STATE POSTAL
WY
WY
WY
WY
WY
WY
WY
WY
WY
WY
WY
WY
82414
82435
82440
82440
82414
82433
82450
82435
82440
82440
82433
82414
EMAIL
jsmith17@example.com
billyruff@example.com
spinch2@example.com
ssmith5@example.com
trascal3@example.com
mjackson5@example.com
jgonzo@example.com
ejackson4@example.com
ahendricks7@example.com
scruz5@example.com
Ismith12@example.com
rblacksmith6@example.com
BALANCE
80.68
43.13
156.38
58.60
17.25
252.25
230.40
45.20
315.00
8.33
166.65
61.50
CREDIT_LIMIT REP_ID
500.00
750.00
500.00
500.00
250.00
250.00
1000.00
500.00
750.00
500.00
1000.00
500.00
05
10
15
10
15
05
15
10
05
15
10
05
Transcribed Image Text:CUST_ID FIRST_NAME LAST_NAME ADDRESS 125 182 227 294 314 375 435 492 543 616 721 795 Joey Billy Sandra Samantha Tom Melanie James Elmer Angie Sally Leslie Randy Smith Rufton Pincher Smith Rascal Jackson Gonzalez Jackson Hendricks Cruz Smith Blacksmith 17 Fourth St 21 Simple Cir 53 Verde Ln 14 Rock Ln 1 Rascal Farm Rd 42 Blackwater Way 16 Rockway Rd 22 Jackson Farm Rd 27 Locklear Ln 199 18th Ave 123 Sheepland Rd 75 Stream Rd CITY Cody Garland Powell Ralston Cody Elk Butte Wapiti Garland Powell Ralston Elk Butte Cody STATE POSTAL WY WY WY WY WY WY WY WY WY WY WY WY 82414 82435 82440 82440 82414 82433 82450 82435 82440 82440 82433 82414 EMAIL jsmith17@example.com billyruff@example.com spinch2@example.com ssmith5@example.com trascal3@example.com mjackson5@example.com jgonzo@example.com ejackson4@example.com ahendricks7@example.com scruz5@example.com Ismith12@example.com rblacksmith6@example.com BALANCE 80.68 43.13 156.38 58.60 17.25 252.25 230.40 45.20 315.00 8.33 166.65 61.50 CREDIT_LIMIT REP_ID 500.00 750.00 500.00 500.00 250.00 250.00 1000.00 500.00 750.00 500.00 1000.00 500.00 05 10 15 10 15 05 15 10 05 15 10 05
INVOICE_NUM
14216
14219
14222
14224
14228
14231
14233
14237
INVOICE_DATE
2021-11-15
2021-11-15
2021-11-16
2021-11-16
2021-11-18
2021-11-18
2021-11-18
2021-11-19
CUST_ID
125
227
294
182
435
125
435
616
Transcribed Image Text:INVOICE_NUM 14216 14219 14222 14224 14228 14231 14233 14237 INVOICE_DATE 2021-11-15 2021-11-15 2021-11-16 2021-11-16 2021-11-18 2021-11-18 2021-11-18 2021-11-19 CUST_ID 125 227 294 182 435 125 435 616
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY