All Coursera Quiz Answers

Tools of the Trade: Linux and SQL Weekly challenge 4 Quiz Answers

In this article i am gone to share Coursera Course: Tools of the Trade: Linux and SQL Weekly challenge 4 Quiz Answers with you..

Enroll Link: Tools of the Trade: Linux and SQL


Also Visit:  Tools of the Trade: Linux and SQL Weekly challenge 3 Quiz Answers


 

Tools of the Trade: Linux and SQL Weekly challenge 4 Quiz Answers

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

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

Question 2)
What is a primary key?

  • The first column in every table
  • The first row in every table
  • A column where every row has a unique entry
  • A column that contains null values

Question 3)
Which of these SQL statements queries the log_in_attempts table? Select all that apply.

  • SELECT * FROM log_in_attempts;
  • SELECT event_id, username FROM log_in_attempts WHERE event_id < 150;
  • SELECT log_in_attempts FROM *;
  • SELECT log_in_attempts FROM event_id;

Question 4)
What does INNER JOIN do?

  • Compare tables and return only the rows that have a matching value in a specified column
  • Filter databases to return only columns that exist in every table
  • Combine tables and save them as a new table
  • Return every row in joined tables

Question 5)
What does WHERE department = ‘Sales’ indicate in the following SQL query?

SELECT * FROM employees WHERE department = ‘Sales’;

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

Question 6)
Which query returns all records that start with the character ‘a’ from the name column in the employees table?

  • SELECT name FROM employees WHERE name = ‘a%’;
  • SELECT name FROM employees WHERE name LIKE ‘a%’;
  • SELECT name FROM employees WHERE name LIKE ‘a’;
  • SELECT name FROM employees WHERE name LIKE ‘%a’;

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

  • SELECT * FROM employees INNER JOIN machines ON employees.device_id = machines.device_id;
  • SELECT * FROM employees LEFT JOIN machines ON employees.device_id = machines.device_id;
  • SELECT * FROM employees RIGHT JOIN machines ON employees.device_id = machines.device_id;
  • SELECT * FROM employees FULL OUTER JOIN machines ON employees.device_id = machines.device_id

Question 8)
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.)

–???
FROM customers;

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

  • United States
  • Germany
  • Brazil
  • Czech Republic

Question 9)
You are working with the Chinook database and want to filter on the hiredate column to find all employees hired on or after ‘2003-10-17’ (October 17, 2003). 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.)

SELECT firstname,lastname,hiredateFROM employees–???
SELECT firstname,lastname,hiredate
FROM employees
–???

How many employees were hired on or after October 17, 2003?

  • 4
  • 1
  • 3
  • 2

Question 10)
You are working with the Chinook database and are responsible for filtering for the customers that have a value of ‘USA’ in the country column and have a value of ‘Frank’ in the firstname column. 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.)

SELECT firstname, lastname, countryFROM customers–???
SELECT firstname, lastname, country
FROM customers
–???

How many customers live in the USA and have the name Frank?

  • 2
  • 1
  • 3
  • 4

Question 11)
A security analyst queries a database related to security patches. How can SQL help this analyst with their work?

  • The analyst can efficiently find the data they need.
  • SQL will send out a spreadsheet about the patches.
  • SQL will automatically produce a report when the patches have been installed.
  • The analyst can directly install patches from SQL.

Question 12)
Fill in the blank: A column in which every row has a unique entry and which is used to identify a table is called a _____.

  • database key
  • primary key
  • relational key
  • foreign key

Question 13)
What type of join compares tables and returns only the rows that have a matching value in a specified column?

  • FULL OUTER JOIN
  • LEFT JOIN
  • INNER JOIN
  • RIGHT JOIN

Question 14)
Which SQL keyword indicates the condition for a filter?

  • WHERE
  • SELECT
  • FROM
  • INNER JOIN

Question 15)
Which query returns all records that contain the character ‘z’ from the name column in the employees table?

  • SELECT name FROM employees WHERE name = ‘z%’;
  • SELECT name FROM employees WHERE name LIKE ‘z’;
  • SELECT name FROM employees WHERE name LIKE ‘%z’;
  • SELECT name FROM employees WHERE name LIKE ‘%z%’;

Question 16)
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 FULL OUTER JOIN machines ON employees.employee_id = machines.employee_id;
  • SELECT * FROM employees RIGHT JOIN machines ON employees.employee_id = machines.employee_id;
  • SELECT * FROM employees LEFT JOIN machines ON employees.employee_id = machines.employee_id;

Question 17)
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.)

SELECT customerid, totalFROM invoices–???
SELECT customerid, total
FROM invoices
–???

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

  • 4
  • 1
  • 2
  • 3

Question 18)
What is true about the values in the primary key column? Select all that apply.

  • Each row must have a unique value.
  • They should never contain numeric data.
  • They cannot be null (or empty).
  • They do not need to be unique.

Question 19)
Both an employees table and a machines table contain an employee_id column, and you want to return only the records that share a value in this column. Which keyword should be part of your query?

  • FULL OUTER JOIN
  • INNER JOIN
  • BETWEEN
  • WHERE

Question 20)
A security professional uses SQL to return records from a table and applies a filter to the query. Which of the following keywords would they need to use in their query? Select all that apply.

  • ON
  • SELECT
  • WHERE
  • FROM

Question 21)
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 LIKE ‘Dr.%’;
  • WHERE name = ‘Dr._’;

Question 22)
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 machinesFROM *;
  • SELECT machines FROM operating_system;

Question 23)
You are working with the Chinook database. You want to return the lastname and title columns from the employees 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.)

–???FROM employees;
–???
FROM employees;

What is the title of the employee with the last name of Callahan?

  • IT Manager
  • General Manager
  • Sales Manager
  • IT Staff

Question 24)
You are working with the Chinook database and are responsible for filtering for customers that live in the country of ‘USA’ and the state with an abbreviation of ‘CA’. 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.)

SELECT firstname,lastname, address, countryFROM customers–???
SELECT firstname,lastname, address, country
FROM customers
–???

What are the first names of the customers that live in the USA and the state with an abbreviation of CA?

  • Frank, Tim, Dan, Heather, Kathy
  • John, Michelle, Julia, Patrick
  • Kathy, Michelle, Frank
  • Frank, Tim, Dan

Question 25)
Why might a security analyst use SQL?

  • To create new files on their computer
  • To store data in a spreadsheet
  • To efficiently find needed data in security logs
  • To assign new passwords to users

Question 26)
You are working with the Chinook database and are responsible for filtering for the employees with a birthdate that is on or after ‘1973-01-01’ (January 1, 1973). 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.)

SELECT firstname,lastname, birthdateFROM employees–???
SELECT firstname,lastname, birthdate
FROM employees
–???

How many employees were born on or after January 1, 1973?

  • 1
  • 4
  • 3
  • 2

Question 27)
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.)

SELECT firstname, lastname, city, companyFROM customers–???
SELECT firstname, lastname, city, company
FROM customers
–???

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

  • 1
  • 3
  • 4
  • 2

 

Question 28)
Which of these SQL statements queries the employees table? Select all that apply.

  • SELECT * FROM employees;
  • SELECT employee_id, device_id FROM employees WHERE employee_id > 1100;
  • SELECT employees FROM employee_id;
  • SELECT employees FROM *;

Question 29)
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.)

SELECT firstname, lastname, city, companyFROM customers–???
SELECT firstname, lastname, city, company
FROM customers
–???

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

  • 1
  • 2
  • 3
  • 4

Question 30)
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.)

SELECT firstname, lastname, city, companyFROM customers–???
SELECT firstname, lastname, city, company
FROM customers
–???

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

  • 2
  • 3
  • 4
  • 1

Question 31)
You are working with the Chinook database. You want to return the employeeid and email columns from the employees 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.)

–???FROM employees;
–???
FROM employees;

What is the employee ID number of the employee with an email of [email protected]?

  • 8
  • 6
  • 4
  • 2