Question

Using Figure 2. show what would be displayed by the following SQL queries should they be executed against the tables having content (tuples/rows) shown in Figure 2. In each answer to a question, do not forget to display column headings in addition to the tuples/rows that would be shown.

1. SELECT pNo, MAXIat), (SELECT MAX(t) FROM sp WHERE pNo IN (SELECT RNR FROM p WHERE RNam晨= cam) )AS MAXcao FROM GROUP BY HsNo (PKNameStatue sCity 20 U London gtv o0 0 4 Act Figure 2. Content of the Supplier-Parts DB Tables Go t

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

1)

pNo MAX(qty) MAXcam
P1 300 100
P2 400 100
P3 400 100
P4 200 100

2)

pNo MAX(qty) MAXcamORnut
P1 300 300
P2 400 300
P3 400 300
Add a comment
Know the answer?
Add Answer to:
Using Figure 2. show what would be displayed by the following SQL queries should they be...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2. Part 2 Given a set of tables with their content (tuples/rows), show what would be...

    2. Part 2 Given a set of tables with their content (tuples/rows), show what would be retrieved if the given SQL queries were issued Consider tables, of a Supplier-Parts DB, shown in Figure 2. Names of tables, columns and identification of primary foreign keys are shown. Questions in this part ask you to show what would be displayed by the following SQL queries should they be executed against the tables having content (tuples/rows) shown in Figure 2. In each answer...

  • Questions in this part ask you to write SQL queriesthat would retrieve certain information from the...

    Questions in this part ask you to write SQL queriesthat would retrieve certain information from the tables. For each question, write the SQL query that would display the information asked by the question. Display information about parts that have their weights greater than the average weight of all parts.   PNO PNAME P2 BOLT P3 SCREW Find supplier numbers who supply any screws (i.e., such that the part name is ‘screw’).  The constraint is that you may not use any join or...

  • Use the give table below to answer the following questions. sName Smith sCity SI S2 PI...

    Use the give table below to answer the following questions. sName Smith sCity SI S2 PI P2 P3 P4 PS Nut Bolt Red Blue 12 17 17 10 Blake Paris Screw Red S4. S5 30 Athens Blue 12 SP SNo (PK) (FK S1 S1 S1 S1 S1 S2 S2 S3 S3 S3 S4 P1 P2 P3 P4 PS PI P2 Pl P2 P3 P2 P3 P4 200 100 100 200 200 200 S5 Table: Content of the Supplier-Parts DB Tables...

  • In using a database created from this model, which of the following SQL queries would give...

    In using a database created from this model, which of the following SQL queries would give us a list of customers who have daily deposit transactions (deposit is a transaction type) totaling $10,000 or more across all of their accounts (i.e., this is a total across all accounts of a customer, not per account). Include in this list the Customer ID and name, and the dates and their respective daily total. SELECT c.cust_id, c.cust_name, DATE(t.tran_date), SUM(t.tran_amount) AS daily_total FROM Customers...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT