(4) Tools of the Trade: Linux and SQL Flashcards

1
Q

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

A

The interface between the computer hardware and the user

An operating system is the interface between computer hardware and the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following are operating systems? Select all that apply.

Windows

Android

Linux

Smartphones

A

Windows

Android

Linux

Android, Linux, and Windows are operating systems. Operating systems are interfaces between computer hardware and the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Computers communicate in a language called binary, which consists of 0s and 1s.

True

False

A

True

Computers communicate in a language called binary, which consists of 0s and 1s.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Fill in the blank: In order to carry out tasks on a computer, users directly interact with _____.

task managers

applications

the CPU

the BIOS

A

applications

Users interact with applications in order to carry out tasks on a computer. Applications are programs that perform a specific task.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The management of a computer’s resources and memory is handled by an application.

True

False

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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.

A

Desktop icons and shortcuts

Task bar

Start menu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

CLI

A security professional uses a CLI, or command-line interface, to interact with a computer using text-based instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A useful feature of a CLI is that it records a history file of commands and actions.

True

False

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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.

A

Operating systems are responsible for making computers run efficiently.

Operating systems help people and computers communicate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following operating systems were designed to run on desktop and laptop computers? Select two answers.

Windows

Android

iOS

macOS®

A

Windows

macOS®

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A program that starts an operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which of the following are key types of user interfaces? Select two answers.

Mobile

Graphical

System

Command line

A

Graphical

Command line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

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.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

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

A

Reviewing a history file in a CLI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

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

A

Resources and memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

As a security analyst, you might use Linux to review logs when investigating an issue.

True

False

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which of the following are components of the Linux architecture? Select all that apply.

Applications

The operating system

The shell

The kernel

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

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

A

organizes data

The Filesystem Hierarchy Standard (FHS) is the component of the Linux OS that organizes data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Which of the following hardware components are peripheral devices? Select all that apply.

a printer

a CPU

RAM

a monitor

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Fill in the blank: Because the _____ is open source, anyone can modify it to build new Linux distributions.

hardware

kernel

shell

application

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

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

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Which of the following are distributions of Linux? Select all that apply.

Pen Test

Parrot

CentOS

Red Hat

A

Parrot

CentOS

Red Hat

Red Hat, CentOS, and Parrot are all distributions of Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

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

A

The command-line interpreter

The shell is the command-line interpreter. It processes commands and outputs the results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

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

A

Error messages returned by the operating system through the shell

Standard error contains error messages returned by the OS through the shell.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

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.

A

Standard input is sent to the operating system. Standard output is sent from the operating system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Fill in the blank: Linux is a(n) _____ operating system.

closed-source

open-source

single-user

command line

A

open-source

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

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

A

Applications

The Filesystem Hierarchy Standard (FHS)

The shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

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

A

The different versions of Linux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

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

A

KALI LINUX ™ (KALI LINUX ™ is a trademark of OffSec.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Which of these are common Linux distributions? Select all that apply.

Red Hat

CentOS

Bash

Parrot

A

Red Hat

CentOS

Parrot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Fill in the blank: The _____ communicates with the kernel to execute commands.

shell

hardware

interface

Filesystem Hierarchy Standard (FHS)

A

shell

40
Q

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

A

give output

take input

give error messages

41
Q

Which of the following is an example of hardware?

CPU

Applications

Kernel

Shell

A

CPU

42
Q

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

A

An error message

43
Q

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

A

An instruction that tells a computer to do something

A command is an instruction that tells a computer to do something.

44
Q

Which of the following commands prints the working directory to the screen?

head

pwd

cat

ls

A

pwd

The pwd command prints the working directory to the screen.

45
Q

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

A

Navigates between directories

The cd command navigates between directories.

46
Q

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

A

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.

47
Q

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.

A

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.

48
Q

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

A

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.

49
Q

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.

A

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.

50
Q

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

A

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.

51
Q

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

A

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.

52
Q

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

A

The concept of granting access to specific resources in a system

Authorization is the concept of granting access to specific resources in a system.

53
Q

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.

A

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.

54
Q

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

A

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.

55
Q

Which of the following commands typically must be used with sudo? Select three answers.

chown

chmod

userdel

useradd

A

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.

56
Q

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

A

chmod g+x projects

They enter chmod g+x projects. This command adds execute permissions for the group.

57
Q

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.

A

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.

58
Q

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

A

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.

59
Q

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

A

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.

60
Q

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.

A

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.

61
Q

What are the arguments in cp vulnerabilities.txt /home/analyst/projects? Select two answers.

/home

/home/analyst/projects

vulnerabilities.txt

cp

A

/home/analyst/projects

vulnerabilities.txt

62
Q

Fill in the blank: The highest-level directory in Linux is called the _____.

home directory

sudo

permissions

root directory

A

root directory

63
Q

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

A

Search through the updates.txt file and return all lines containing the string OS

64
Q

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

A

Create a new file named updates.txt in their current directory

65
Q

Which of the following are types of permissions? Select all that apply.

Read

Execute

Authorize

Write

A

Read

Execute

Write

66
Q

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

A

chmod u+w,g-r access.txt

67
Q

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

A

Temporarily grants elevated permissions to specific users

68
Q

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

A

The directory you want to navigate to

69
Q

Which of the following commands searches the manual page descriptions for a specified string?

cp

apropos

pwd

man

A

apropos

70
Q

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

A

The user does not have execute permissions for this directory

71
Q

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.

A

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.

72
Q

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

A

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.

73
Q

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

True

False

A

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.

74
Q

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

query

log

key

row

A

query

A request for data from a database table or a combination of tables is called a query.

75
Q

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

A

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.

76
Q

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;

A

SELECT firstname, lastname,phone

77
Q

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;

A

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’:

78
Q

Which pattern matches with any string that starts with the character ‘A’?

‘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’.

79
Q

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’;

A

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’.

80
Q

Which operator is most efficient at returning all records with a status other than ‘successful’?

AND

NOT

BETWEEN

OR

A

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’;.

81
Q

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
–???

A

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.

82
Q

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.

A

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.

83
Q

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

A

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.

84
Q

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;

A

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.

85
Q

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.

A

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.

86
Q

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
–???

A

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.

87
Q

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.

A

The analyst can efficiently find the data they need.

88
Q

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.

A

Each row must have a unique value.

They cannot be null (or empty).

89
Q

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;

A

SELECT *
FROM employees;

SELECT employee_id, device_id
FROM employees
WHERE employee_id > 1100;

90
Q

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

A

INNER JOIN

91
Q

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

A

SELECT

FROM

WHERE

92
Q

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._’;

A

WHERE name LIKE ‘Dr.%’;

93
Q

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

A

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

94
Q

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;

A

SELECT employeeid, email
FROM employees;

95
Q

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
–???

A

SELECT customerid, total
FROM invoices
WHERE total > 20;

96
Q

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
–???

A

SELECT firstname, lastname, city, company
FROM customers
WHERE city = ‘Mountain View’ AND company = ‘Google Inc.’;