a. The subquery returns more than 1 row. b. You need a JOIN ON clause to pull from multiple tables. c. You cannot have a subquery in the SELECT statement. d. The result is a Cartesian Product. e. There is nothing wrong with

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter4: Constraints
Section: Chapter Questions
Problem 1HOA
icon
Related questions
Question

Subject DataBase/MySQL

What is wrong with this statement?

SELECT vendor_id, (SELECT vendor_name FROM vendors), avg(invoice_total) FROM invoices GROUP BY vendor_id;

Select one:

a. The subquery returns more than 1 row.

b. You need a JOIN ON clause to pull from multiple tables.

c. You cannot have a subquery in the SELECT statement.

d. The result is a Cartesian Product.

e. There is nothing wrong with this statement.

 

What is wrong with this statement?

SELECT vendor_name, avg(invoice_total) AS 'Invoice Total' FROM vendors v JOIN invoices i ON v.vendor_id = i.vendor_id

Select one:

a. You are missing the GROUP BY clause.

b. Nothing, this statement runs correctly.

c. The JOIN ON clause is incorrect.

d. Invoices should also be in the FROM clause.

e. You are using single quotes instead of double quotes.

- TIA

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 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.
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage