MULTIPLE CHOICE QUESTION SET-3
To display the names of employees who earns more than the average salary of all
SELECT last_name, first_name
WHEREsalary > AVG(salary);
Which change should you make to achieve the desired results?
a. Move the function to the SELECT clause and add a GROUP BY clause and a HAVING clause.
b. Change the function in the WHERE clause.
c. Move the function to the SELECT clause and add a GROUP BY clause.
d. Use a subquery in the WHERE clause to compare the average salary value.
The NOT operator can be used with ______ operators.
Select one or more:
The ___________ returns all the rows from the right table, with the matching rows in the left table
a. Full outer join
b.right outer join
d.Left outer join
You issue the following SQL statement on the CUSTOMERS table to display the customers who are in the same country as customers with the last name 'king' and whose credit limit is less than the maximum credit limit in countries that have customers with the last name 'king'.
Which statement is true regarding the outcome of the above query?
a. It produces an error and the < operator should be replaced by < ALL to get the required output.
b. It produces an error and the < operator should be replaced by < ANY to get the required output
c. It executes and shows the required result.
d. It produces an error and the IN operator should be replaced by = in the WHERE clause of the main query to get the required output.
5)Main query and subquery can/must get data from __________ tables.