1. Consider the following tables in a relational database. Provide the appropriate SELECT SQL statement necessary...
Fantastic news! We've Found the answer you've been seeking!
Transcribed Image Text:
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary to answer the queries that follow. Primary keys are underlined and foreign key fields have an asterisk at the end of the field. CUSTOMERS (CUST-NO, C-NAME, C-ADDRESS, BALANCE) SALESPERSONS (SP-NO, S-NAME, DATE-EMPLOYED, SALARY) SALES (INVOICE-NO, DATE, CUST-NO*, SP-NO*) a) List the salesperson name and salary for all sales to customers whose balance outstanding is greater than 20000. b) List the names and addresses of all customers who have been sold merchandise by salespersons employed before 1/196. 2. Find all violations of entity and referential integrities. CUSTOMERS CUSTOMER NAME ADDRESSI ADDRESS2 STATE STR BALANCE 456 ABC Corp. 111 Any St. Houston TX 6.25 34560.65 457 DEF Corp 222 Anywhere Dr. New York NY 6.50 2145.90 458 GHI Corp s Someplace Ct. Miani 6.45 45670.75 459 UKL Corp 56 Some Dr. Bryan TX 6.25 21009.50 460 MNO Corp Noplace Cir San Diego CA s s0 4561.00 INVOICE-ITEMS INVOICE# TEM# DESC PRICE QTY 1001 121 Widget 2.25 45 1001 $40 Bolt 0.40 25 1002 211 Gear 3.70 10 1003 121 Widget 2.25 15 INVOICE-ITEMS INVOICE# ITEM# DESC PRICE QTY 1001 121 Widget 2.25 45 1001 540 Bolt 0.40 25 1002 211 Gear 3.70 10 1003 121 Widget 2.25 15 1003 121 Widget 2.25 10 1006 348 Nut 0.25 INVOICES INVOICE# DATE CUSTOMER# AMOUNT 1001 11-1-95 456 450.75 1002 11-2-95 457 560.25 11-2-95 160 300 10 INVOICES INVOICE# DATE CUSTOMER# AMOUNT 1001 11-1-95 456 450.75 1002 11-2-95 457 560.25 11-2-95 460 300.10 1003 11-2-95 459 890.25 1004 11-3-95 450 425.50 1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary to answer the queries that follow. Primary keys are underlined and foreign key fields have an asterisk at the end of the field. CUSTOMERS (CUST-NO, C-NAME, C-ADDRESS, BALANCE) SALESPERSONS (SP-NO, S-NAME, DATE-EMPLOYED, SALARY) SALES (INVOICE-NO, DATE, CUST-NO*, SP-NO*) a) List the salesperson name and salary for all sales to customers whose balance outstanding is greater than 20000. b) List the names and addresses of all customers who have been sold merchandise by salespersons employed before 1/196. 2. Find all violations of entity and referential integrities. CUSTOMERS CUSTOMER NAME ADDRESSI ADDRESS2 STATE STR BALANCE 456 ABC Corp. 111 Any St. Houston TX 6.25 34560.65 457 DEF Corp 222 Anywhere Dr. New York NY 6.50 2145.90 458 GHI Corp s Someplace Ct. Miani 6.45 45670.75 459 UKL Corp 56 Some Dr. Bryan TX 6.25 21009.50 460 MNO Corp Noplace Cir San Diego CA s s0 4561.00 INVOICE-ITEMS INVOICE# TEM# DESC PRICE QTY 1001 121 Widget 2.25 45 1001 $40 Bolt 0.40 25 1002 211 Gear 3.70 10 1003 121 Widget 2.25 15 INVOICE-ITEMS INVOICE# ITEM# DESC PRICE QTY 1001 121 Widget 2.25 45 1001 540 Bolt 0.40 25 1002 211 Gear 3.70 10 1003 121 Widget 2.25 15 1003 121 Widget 2.25 10 1006 348 Nut 0.25 INVOICES INVOICE# DATE CUSTOMER# AMOUNT 1001 11-1-95 456 450.75 1002 11-2-95 457 560.25 11-2-95 160 300 10 INVOICES INVOICE# DATE CUSTOMER# AMOUNT 1001 11-1-95 456 450.75 1002 11-2-95 457 560.25 11-2-95 460 300.10 1003 11-2-95 459 890.25 1004 11-3-95 450 425.50
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
In a relational database environment, certain accounting records (for example, journals, subsidiary, ledgers, and event general ledger accounts) may not exist. How is this possible?
-
Consider the following tables form part of a Library database held in an RDBMS: Book (ISBN, title, edition, year) BookCopy (copyNo, ISBN, available) Borrower (borrowerNo, borrowerName,...
-
Consider the following information: Probability of State Rate of Return if State Occurs Economy of Economy Stock A Stock B Recession .24 .030 .39 Normal .59 .110 .29 Boom .17 .280 .52 a. Calculate...
-
Determine whether each relation defines y as a function of x. Give the domain. Identify any linear functions. y = |x|
-
Discuss the network applications that you studied in this section and the tools and technologies that support each one.
-
Carl Carter had purchased a residence on January 12, 2018, for $165,000 and then sold it on April 12, 2019, for $440,000 because of severe health problems. a. How much gain can Carl exclude and how...
-
Why is an ICP accelerometer better than a non-ICP accelerometer?
-
The post-closing trial balance for Cortez Co. is as follows. The subsidiary ledgers contain the following information: (1) accounts receivable'J. Anders $2,500, F. Cone $7,500, T. Dudley $5,000; (2)...
-
Module 3 included an overview of the different and various legal remedies that are available to both the seller (lessor) and the buyer (lessee) in the event of breach of a sales (lease) contract. The...
-
Based on the information in The Art of Positive Communication EL. a TedTalk by Julien Mirivel, Answer the following questions: 1) Name and give a brief example for each of the 6 positive...
-
During the risk response phase, _______. a.analytical procedures can be used, and are required, as a substantive test to gather audit evidence b.all analytical procedures have been conducted...
-
Which one of the metal atoms whose electronic structure given below forms a nitrate of the type M(NO3)2? 37 A. 2.8.0 B. 2.8.1 C. 2.8.2 D. 2.8.3
-
17. The reaction A+B C+D is carried out at 80 C in an isothermal, perfectly stirred tank batch reactor. The reaction rate can be described as second-order, where k-0.058 m kmo1 min. At 80 C, 240 kg...
-
2. Current is flowing through a wire at a constant amperage of 15 coulombs/second. The wire is composed of copper that is 10 cm long with a 2 mm radius. The resulting resistivity of the copper is...
-
18. The atomic number of elements P, Q, R and T are 19,17, 14 and 6 respectively. The pair of elements that can react to form an ionic compound is A. Q and T B. R and Q C. Q and P D. R and T 19. The...
-
1. If you are an investor who is looking for a bond to invest in, which bond would you choose to invest? Why? Take a look at the balance sheet and income statement of the company. What data or ratios...
-
Question 2 of 5 View Policies Show Attempt History < > Current Attempt in Progress Your answer is partially correct. 0.18/0.4 E !!! Bonita has recently started to manufacture RecRobo, a three-wheeled...
-
Consider the reaction of acetic acid in water CH 3 CO 2 H(aq) + H 2 O(l) CH3CO 22 (aq) + H 3 O + (aq) where Ka 5 1.8 3 1025. a. Which two bases are competing for the proton? b. Which is the stronger...
-
What documentation techniques are used in the structured design approach to conceptual design? What is the purpose of each of these documentation techniques, and how do they vary from each other? How...
-
What is the relationship among data, information, and an information system?
-
Explain how linkages between relational tables are accomplished.
-
If youd like to have $5,000,000 at retirement in 45 years and you expect to earn 10 percent annually, which is around the average return over the past 50 years, what lump sum would you have to invest...
-
Obaidullah Hamzah, who recently sold his Ford Mustang, placed $15,000 in a savings account paying annual compound interest of 7 percent. a. Calculate the amount of money that will be accrued if he...
-
How many years will the following take? a. \($550\) to grow to \($1,049.50\) if invested at 6 percent compounded annually b. \($37\) to grow to \($63.87\) if invested at 9 percent compounded annually...
Study smarter with the SolutionInn App