(4) Tools of the Trade: Linux and SQL Flashcards
What is an operating system?
A program for sending email
The physical components of a computer
A computer, smartphone, or tablet
The interface between the computer hardware and the user
The interface between the computer hardware and the user
An operating system is the interface between computer hardware and the user.
Which of the following are operating systems? Select all that apply.
Windows
Android
Linux
Smartphones
Windows
Android
Linux
Android, Linux, and Windows are operating systems. Operating systems are interfaces between computer hardware and the user.
Which of the following statements correctly describe operating systems? Select all that apply.
Computers run efficiently because of operating systems.
Operating systems help people interact with computers.
Operating systems are the physical components of a computer.
Operating systems are able to run many applications at once.
Computers run efficiently because of operating systems.
Operating systems help people interact with computers.
Operating systems are able to run many applications at once.
Operating systems help people interact with computers, and computers run efficiently because of operating systems. Operating systems are able to run many applications at once.
Computers communicate in a language called binary, which consists of 0s and 1s.
True
False
True
Computers communicate in a language called binary, which consists of 0s and 1s.
What is the job of a computer’s operating system?
Turn on the computer
Help other computer programs run efficiently
Allow users to specify tasks
Load the bootloader
Help other computer programs run efficiently
The job of a computer operating system is to help make other computer programs run efficiently. It does this by managing the details related to controlling computer hardware.
Fill in the blank: In order to carry out tasks on a computer, users directly interact with _____.
task managers
applications
the CPU
the BIOS
applications
Users interact with applications in order to carry out tasks on a computer. Applications are programs that perform a specific task.
The management of a computer’s resources and memory is handled by an application.
True
False
False
The management of a computer’s resources and memory is handled by its operating system. The operating system ensures the limited capacity of the computer system is used where it’s needed most.
Which of the following processes are part of starting an operating system? Select all that apply.
The BIOS or UEFI microchip loads the bootloader.
The bootloader starts the operating system.
The bootloader immediately launches when a user turns on a computer.
Either the BIOS or UEFI microchip is activated when a user turns on a computer.
The BIOS or UEFI microchip loads the bootloader.
The bootloader starts the operating system.
Either the BIOS or UEFI microchip is activated when a user turns on a computer.
Either the BIOS or UEFI microchip is activated when a user turns on a computer. The BIOS or UEFI microchip loads the bootloader, and the bootloader starts the operating system.
What is a GUI?
A user interface that enables people to manage tasks on a computer using icons
A user interface that only runs on mobile devices
A user interface that runs only on Linux operating systems
A user interface that allows people to interact with a computer through commands
A user interface that enables people to manage tasks on a computer using icons
A GUI, or graphical user interface, is a user interface that enables people to manage tasks on a computer using icons. Most operating systems can be used with a GUI.
Which of the following can be components of a GUI? Select all that apply.
Desktop icons and shortcuts
Task bar
Hardware
Start menu
Correct
A start menu is a common component of a GUI.
Desktop icons and shortcuts
Task bar
Start menu
Fill in the blank: A security professional uses a(n) _____ to interact with a computer using text-based instructions.
operating system
CLI
GUI
text system
CLI
A security professional uses a CLI, or command-line interface, to interact with a computer using text-based instructions.
A useful feature of a CLI is that it records a history file of commands and actions.
True
False
True
A useful feature of a CLI is that it records a history file of commands and actions. This can help security analysts confirm that they used the correct commands from a playbook. It also might help them trace the actions of an attacker.
Which of the following statements accurately describe operating systems? Select all that apply.
Operating systems are responsible for making computers run efficiently.
Operating systems help people and computers communicate.
Computers have operating systems, but smartphones and tablets do not have them.
Operating systems are a type of computer hardware.
Operating systems are responsible for making computers run efficiently.
Operating systems help people and computers communicate.
Which of the following operating systems were designed to run on desktop and laptop computers? Select two answers.
Windows
Android
iOS
macOS®
Windows
macOS®
What is a bootloader?
A program that starts an operating system
A program that loads the BIOS or UEFI chip
A program that communicates instructions to the user
A program that checks for malware infections on a computer
A program that starts an operating system
Fill in the blank: When someone uses a computer application, the _____ interprets the user’s requests and directs them to the appropriate components of the computer’s hardware.
BIOS
operating system
bootloader
CPU
operating system
What happens when you use applications on your computer? Select three answers.
The hardware sends information back to the operating system, which is sent back to the application.
The application sends your request to the operating system.
The operating system interprets a request from the application and directs it to the appropriate components of the computer’s hardware.
The hardware sends information back to the operating system, which is sent back to the application.
The application sends your request to the operating system.
The operating system interprets a request from the application and directs it to the appropriate components of the computer’s hardware.
Which of the following are key types of user interfaces? Select two answers.
Mobile
Graphical
System
Command line
Graphical
Command line
Which of the following statements correctly describe GUIs and CLIs? Select three answers.
GUI icons help users manage different tasks on a computer.
A CLI performs multiple tasks less efficiently than a GUI.
A CLI is a text-based user interface.
CLI commands execute tasks, such as moving a file to a new folder.
GUI icons help users manage different tasks on a computer.
A CLI is a text-based user interface.
CLI commands execute tasks, such as moving a file to a new folder.
A security team suspects that an attacker has compromised their system. They examine the commands entered by the attacker to determine whether they can trace the attacker’s actions to help them resolve the incident. What does this scenario describe?
Reviewing a history file in a GUI
Repeating a process using icons
Examining the usage of files and applications from a start menu
Reviewing a history file in a CLI
Reviewing a history file in a CLI
To ensure a computer’s capacity is used where it is needed most, what does an operating system manage?
BIOS and UEFI
Viruses and malware
Icons and graphics
Resources and memory
Resources and memory
As a security analyst, you might use Linux to review logs when investigating an issue.
True
False
True
As a security analyst, you might use Linux to review logs when investigating an issue. Another reason you might use Linux is to verify access and authorization.
Which of the following are components of the Linux architecture? Select all that apply.
Applications
The operating system
The shell
The kernel
Applications
The shell
The kernel
Components of the Linux architecture include applications, the shell, and the kernel. The user, the Filesystem Hierarchy Standard (FHS), and hardware are also components of the Linux architecture.
Fill in the blank: The Filesystem Hierarchy Standard (FHS) is the component of Linux architecture that _____.
consists of the physical components of a computer
organizes data
manages processes and memory
enables people to communicate with the system
organizes data
The Filesystem Hierarchy Standard (FHS) is the component of the Linux OS that organizes data.
Which of the following hardware components are peripheral devices? Select all that apply.
a printer
a CPU
RAM
a monitor
a printer
a monitor
Monitors and printers are peripheral devices. Peripheral devices are hardware components that are attached and controlled by the computer system. The CPU and RAM are internal hardware. Internal hardware are the components required to run the computer.
Fill in the blank: Because the _____ is open source, anyone can modify it to build new Linux distributions.
hardware
kernel
shell
application
kernel
Because the kernel is open source, anyone can modify it to build new Linux distributions. The kernel is the component of the Linux OS that manages processes and memory.
What is KALI LINUX ™?
A subscription-based Linux distribution built for enterprise use
A tool with a graphical user interface that can be used to analyze live and captured network traffic
A Debian-derived, open-source distribution of Linux designed for security tasks
A tool used to guess passwords
A Debian-derived, open-source distribution of Linux designed for security tasks
KALI LINUX ™ is a Debian-derived, open-source distribution of Linux designed for security tasks, such as penetration testing and digital forensics.
What is an open-source, user-friendly distribution derived from Debian that is widely used in security and other industries?
Ubuntu
tcpdump
Red Hat
Autopsy
Ubuntu
Ubuntu is an open-source, user-friendly distribution derived from Debian that is widely used in security and other industries. Because of its wide use, Ubuntu has a large number of community resources to support users.
Which of the following are distributions of Linux? Select all that apply.
Pen Test
Parrot
CentOS
Red Hat
Parrot
CentOS
Red Hat
Red Hat, CentOS, and Parrot are all distributions of Linux.
What is the shell?
Information received by the operating system (OS) via the command line
An instruction telling the computer to do something
Data consisting of an ordered sequence of characters
The command-line interpreter
The command-line interpreter
The shell is the command-line interpreter. It processes commands and outputs the results.
After a user inputs a command into the shell, what can the shell return to the user? Select two answers.
Output
A request for more input from the user
An error message
A request for user approval
Output
An error message
After a user inputs a command into the shell, the shell can return output or an error message to the user. Output is the computer’s response to the user’s input. An error message occurs when the shell cannot interpret the input.
What is standard error in Linux?
Information returned by the operating system through the shell
A Linux command that outputs a specified string of text
Error messages returned by the operating system through the shell
Information received by the operating system via the command line
Error messages returned by the operating system through the shell
Standard error contains error messages returned by the OS through the shell.
What is the difference between standard input and standard output?
Standard input is sent to the Filesystem Hierarchy Standard (FHS). Standard output is sent from the FHS.
Standard input is sent to the operating system. Standard output is sent from the operating system.
Standard input is sent from the Filesystem Hierarchy Standard (FHS). Standard output is sent to the FHS.
Standard input is sent from the operating system. Standard output is sent to the operation system.
Standard input is sent to the operating system. Standard output is sent from the operating system.
Fill in the blank: Linux is a(n) _____ operating system.
closed-source
open-source
single-user
command line
open-source
Which of the following components are part of the Linux architecture? Select all that apply.
Applications
The Filesystem Hierarchy Standard (FHS)
The shell
The distribution
Applications
The Filesystem Hierarchy Standard (FHS)
The shell
What are distributions?
Simulated attacks that help identify vulnerabilities
The different versions of Linux
Programs that perform specific tasks
Data consisting of an ordered sequence of characters
The different versions of Linux
What is an example of a Linux distribution that comes pre-installed with many security-related tools?
KALI LINUX ™ (KALI LINUX ™ is a trademark of OffSec.)
Kernel
SUSE
Wireshark
KALI LINUX ™ (KALI LINUX ™ is a trademark of OffSec.)
Which of these are common Linux distributions? Select all that apply.
Red Hat
CentOS
Bash
Parrot
Red Hat
CentOS
Parrot
Fill in the blank: The _____ communicates with the kernel to execute commands.
shell
hardware
interface
Filesystem Hierarchy Standard (FHS)
shell
Fill in the blank: When you communicate with the shell, the commands in the shell can ___. Select all that apply.
give output
take input
take output
give error messages
give output
take input
give error messages
Which of the following is an example of hardware?
CPU
Applications
Kernel
Shell
CPU
When the system doesn’t know how to respond to a command, what is the result?
An error message
A request for additional resources
Standard input
Standard output
An error message
What is a command?
The highest-level directory in Linux
A common shell in many Linux distributions
An instruction that tells a computer to do something
A component of the Linux architecture
An instruction that tells a computer to do something
A command is an instruction that tells a computer to do something.
Which of the following commands prints the working directory to the screen?
head
pwd
cat
ls
pwd
The pwd command prints the working directory to the screen.
What does the cd command do?
Displays the names of files in the current directory
Prints the working directory to the screen
Outputs a specified string of text
Navigates between directories
Navigates between directories
The cd command navigates between directories.
A security professional enters head access.txt into a shell. What are they telling the operating system to do?
Return the content of access.txt one page a time
Display the first 10 lines of access.txt
Add a header to the file named access.txt
Remove the first 5 lines of access.txt
Display the first 10 lines of access.txt
They are telling the operating system to display the first 10 lines of access.txt. The head command displays just the beginning of a file, by default 10 lines.
What is the difference between an absolute file path and a relative file path?
An absolute file path starts from the current directory, and a relative file path starts from the root.
An absolute file path ends with a forward slash (/), and a relative file path ends with a backslash ().
An absolute file path ends with a backslash (), and a relative file path ends with a forward slash (/).
An absolute file path starts from the root, and a relative file path starts from the current directory.
An absolute file path starts from the root, and a relative file path starts from the current directory.
An absolute file path is the full file path that starts from the root, and a relative file path is a shorter file path that starts from the current directory.
What two arguments commonly follow the grep command?
The file to move and the new file location
The file to write to and the string to add to it
The string to search for and the file to search through
The file name to search for and the directory to search through
The string to search for and the file to search through
The grep command is commonly followed by the string to search for and the file to search through. It is used to search files for specified strings.
In Linux, what does the piping command (|) do?
It sends the standard input of one command as standard output to another command for further processing.
It sends the standard output of one command as standard input to another command for further processing.
It searches a specified file and returns all lines in the file containing a specified string.
It moves a file or directory to a new location.
It sends the standard output of one command as standard input to another command for further processing.
The piping command (|) sends the standard output of one command as standard input to another command for further processing.
A security professional enters cp vulnerabilities.txt /home/analyst/projects into the command line. What do they want the operating system to do?
Copy the vulnerabilities.txt file into the projects directory
Create a new file named vulnerabilities.txt in the projects directory
Search for the string vulnerabilities.txt in the projects directory
Remove the vulnerabilities.txt file from the projects directory
Copy the vulnerabilities.txt file into the projects directory
They want the operating system to copy the vulnerabilities.txt file into the projects directory. The original version of the file or directory will also remain in its original location.
What command creates a new file called failed_logins.txt?
mkdir failed_logins.txt
find failed_logins.txt
rm failed_logins.txt
touch failed_logins.txt
touch failed_logins.txt
The command touch failed_logins.txt creates a new file called failed_logins.txt. The touch command is used to create a new file.
What is authorization?
The concept of granting access to specific resources in a system
The concept of granting only the minimal access and authorization required to complete a task or function
The process of a user proving that they are who they say they are in the system
The process of temporarily granting elevated permissions to specific users
The concept of granting access to specific resources in a system
Authorization is the concept of granting access to specific resources in a system.
Which of the following statements correctly describe the file permissions string -rw-rw-rw-? Select two answers.
The file type is a directory.
The group has read permissions.
The user and group have execute permissions.
The user has write permissions.
The group has read permissions.
The user has write permissions.
The 3rd character of the file permissions string -rw-rw-rw- indicates that the user has write permissions, and the 5th character of the file permissions string -rw-rw-rw- indicates that the group has read permissions.
A security professional enters chmod g+w access.txt into the command line. What does this command tell the operating system to do?
Remove write permissions from the user for the access.txt file
Add write permissions to the group for the access.txt file
Add write permissions to the user for the access.txt file
Remove write permissions from the group for the access.txt file
Add write permissions to the group for the access.txt file
The command chmod g+w access.txt tells the operating system to add write permissions to the group.
Which of the following commands typically must be used with sudo? Select three answers.
chown
chmod
userdel
useradd
chown
userdel
useradd
The useradd, userdel, and chown commands must typically be used with sudo. The useradd command adds a user to the system, userdel deletes a user from the system, and chown changes ownership of a file.
A security analyst is updating permissions on a directory named projects. The current permissions are drwxrw-r–. They want to add execute permissions for the group. What do they enter on the command line?
chmod u-x projects
chmod g-x projects
chmod g+x projects
chmod x+x projects
chmod g+x projects
They enter chmod g+x projects. This command adds execute permissions for the group.
Which of the following statements accurately describe Linux’s online global community? Select three answers.
Because Linux is open-source, the community can easily contribute.
The community is focused on collecting feedback from advanced users of Linux.
The community publishes online information to help users learn how to operate Linux.
Linux users can find support from the community for everyday tasks.
Because Linux is open-source, the community can easily contribute.
The community is focused on collecting feedback from advanced users of Linux.
Linux users can find support from the community for everyday tasks.
Linux’s online global community enables users to find support for everyday tasks. Information is published online to help users learn how to operate Linux. In addition, because Linux is open-source, members of the community can easily contribute.
What does the man command do?
Display information on other commands and how they work
Temporarily grants elevated permissions to specific users
Display a description of a command on a single line
Delete a user from the system
Display information on other commands and how they work
The man command displays information on other commands and how they work. For more information about a specific command, enter this other command after man.
What does the whatis command do?
Temporarily grants elevated permissions to specific users
Return the username of the current user
Display a description of a command on a single line
Display information on other commands and how they work
Display a description of a command on a single line
The whatis command displays a description of a command on a single line. It is useful if you do not need the additional details found in the entire man page.
What is an advantage of the apropos command?
Users can search for a command even if they do not know the specific command name.
It can be used to search for descriptions of commands when you know the specific command name.
It incorporates mandatory options for customized searching
It condenses the description of a specific command to one line.
Users can search for a command even if they do not know the specific command name.
Users can use apropos to search for a command even if they do not know the specific command name. The apropos command searches the manual page descriptions for a specified string.
What are the arguments in cp vulnerabilities.txt /home/analyst/projects? Select two answers.
/home
/home/analyst/projects
vulnerabilities.txt
cp
/home/analyst/projects
vulnerabilities.txt
Fill in the blank: The highest-level directory in Linux is called the _____.
home directory
sudo
permissions
root directory
root directory
A security analyst enters grep OS updates.txt into the command line. What does this tell the operating system to do?
Search through the updates.txt file and return all lines containing the string OS
Create a new file named updates.txt in the OS directory
Create a new directory named OS and a new file named updates.txt
Move the updates.txt file to the OS directory
Search through the updates.txt file and return all lines containing the string OS
A security analyst enters touch updates.txt into the command line. What does this tell the operating system to do?
Move the updates.txt file out of their current directory
Open the updates.txt file
Create a new file named updates.txt and move it to the root directory
Create a new file named updates.txt in their current directory
Create a new file named updates.txt in their current directory
Which of the following are types of permissions? Select all that apply.
Read
Execute
Authorize
Write
Read
Execute
Write
A security analyst is updating permissions on the file access.txt. They want to add write permissions for the user and remove read permissions for the group. What do they enter on the command line?
chmod access.txt u+w,g-r
chmod u+rw,g-rw access.txt
chmod u+w,g-r access.txt
chmod u-w,g+r access.txt
chmod u+w,g-r access.txt
What does sudo do?
Deletes users from the system
Temporarily grants elevated permissions to specific users
Changes the owner associated with a particular file
Adds users to the system
Temporarily grants elevated permissions to specific users
What should you specify in the argument following the cd command?
The directory you want to navigate to
The string you want to search for
The file you want to create
Your current directory
The directory you want to navigate to
Which of the following commands searches the manual page descriptions for a specified string?
cp
apropos
pwd
man
apropos
Given the following permissions drw-rw-r–, what does the fourth character represent?
The group has execute permissions for this directory
The group does not have execute permissions for this directory
The user does not have execute permissions for this directory
The user has execute permissions for this directory
The user does not have execute permissions for this directory
Which statement accurately describes the organization of a relational database?
Relational databases consist of a single table containing related information.
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 contain primary keys with at least two duplicate values.
Correct
A relational database is a structured database containing tables that are related to each other through primary and foreign keys.
Relational databases contain tables that are related to each other through primary and foreign keys.
A relational database is a structured database containing tables that are related to each other through primary and foreign keys.
What is SQL used for? Select two answers.
Securing an organization’s systems and networks
Finding data to support security-related decisions and analysis
Creating, interacting with, and requesting information from a database
Allowing users to access a specific machine
Finding data to support security-related decisions and analysis
Creating, interacting with, and requesting information from a database
SQL is a programming language used to create, interact with, and request information from a database. SQL’s filtering can be used to find data to support security-related decisions.
A record of attempts to connect to an organization’s network is one example of a log.
True
False
True
A record of attempts to connect to an organization’s network is one example of a log. Logs are records of events that occur within an organization’s systems.
Fill in the blank: A request for data from a database table or a combination of tables is called a _____.
query
log
key
row
query
A request for data from a database table or a combination of tables is called a query.
What is filtering in SQL?
Removing unnecessary data from the database
Selecting data that match a certain condition
Changing a table to match a condition
Removing invalid records
electing data that match a certain condition
Filtering in SQL is selecting data that match a certain condition. Analysts use filters in SQL to return the data they need.
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.
–???
FROM employees;
SELECT firstname, lastname,phone
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?
SELECT *
FROM log_in_attempts
WHERE country = ‘Canada’;
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’;
The security analyst can use the following query to filter the log_in_attempts table for records where the value in the country column is ‘Canada’:
Which pattern matches with any string that starts with the character ‘A’?
‘A’
‘%A%’
‘A%’
‘%A’
‘A%’
The percentage sign (%) is a wildcard that substitutes for any number of other characters. The pattern ‘A%’ matches with any string that starts with the character ‘A’.
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’, ‘01-04-2015’;
WHERE date BETWEEN ‘01-01-2015’ AND ‘01-04-2015’;
WHERE date > ‘01-01-2015’;
WHERE date < ‘01-04-2015’;
WHERE date BETWEEN ‘01-01-2015’ AND ‘01-04-2015’;
The filter WHERE date BETWEEN ‘01-01-2015’ AND ‘01-04-2015’; outputs all records with values in the date column between ‘01-01-2015’ and ‘01-04-2015’.
Which operator is most efficient at returning all records with a status other than ‘successful’?
AND
NOT
BETWEEN
OR
NOT
NOT is most efficient at returning all records with a status other than ‘successful’. The NOT operator negates a condition. In this case, it can be used in a filter of WHERE NOT status = ‘successful’;.
You are working with the Chinook database. You want to find the first and last names of customers who have a value in the country column of either ‘Brazil’ or ‘Argentina’. Replace –??? with the missing information to complete the query.
SELECT firstname, lastname, country
FROM customers
–???
WHERE country = ‘Brazil’ OR country = ‘Argentina’;
6 customers are from Brazil or Argentina. By replacing –??? with WHERE country = ‘Brazil’ OR country = ‘Argentina’;, you can complete the query and return this result.
While working as an analyst, you encounter a query that includes the following filter:
SELECT *
FROM customers
WHERE country = ‘USA’ AND state = ‘NV’;
What will this query return?
Information about customers who have a value of ‘USA’ in the country column or a value of ‘NV’ in the state column.
Information about customers who do not have a value of ‘USA’ in the country column but do have a value of ‘NV’ in the state column.
Information about customers who do not have a value of ‘USA’ in the country column or do not have a value of ‘NV’ in the state column.
Information about customers who have a value of ‘USA’ in the country column and a value of ‘NV’ in the state column.
Information about customers who have a value of ‘USA’ in the country column and a value of ‘NV’ in the state column.
The query returns information about customers who have a value of ‘USA’ in the country column and a value of ‘NV’ in the state column. The AND operator specifies that both conditions must be met simultaneously.
Which join types return all rows from only one of the tables being joined? Select all that apply.
RIGHT JOIN
INNER JOIN
LEFT JOIN
FULL OUTER JOIN
RIGHT JOIN
LEFT JOIN
LEFT JOIN and RIGHT JOIN return all rows from only one of the tables being joined. LEFT JOIN returns all the records of the first table, but only returns rows of the second table that match on a specified column. RIGHT JOIN returns all of the records of the second table, but only returns rows from the first table that match on a specified column.
You are performing an INNER JOIN on two tables on the employee_id column. The left table is employees, and the right table is machines. Which of the following queries has the correct INNER JOIN syntax?
SELECT *
FROM employees
INNER JOIN machines WHERE employees.employee_id = machines.employee_id;
SELECT *
FROM employees
INNER JOIN ON employees.employee_id = machines.employee_id;
SELECT *
FROM employees
INNER JOIN machines ON employees.employee_id = machines.employee_id;
INNER JOIN machines ON employees.employee_id = machines.employee_id
SELECT *
FROM employees;
SELECT *
FROM employees
INNER JOIN machines ON employees.employee_id = machines.employee_id;
It specifies the left table after FROM, then specifies the right table after INNER JOIN, and then uses the correct syntax after ON when indicating the column to join on.
In the following query, which join returns all records from the employees table, but only records that match on employee_id from the machines table?
SELECT *
FROM employees
_____ machines ON employees.employee_id = machines.employee_id;
LEFT JOIN
INNER JOIN
FULL OUTER JOIN
RIGHT JOIN
Correct
LEFT JOIN returns all records from the employees table, but only records that match on employee_id from the machines table. Because it is located after FROM, the employees table is the left table.
LEFT JOIN
LEFT JOIN returns all records from the employees table, but only records that match on employee_id from the machines table. Because it is located after FROM, the employees table is the left table.
As a security analyst, you are responsible for performing an INNER JOIN on the invoices and invoice_items tables of the Chinook database. These tables can be connected through the invoiceid column. Replace –??? with the missing information to complete the query.
SELECT customerid, trackid
FROM invoices
–???
SELECT customerid, trackid
FROM invoices
INNER JOIN invoice_items ON invoices.invoiceid = invoice_items.invoiceid;
By replacing –??? with INNER JOIN invoice_items ON invoices.invoiceid = invoice_items.invoiceid;, you can complete the query and return this result.
A security analyst queries a database related to security patches. How can SQL help this analyst with their work?
SQL will send out a spreadsheet about the patches.
The analyst can directly install patches from SQL.
SQL will automatically produce a report when the patches have been installed.
The analyst can efficiently find the data they need.
The analyst can efficiently find the data they need.
What is true about the values in the primary key column? Select all that apply.
Each row must have a unique value.
They cannot be null (or empty).
They do not need to be unique.
They should never contain numeric data.
Each row must have a unique value.
They cannot be null (or empty).
Which of these SQL statements queries the employees table? Select all that apply.
SELECT *
FROM employees;
SELECT employees
FROM *;
SELECT employees
FROM employee_id;
SELECT employee_id, device_id
FROM employees
WHERE employee_id > 1100;
SELECT *
FROM employees;
SELECT employee_id, device_id
FROM employees
WHERE employee_id > 1100;
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?
BETWEEN
FULL OUTER JOIN
WHERE
INNER JOIN
INNER JOIN
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.
SELECT
ON
FROM
WHERE
SELECT
FROM
WHERE
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 = ‘Dr._’;
WHERE name = ‘Dr.%’;
WHERE name LIKE ‘Dr.%’;
WHERE name LIKE ‘Dr._’;
WHERE name LIKE ‘Dr.%’;
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 tables, all records from the machines table, and the records from employees that match on device_id
All columns and records from the employees and machines tables
All columns of the employees and machines tables, all records from the employees table, and the records from machines that match on device_id
All columns of the employees and machines tables and the records from employees and machines that match on device_id
All columns of the employees and machines tables, all records from the machines table, and the records from employees that match on device_id
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.
–???
FROM employees;
SELECT employeeid, email
FROM employees;
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.
SELECT customerid, total
FROM invoices
–???
SELECT customerid, total
FROM invoices
WHERE total > 20;
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, company
FROM customers
–???
SELECT firstname, lastname, city, company
FROM customers
WHERE city = ‘Mountain View’ AND company = ‘Google Inc.’;