tools of the trade linux and sql coursera weekly challenge 4 answers

Test your knowledge: SQL and databases

1. Which statement accurately describes the organization of a relational database?

  • Relational databases consist of a single table with one primary key and one foreign key.
  • Relational databases contain tables that are related to each other through primary and foreign keys.
  • Relational databases consist of a single table containing related information.
  • Relational databases contain primary keys with at least two duplicate values.

2. What is SQL used for? Select two answers.

  • Finding data to support security-related decisions and analysis
  • Allowing users to access a specific machine
  • Securing an organization’s systems and networks
  • Creating, interacting with, and requesting information from a database

3. A record of attempts to connect to an organization’s network is one example of a log.

  • True
  • False

4. Fill in the blank: A request for data from a database table or a combination of tables is called a _____.

  • query
  • log
  • key
  • row

Test your knowledge: SQL queries

5. What is filtering in SQL?

  • Removing invalid records
  • Removing unnecessary data from the database
  • Selecting data that match a certain condition
  • Changing a table to match a condition

6. You are working with the Chinook database and want to return the firstname, lastname, and phone of all employees. 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.)

What is Andrew Adams' phone number?

  • +1 (403) 262-3443
  • +1 (780) 428-9482
  • +1 (780) 836-9987
  • +1 (403) 467-3351

7. A security analyst wants to filter the log_in_attempts table for records where the value in the country column is 'Canada'. What is a valid query for this?

  • WHERE country  = ‘Canada’

    SELECT *

    FROM log_in_attempts;

  • SELECT *

    FROM log_in_attempts

    WHERE country  = ‘Canada’;

  • SELECT WHERE country = ‘Canada’

    FROM log_in_attempts;

  • SELECT *

    FROM log_in_attempts

    WHERE country = Canada;

8. Which pattern matches with any string that starts with the character 'A'?

  • ‘%A%’
  • ‘%A’
  • ‘A%’
  • ‘A’

Shuffle Q/A 1

Test your knowledge: More SQL filters

9. Which filter outputs all records with values in the date column between '01-01-2015' (January 1, 2015) and '01-04-2015' (April 1, 2015)?

  • WHERE date BETWEEN ’01-01-2015′ AND ’01-04-2015′;
  • WHERE date BETWEEN ’01-01-2015′, ’01-04-2015′;
  • WHERE date < ’01-04-2015′;
  • WHERE date > ’01-01-2015′;

10. Which operator is most efficient at returning all records with a status other than 'successful'?

  • OR
  • NOT
  • BETWEEN
  • AND

Leave a Reply