SUBQUERY

MULTIPLE CHOICE QUESTION SET-3

Answers:

1)

To display the names of employees who earns more than the average salary of all

employees.

 

SELECT last_name, first_name

FROMemployee

WHEREsalary > AVG(salary);

 

Which change should you make to achieve the desired results?

Select one:

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.

2)

The NOT operator can be used with ______ operators.

Select one or more:

a. ALL

b. ANY

c. IN

d. >

4)

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

c. Joins

d.Left outer join

4)

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?

 

 

Select one:

 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.

Answers:

  • Loginhackers Blogger
  • Contact us via Twitter Loginhackers
  • Contact us via Instagram
  • loginhackers facebook contact id

Free Premium | Spotify premium for free | Grammarly free premium | Netflix free accounts | Netflix mod | Spotify mod | Hotstar mod | Spotify premium mod apk | free amazon prime account