Consider the table Accounts(branch_id, account_id, balance) in Question 2. For each of the following SQL statements, tell
Fantastic news! We've Found the answer you've been seeking!
Question:
Consider the table Accounts(branch_id, account_id, balance) in Question 2. For each of the following SQL statements, tell whether it is a valid SQL statement. If it is not a valid SQL statement, explain why, and if it is a valid SQL statement, describe what it computes in general and what it returns for the instance of Accounts in Question .
(a)
SELECT A.branch_id, AVG(A.balance) FROM Accounts A GROUP BY A.branch_id HAVING A.balance >=150K
(b)
SELECT A.branch_id, AVG(A.balance) FROM Accounts A WHERE A.balance >=150K GROUP BY A.branch_id
(c)
SELECT A.account_id, AVG(A.balance) FROM Accounts A WHERE A.balance >=150K GROUP BY A.branch_id
Related Book For
Understanding Basic Statistics
ISBN: 9781111827021
6th Edition
Authors: Charles Henry Brase, Corrinne Pellillo Brase
Posted Date: