21. Which SQL keyword indicates the condition for a filter?

  • FROM
  • SELECT
  • INNER JOIN
  • WHERE

22. You work with a table that has one column for name. Some of these names have prefixes. You want to identify all of the doctors. Which query will return every name that starts with the prefix 'Dr.'?

  • WHERE name LIKE ‘Dr.%’;
  • WHERE name = ‘Dr.%’;
  • WHERE name = ‘Dr._’;
  • WHERE name LIKE ‘Dr._’;

23. What does the following query return?

SELECT *

FROM employees

RIGHT JOIN machines ON employees.device_id = machines.device_id;

  • All columns of the employees and machines table and the records from  employees and machines that match on device_id
  • All columns and records from the employees and machines tables
  • All columns of the employees and machines table, all records from the employees table, and the records from machines that match on device_id
  • All columns of the employees and machines table, all records from the machines table, and the records from employees that match on device_id

24. You are working with the Chinook database. You want to return the company and country columns from the customers table. Replace --??? with the missing information to complete the query. (If you want to undo your changes to the query, you can click the Reset button.)

In what country is JetBrains s.r.o. located?

  • Germany
  • Czech Republic
  • Brazil
  • United States

25. You are working with the Chinook database and are responsible for filtering for invoices with a total that is more than 20. Replace --??? with the missing information to complete the query. (If you want to undo your changes to the query, you can click the Reset button.)

How many invoices have a total that is more than 20?

  • 2
  • 4
  • 1
  • 3

26. You are working with the Chinook database and are responsible for filtering for the customers that live in the city of 'Mountain View' and work for the company of 'Google Inc.' Replace --??? with the missing information to complete the query. (If you want to undo your changes to the query, you can click the Reset button.)

How many customers live in Mountain View and work for Google Inc.?

  • 3
  • 2
  • 4
  • 1

27. A security analyst queries a table related to login attempts. How can SQL help this analyst with their work?

  • The analyst will get a live update on new login attempts. 
  • The analyst can efficiently find the login data they need.
  • SQL will change authentication permissions to prevent unauthorized logins.
  • SQL will automatically distribute a report on suspicious login attempts.

28. Which of these SQL statements queries the machines table? Select all that apply.

  • SELECT *

    FROM machines;

  • SELECT device_id, operating_system

    FROM machines

    WHERE operating_system = ‘OS 2’;

  • SELECT machines

    FROM *;

  • SELECT machines

    FROM operating_system;

Shuffle Q/A 3

29. What does WHERE department = 'Sales' indicate in the following SQL query?

SELECT *

FROM employees

WHERE department = 'Sales';

  • To highlight the department column in the results
  • To only return rows that match the filter
  • To only return the department column 
  • To change all the values in the department column to ‘Sales’

30. You need to perform a SQL join. You want to return all the columns with records matching on the employee_id column between the employees and machines tables. You also want to return all records from the machines table. Which of the following queries would you use?

  • SELECT *

    FROM employees

    INNER JOIN machines ON employees.employee_id = machines.employee_id;

  • SELECT *

    FROM employees

    LEFT JOIN machines ON employees.employee_id = machines.employee_id;

  • SELECT *

    FROM employees

    FULL OUTER JOIN machines ON employees.employee_id = machines.employee_id;

  • SELECT *

    FROM employees

    RIGHT JOIN machines ON employees.employee_id = machines.employee_id;

Leave a Reply