0% found this document useful (0 votes)
90 views10 pages

DSR301m (FPTU - AI) Flashcards - Quizlet

The document contains a series of questions and answers related to R programming and data analysis concepts. It covers topics such as predictive analysis, data types, R functions, and data manipulation techniques. The content appears to be a study guide or quiz for students learning R and data science.

Uploaded by

nhutnqse181753
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views10 pages

DSR301m (FPTU - AI) Flashcards - Quizlet

The document contains a series of questions and answers related to R programming and data analysis concepts. It covers topics such as predictive analysis, data types, R functions, and data manipulation techniques. The content appears to be a study guide or quiz for students learning R and data science.

Uploaded by

nhutnqse181753
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

DSR301m (FPTU_AI)

9 studiers in 3 days 5.0 (13 reviews)

Save

Students also studied

DWP301c Coursera DSR301m IAM302 - SP2021 NWC Part 1

50 terms 32 terms Teacher 50 terms 70 terms 50 terms

XBeee03 Preview quizlette27982134 Preview Kishonkelo Preview nguyenxuanhieu7 Preview nam_quachhong

 

Terms in this set (247)

Which of the following are examples of predictive analysis? Pandemic trends prediction.
Select two answers. Understanding human languages.
A: Dashboards.
B: Pandemic trends prediction.
C: Returning a summary of descriptive statistics for data.
D: Understanding human languages.

Which of the following statements about numeric and integer The converted value of an integer to a numeric is always equal to the original integer value.
values are true? Select three values. A numeric value can be converted to an integer.
A: The converted value of a numeric to an integer is always An integer can be converted to a numeric value.
equal to the original numeric value.
B: The converted value of an integer to a numeric is always
equal to the original integer value.
C: A numeric value can be converted to an integer.
D: An integer can be converted to a numeric value.

What is the result of the R expression 4 + 3 * 25? 79


A: 79
B: 103
C: 74
D: 175

Which R function saves a workspace to a .RData file? save.image()


A: save.data()
B: save.workspace()
C: save.image()
D: save.file()

In RStudio, which of the following statements about writing You write code in the Console when you want to try out R commands or to run a few lines of code.
code in the File Editor and the Console are true? Select two You write code, usually for multiple lines of code, in the File Editor and execute them in batch mode.
answers.
A: Only files containing R code can be edited in the File Editor
B: You write code in the Console when you want to try out R
commands or to run a few lines of code.
C: You write code, usually for multiple lines of code, in the File
Editor and execute them in batch mode.
D: Code in the File Editor executes immediately as you type it so
you can see the results quickly.

Complete the statement: A Jupyter Notebook is made up of a Cells


series of _______________ that you can use to write, run, and interact
with your code.
A: Workspaces
B: Objects
C: Cells
D: Files

R can perform several forms of statistical computation. What is Testing if the mean values of two groups are statistically different.
an example of hypothesis testing?
A: Inferring an unknown mean value of a population from its
samples.
B: Compute and visualize a correlation matrix among four
different variables to see if they are correlated.
C: Obtaining a representative subset of data.
D: Testing if the mean values of two groups are statistically
different.

Which of the following data type conversions may be not character (like `1`, `A`, or `test`) to numeric
allowed in R?
A: logical (like TRUE or FALSE) to numeric
B: integer (like 1L or 2L) to numeric
C: character (like `1`, `A`, or `test`) to numeric
D: numeric (like 1 or 2) to integer
What is the result of the R expression 100 * (5 - 3)? 200
A: 200
B: 497
C: 500
D: 503

After you write code in an R script file or the R Console, what R Interpreter
component of the R environment parses the code into objects in
memory?
A: R data files
B: R variables, functions, and datasets
C: R Workspace
D: R Interpreter

Which features of RStudio help facilitate code writing? Select Code auto completion
two answers. Syntax highlighting
A: Code auto completion
B: File Explorer
C: Syntax highlighting
D: Workspace visualization

True or False: Execution order does not matter when executing False
cells in a Jupyter notebook
A: True
B: False

What is the difference between the expression c(1, 2, 3, 4, 5) and They both produce a vector with five numbers but the first is in ascending order and the second is in descending order.
the expression c(5:1)?
A: The two expressions produce the same result.
B: They both produce a vector with five numbers but the first is
in ascending order and the second is in descending order.
C: They both produce a factor with five numbers but the first is in
ascending order and the second is in descending order.
D: One produces a factor and the other produces a vector.

Assume that the variable test_result contains the vector c(25, 35, [1] 25 35 40
40, 50, 75). What is the result of the expression
test_result[test_result < 50]?
A: [1] 25 35 40
B: [1] TRUE TRUE TRUE FALSE FALSE
C: [1] TRUE TRUE TRUE TRUE FALSE
D: [1] 25 35 40 50

What is the main difference between a list and a vector? A list can contain different types of data, while a vector may only contain one type of data.
A: A list is a multi-dimensional array of values, while a vector is a
single dimensional array of values.
B: It is not possible to add or remove items from a list, but you
can do this with a vector.
C: A list can contain different types of data, while a vector may
only contain one type of data.
D: A list can contain nominal or ordinal values, while a vector
cannot.

What are three types of data you can store in an array or matrix? Numeric valus
Select three answers. Strings
A: Numeric valus Integers
B: Strings
C: Vectors
D: Integers

In a data frame, each column is represented by a _________________ of Vector


values of the same data type.
A: Vector
B: Variable
C: List
D: Matrix

What is a nominal factor? A factor with no implied order.


A: A factor with any type or number of elements.
B: A factor with no implied order.
C: A factor with ordering.
D: A factor that contains numeric data.

Assume that the variable test_result contains the vector c(25, 35, 45
40, 50, 75).What is the result of the expression mean(test_result)?
A: 45
B: 40
C: 50
D: 35

Assume you have variable called employee that contains the employee["age"] <- 35
expression list(name = "Juan", age = 30). What is the correct
command to change the contents of the age item to 35?
A: employee["age"] <- 35
B: employee[age] = 35
C: employee[age] <- 35
D: employee["age"] == 35
What is the main difference between a matrix and an array? A matrix must be two dimensional, but an array can be single, two dimensional, or more than two dimensional.
A: A matrix must be two dimensional, but an array can be single,
two dimensional, or more than two dimensional.
B: A matrix can contain multiple types of data, but an array can
only contain data of the same type.
C: A matrix can contain vectors, but an array can only contain
strings, characters, or integers.
D: A matrix can be arranged by rows or columns, but an array is
always arranged by columns.

Assume that you have a data frame called employee that employee$title
contains three variables: name, age, and title. If you want to
return all the values in the title variable, what command should
you use?
A: employee$title
B: employee.title
C: employee[[3]]
D: employee[title]

Which looping statement should you use if you want to continue While loop
to perform an operation if the value of an expression is true?
A: Do While loop
B: For Each loop
C: For loop
D: While loop

What happens if a user-defined function is missing the return The function returns the last evaluated expression in the function.
statement?
A: The function returns an error.
B: The function returns the last evaluated expression in the
function.
C: The function returns a NULL value.
D: The function returns the first evaluated expression it
encounters and then immediately exits the function.

Assume you have a variable called word_string that contains the chartr()
string "The quick red fox jumped over the lazy dog." Which
function can you use to replace the word "dog" with the word
"cat" in the word_string variable?
A: strsplit()
B: substr()
C: nchar()
D: chartr()

Which of the following statements about regular expressions are Regular expressions are primarily used for data extraction.
true? Select two answers. Regular expressions are used to match patterns in strings and text.
A: Regular expressions are primarily used for data extraction.
B: Regular expressions evaluate a condition to determine if it is
true or false.
C: Regular expressions perform mathematical operations on
numeric values.
D: Regular expressions are used to match patterns in strings and
text.

How do you convert a UNIX date/time format to an R Date Pass the UNIX date/time value to the as.POSIXct() function and then pass that value to the as.Date() function.
object?
A: Pass the UNIX date/time value to the as.POSIXct() function
and then pass that value to the as.Date() function.
B: Pass the UNIX date/time value to the is.Date() function.
C: Pass the UNIX date/time value to the as.Date() function.
D: Pass the UNIX date/time value to the as.POSIXct() function
and then pass that value to the is.Date() function.

What type of statement should you add to your code if you A tryCatch statement.
know that an error or warning might occur?
A: A tryError statement.
B: Incorrect distractor
C: A tryCatch statement.
D: A catchError statement.

What is the result of the conditional statement 25 > 15 | 99 >= TRUE


100?
A: TRUE
B: FALSE

How do you define a global variable in a function? Use the <<- assignment operator.
A: Use the -> assignment operator.
B: Use the <- assignment operator.
C: Use the <<- assignment operator.
D: Use the == assignment operator.

You can use the str_sub() function to form a substring by stringr


counting back from the last position. This function is part of
which package?
A: stringr
B: tidyr
C: purrr
D: readr
Assume you have a data frame that contains a string variable A regular expression.
called 'phone'. The phone numbers in this variable appear in
(###) ###-#### or ###-###-#### format. Which feature of R can
you use to isolate the area code (the three numbers between
the parentheses or the first three numbers)?
A: A regular expression.
B: A mathematical operation.
C: It is not possible to do this using R.
D: A string operation.

When you convert a date in string format to a Date object, what The string containing the date.
information do you need to pass to the as.Date() function? The date format of the string.
Select two answers.
A: The string containing the date.
B: The UNIX format of the string.
C: The number of days since January 1, 1970.
D: The date format of the string.

What is the difference between an error and a warning in you R An error halts code execution, while a warning does not.
code?
A: An error halts code execution, while a warning does not.
B: A warning halts code execution, while an error does not.
C: You can catch a warning, but you cannot catch an error.
D: You can catch an error, but you cannot catch a warning.

Which package do you need to install before reading an Excel readxl


file in R?
A: readExcel
B: readxlsx
C: readxl
D: No package is needed. This functionality is built into R.

What is the purpose of the readLines() function? Reads each text line (ending with a line break) in a text file and returns a character vector.
A: Reads each text line (with a line break) in a text file and
returns a data frame.
B: Reads each text line (with a line break) in a text file and
returns a character variable.
C: Reads each text line (ending with a line break) in a text file
and returns a character vector.
D: Reads each text line (ending with a line break) in a text file
and returns a character factor.

Which data structure is more suitable to be exported into a text String or characters
file rather than a .csv or Excel file?
A: String or characters
B: Matrices
C: Data frames
D: Datasets

Complete the sentence: _________________ is a communication HTTP


protocol for fetching web resources for clients from servers on
the Internet.
A: HTTP
B: REST
C: TCP
D: DNS

Complete the sentence: In an HTML page, if the <head> and Sibling nodes
<body> nodes have the same parent, <html>, they are said to be
___________________ to each other.
A: Sibling nodes
B: Nested nodes
C: Root nodes
D: Child nodes

Assume you have read a .csv file into a data frame variable employee[5, c("name", "title")]
called employee. It has 20 rows of data and three variables:
name, age, and title. What is the correct statement to use to
return the fifth row of data in the name and title columns?
A: employee[c("name", "title"), 5]
B: employee[5, c("name", "title")]
C: employee[5, 2:3]
D: employee[2:3, 1:5]

How do you return the number of characters in each paragraph Use the nchar() function.
of a text file that has been read into a character vector?
A: Use the file.size() function.
B: Use the length() function.
C: Use the nchar() function.
D: Use the scan() function.

Which package do you need to install before writing to an Excel xlsx


file in R?
A: No package is needed. This functionality is built into R.
B: writexl
C: xlsx
D: writexlsx
You want to get a resource by its URL using an HTTP request response <- GET("https://www.mysite.com")
and assign the HTTP response containing status code, headers,
response body to a response variable. Which function should
you use?
A: response <-PUT("https://www.mysite.com")
B: response <- GET("https://www.mysite.com")
C: response <-POST("https://www.mysite.com")
D: response <-HEAD("https://www.mysite.com")

After reading an HTML page from a URL, what must you do to Use the html_node() function to return the <body> as a child node of <html> node.
get the <body> node from the root <html> node?
A: Use the html_text() function to return the <html> node.
B: Use the html_text() function to return the <body> node of the
HTML.
C: Use the html_node() function to return the <body> as a child
node of <html> node.
D: Use the html_node() function to return the <html> node.

Which of the following is a typical way that developers use the R Predictive analysis
language?
A: Systems programming
B: Web page interactivity
C: Video game development
D: Predictive analysis

In R, what is the result of the function as.numeric(TRUE)? 1


A: 4
B: 1
C: FALSE
D: NA

One movie is 150 minutes long, and another is 90 minutes long. (150 - 90) \* 60
Using R, which of the following commands would correctly
calculate the difference in length, in seconds, between the two
films?
A: 150 - (90 \* 60)
B: (150 - 90 \*60)
C: (150 - 90) \* 60
D: 150 - 90 \* 60

Which command in R would return the following numeric c(5:1)


vector?
54321
A: c(5-\>1)
B: c(1,2,3,4,5)
C: c(5:1)
D: c(1:5)

In R, assume you have a vector named "age," and each element sort(age)
in the vector is the age of one person in a group. Which
command must you use to reorder the ages from youngest to
oldest?
A: rank(age)
B: order(age)
C: call(age)
D: sort(age)

Assume the array books_array contains 6 elements. The array has "It" "Misery" "The Shining"
three rows and two columns and appears as follows:
[,1] [,2] [1,] "It" "Dr. Sleep" [2,] "Misery" "Carrie" [3,] "The Shining"
"The Mist"
If you input the books_array[,1] command, what will be the
output?
A: "It" "Misery" "The Shining"
B: "The Shining"
C: "It" "Dr.Sleep"
D: "It"

In R, which command should you use to insert a new row into a rbind
data frame?
A: rbind
B: tail
C: integrate
D: head

Assume that the function add is defined as follows: 5


add <- function(x,y) { (x + y) return (x - y) temp <<- (x * y) return (x
/ y) }
What will be the output if you issue the command add(10,5)?
A: 15
B: 2
C: 5
D: 50

What is the first step you must take before you can read an Install the readxl library.
Excel spreadsheet in R?
A: Run the c function.
B: Install the readxl library.
C: Run the read_excel function.
D: Convert the spreadsheet's dataset.
After installing and calling the httr library in R, which command GET("https://www.google.com/")
can you use to request information about
https://www.google.com?
A: PUT("https://www.google.com/")
B: BROWSE("https://www.google.com/")
C: GET("https://www.google.com/")
D: PATCH("https://www.google.com/")

Which of the following statements are correct about databases? All of the above
A: There are different types of databases - Relational,
Hierarchical, No SQL, etc.
B: A database is a repository of data
C: All of the above
D: A database can be populated with data and be queried

True or False: A SELECT statement is used to retrieve data from a True


table.
A: True
B: False

You are working on a Film database, with a FilmLocations table. A WHERE clause to limit the results to films released in 2019.
You want to retrieve a list of films that were released in 2019.You
run the following query but find that all the films in the
FilmLocations table are listed.
SELECT Title,ReleaseYear, Locations FROMFilmLocations;
What is missing?
A: Nothing, the query is correct.
B: A WHERE clause to limit the results to films released in 2019.
C: A LIMIT clause to limit the results to films released in 2019.
D: A DINSTINCT clause to specify a distinct year.

Which of the following statements would you use to add a new INSERT INTO Instructor(ins_id, lastname, firstname, city, country)
instructor to the Instructor table. VALUES(4, 'Doe', 'John', 'Sydney', 'AU');
A: SELECT Instructor(ins_id, lastname, firstname, city, country)
FROM VALUES(4, 'Doe', 'John', 'Sydney', 'AU');
B: INSERT INTO Instructor(ins_id, lastname, firstname, city,
country)
VALUES(4, 'Doe', 'John', 'Sydney', 'AU');
C: ADD INTO Instructor(ins_id, lastname, firstname, city, country)
VALUES(4, 'Doe', 'John', 'Sydney', 'AU');
D: UPDATE Instructor(ins_id, lastname, firstname, city, country)
WITH VALUES(4, 'Doe', 'John', 'Sydney', 'AU');

What is the function of a WHERE clause in an UPDATE A WHERE clause enables you to specify which rows will be updated.
statement?
A: A WHERE clause enables you to specify a new table to
receive the updates.
B: A WHERE clause is never used with an UPDATE statement.
C: A WHERE clause enables you to specify which rows will be
updated.
D: A WHERE clause enables you to list the column and data to
be updated.

True or False: The SELECT statement is called a query, and the True
output we get from executing the query is called a result set.
A: True
B: False

True or False: The INSERT statement can be used to insert True


multiple rows in a single statement.
A: True
B: False

Assume there exists an INSTRUCTOR table with several columns LEON


including FIRSTNAME, LASTNAME, etc. Which of the following is PAUL
the most likely result set for the following query: JOE
SELECT DISTINCT(FIRSTNAME) FROM INSTRUCTOR
A: LEON
LEON
PAUL
PAUL
B: LEON
PAUL
JOE
C: LEON
PAUL
LEON
JOE
D: LEON KATSNELSON
PAUL ZIKOPOLOUS
JOE SANTARCANGELO
What does the following SQL statement do? Changes all rows for the instructor with a last name of Smith to have a last name of Brewster.
UPDATE INSTRUCTOR SET LASTNAME = 'Brewster' WHERE
LASTNAME = 'Smith'
A: Changes all rows for the instructor with a last name of Smith
to have a last name of Brewster.
B: Change the row for the instructor with a last name of Brewster
to have a last name of Smith.
C: Change all rows in the table to have a last name of Smith.
D: Change all rows in the table to have a last name of Brewster.

Which of the following SQL statements will delete the authors DELETE FROM AUTHOR WHERE AUTHOR_ID IN ('A10', 'A11')
with IDs of A10 and A11?
A: DELETE FROM AUTHOR WHERE AUTHOR_ID IS ('A10', 'A11')
B: DELETE FROM AUTHOR WHERE AUTHOR_ID IN ('A10', 'A11')
C: DELETE ('A10', 'A11') FROM AUTHOR
D: D: DELETE AUTHOR_ID IS ('A10', 'A11') FROM AUTHOR

What is the function of a primary key? The primary key uniquely identifies each row in a table.
A: The primary key is used to identify any rows in the table that
contain NULL values.
B: The primary key is used to grant access to a table.
C: The primary key enables you to add data to columns.
D: The primary key uniquely identifies each row in a table.

True or False: Data Manipulation Language statements like True


INSERT, SELECT, UPDATE, and DELETE are used to read and
modify data.
A: True
B: False

Data Definition Language (or DDL) statements are used to CREATE, ALTER, DROP
define, change, or delete database objects such as tables.
Which of the following statements are all DDL statements?
A: SELECT, INSERT, UPDATE
B: CREATE, ALTER, DROP
C: INSERT and UPDATE
D: SELECT and DELETE

Which of the following queries will change the data type of an ALTER TABLE author ALTER COLUMN phone SET DATA TYPE VARCHAR(20);
existing column (phone) to the varchar data type?
A: ALTER TABLE author ALTER COLUMN phone SET DATA TYPE
VARCHAR(20);
B: ALTER TABLE author ALTER COLUMN phone DATA TYPE =
VARCHAR(20);
C: ALTER COLUMN phone SET DATA TYPE VARCHAR(20);
D: ALTER TABLE author ALTER COLUMN phone SET TYPE
VARCHAR(20);

The five basic SQL commands are: CREATE, SELECT, INSERT, UPDATE, DELETE
A: CREATE, INSERT, RETRIEVE, MODIFY, DELETE
B: None of the above
C: SELECT, COPY, PASTE, INSERT, ALTER
D: CREATE, SELECT, INSERT, UPDATE, DELETE

The primary key of a relational table uniquely identifies each row


_______ in a table.
A: row
B: column
C: relation
D: attribute

Which of the following statements about a database is/are A database is a logically coherent collection of data with some inherent meaning
correct?
A: A database is a logically coherent collection of data with
some inherent meaning
B: Data can only be added and queried from a database, but not
modified.
C: Only SQL can be used to query data in a database.
D: All of the above

Attributes of an entity become ________ in a table. columns


A: rows
B: columns
C: constraints
D: keys

What are the basic categories of the SQL language based on Both of the above
functionality?
A: Data Definition Language
B: Data Manipulation Language
C: Both of the above
D: None of the above

The CREATE TABLE statement is a.... DDL statement


A: DML statement
B: DDL statement
C: Both of the above
You want to retrieve a list of employees in alphabetical order of SELECT * FROM Employees ORDER BY Lastname;
Lastname from the Employees table. Which SQL statement
should you use?
A: SELECT * FROM Employees GROUP BY Lastname;
B: SELECT * FROM Employees ORDER BY Lastname DESC;
C: SELECT * FROM Employees ORDER BY Lastname;
D: SELECT * FROM Employees SORT BY Lastname;

Which keyword is used to set a condition for a GROUP BY HAVING


clause?
A: HAVING
B: SELECT
C: ORDER BY
D: WHERE

You want to retrieve a list of authors from Australia, Canada, and SELECT * FROM Author WHERE Country IN ('Australia', 'Canada', 'India');
India from the table Authors. Which SQL statement is correct?
A: SELECT * FROM Author WHERE Country LIST ('CA', 'IN');
B: SELECT * FROM Author IF Country ('Australia', 'Canada',
'India');
C: SELECT * FROM Author WHERE Country BETWEEN('Australia',
'Canada', 'India');
D: SELECT * FROM Author WHERE Country IN ('Australia',
'Canada', 'India');

You want to retrieve a list of books priced above $10 and below SELECT Title, Price FROM Book WHERE Price BETWEEN 10 and 25;
$25 from the table Book. What are the two ways you can specify SELECT Title, Price FROM Book WHERE Price >= 10 and Price <= 25;
the range?
A: SELECT Title, Price FROM Book WHERE Price BETWEEN 10
and 25;
B: SELECT Title, Price FROM Book WHERE Price 10 to 25;
C: SELECT Title, Price FROM Book WHERE Price IN (10, 25);
D: SELECT Title, Price FROM Book WHERE Price >= 10 and Price
<= 25;

You want to retrieve Salary information for an employee called WHERE Firstname = 'Ed';
Ed from the Employee table. You write the following statement:
SELECT Firstname, Lastname, Salary FROM Employees
You see all the employees listed, and it's hard to find Ed's
information. Which clause should you add to reduce the number
of rows returned?
A: ORDER BY Firstname;
B: GROUP BY Firstname = 'Ed';
C: WHERE Firstname = 'Ed';
D: WHERE Employees = 'Ed';

You want to select author's last name from a table, but you only SELECT lastname from author where lastname like 'B%'
remember the author's last name starts with the letter B, which
string pattern can you use?
A: SELECT lastname from author where lastname like 'B#'
B: SELECT lastname from author where lastname like 'B%'
C: SELECT lastname from author where lastname like 'B$'
D: None of the above

In a SELECT statement, which SQL clause controls how the result ORDER BY clause
set is displayed?
A: ORDER BY clause
B: ORDER IN clause
C: ORDER WITH clause

Which of the following can be used in a SELECT statement to All of the above
restrict a result set?
A: HAVING
B: WHERE
C: DISTINCT
D: All of the above

When querying a table called Author that contains a list of SELECT Country, count(Country) FROM Author GROUP BY Country
authors and their country of residence, which of the following
queries will return the number of authors from each country?
A: SELECT Country, count(Country) FROM Author GROUP BY
Country
B: SELECT Distinct(Country) FROM Author
C: SELECT Country, count(Country) FROM Author
D: SELECT Country, distinct(Country) FROM Author GROUP BY
Country

You want to retrieve a list of books that have between 450 and WHERE Pages >= 450 and pages <= 600
600 pages. Which clause would you add to the following SQL
statement:

SELECT Title, Pages FROM Book ________________________________


A: IF Pages >= 450 and Pages <= 600
B: WHERE Pages = 450
C: WHERE Pages 450 - 600
D: WHERE Pages >= 450 and pages <= 600
Which of the following statements about built-in database Built-in database functions reduce the amount of data that is retrieved.
functions is correct?
A: Built-in database functions may increase network bandwidth
consumed.
B: Built-in database functions must be called from a
programming language like Python.
C: Built-in database functions may increase processing time.
D: Built-in database functions reduce the amount of data that is
retrieved.

Which of the following SQL queries would return the day of the SELECT DAYOFWEEK(RescueDate) From PetRescue WHERE Animal = 'Dog';
week each dog was rescued?
A: SELECT DAYOFWEEK(RescueDate) From PetRescue WHERE
Animal = 'Dog';
B: SELECT DAYOFWEEK(RescueDate) From PetRescue;
C: SELECT RescueDate From PetRescue WHERE Animal = 'Dog';
D: SELECT DAY(RescueDate) From PetRescue WHERE Animal =
'Dog';

Which of the following queries will return the employees who SELECT * FROM Employees WHERE Salary < (SELECT AVG(Salary) FROM Employees);
earn less than the average salary?
A: SELECT * FROM Employees WHERE Salary < (SELECT
AVG(Salary))
B: SELECT AVG(Salary) FROM Employees WHERE Salary <
AVG(Salary)
C: SELECT * FROM Employees WHERE Salary < AVG(Salary)
D: SELECT * FROM Employees WHERE Salary < (SELECT
AVG(Salary) FROM Employees);

What are the three ways to work with multiple tables in the same Sub-queries, Implicit joins, JOIN operators
query?
A: Built-in functions, implicit joins, JOIN operators
B: Sub-queries, Implicit joins, normalization.
C: Sub-queries, APPEND, JOIN operators
D: Sub-queries, Implicit joins, JOIN operators

Which of the following will retrieve the LOWEST value of SELECT MIN(SALARY) FROM EMPLOYEES
SALARY in a table called EMPLOYEES?
A: SELECT MAX(SALARY) FROM EMPLOYEES
B: SELECT LOWEST(SALARY) FROM EMPLOYER
C: SELECT SALARY FROM EMPLOYEES WHERE
MINIMUM(SALARY) = SALARY
D: SELECT MIN(SALARY) FROM EMPLOYEES

Which of the following queries will return the first name of the SELECT FIRST_NAME FROM EMPLOYEES WHERE SALARY =
employee who earns the highest salary? ( SELECT MAX(SALARY) FROM EMPLOYEES )
A: SELECT FIRST_NAME FROM EMPLOYEES WHERE SALARY IS
HIGHEST
B: SELECT FIRST_NAME, MAX(SALARY) FROM EMPLOYEES
GROUP BY F_NAME
C: SELECT MAX(SALARY) FROM EMPLOYEES
D: SELECT FIRST_NAME FROM EMPLOYEES WHERE SALARY =
( SELECT MAX(SALARY) FROM EMPLOYEES )

Which of the following queries will return the data for SELECT * FROM EMPLOYEES WHERE DEP_ID =
employees who belong to the department with the highest ( SELECT MAX(DEPT_ID_DEP) FROM DEPARTMENTS )
value of department ID.
A: SELECT * FROM EMPLOYEES WHERE DEP_ID =
( SELECT DEPT_ID_DEP FROM DEPARTMENTS WHERE
DEPT_ID_DEP IS MAX )
B: SELECT * FROM EMPLOYEES WHERE DEP_ID = MAX(DEP_ID)
C: SELECT * FROM EMPLOYEES WHERE DEPT_ID_DEP =
MAX ( SELECT DEPT_ID_DEP FROM DEPARTMENTS )
D: SELECT * FROM EMPLOYEES WHERE DEP_ID =
( SELECT MAX(DEPT_ID_DEP) FROM DEPARTMENTS )

A DEPARTMENTS table contains DEP_NAME, and DEPT_ID_DEP SELECT D.F_NAME, E.DEP_NAME FROM EMPLOYEES E, DEPARTMENTS D WHERE DEPT_ID_DEP = DEP_ID
columns and an EMPLOYEES table contains columns called
F_NAME and DEP_ID. We want to retrieve the Department Name
for each Employee. Which of the following queries will correctly
accomplish this?
A: SELECT E.F_NAME, D.DEP_NAME FROM EMPLOYEES,
DEPARTMENTS
B: SELECT F_NAME, DEP_NAME FROM EMPLOYEES E,
DEPARTMENTS D WHERE E.DEPT_ID_DEP = D.DEP_ID
C: SELECT D.F_NAME, E.DEP_NAME FROM EMPLOYEES E,
DEPARTMENTS D WHERE DEPT_ID_DEP = DEP_ID
D: SELECT F_NAME, DEP_NAME FROM EMPLOYEES,
DEPARTMENTS WHERE DEPT_ID_DEP = DEP_ID
You are writing a query that will give you the total cost to the SELECT SUM(Cost) AS Total_Cost FROM PetRescue
Pet Rescue organization of rescuing animals. The cost of each
rescue is stored in the Cost column. You want the result column
to be called "Total_Cost". Which of the following SQL queries is
correct?
A: SELECT SUM(Cost) FROM PetRescue
B: SELECT SUM(Cost) AS Total_Cost FROM PetRescue
C: SELECT SUM(Total_Cost) From PetRescue
D: SELECT Total_Cost FROM PetRescue

How can a relational database help R handle memory issues? Running SQL queries in a relational database reduces memory demands in the R client.
A: Using a relational database increases memory use in R.
B: Using a relational database with R has no impact on memory.
C: Running SQL queries in a relational database reduces
memory demands in the R client.
D: Loading all the data from the relational database into a
dataframe reduces memory demands.

Which R function saves a single data structure to a .Rda file? saveRDS()


A: save.image()
B: save()
C: saveRDS()
D: readRDS()

A dataframe in R is like which of the following relational Table


database concept?
A: Schema
B: Table
C: Database
D: Column

When mapping data types between R and a database, you Date


should consider converting which of the following to strings?
A: Logical
B: Date
C: Double
D: Factor

When designing a database and making decisions, which Lack of security


potential issue is not helped by normalization?
A: Performance issues
B: Lack of security
C: Data redundancy
D: Transaction processing problems

Which amongst the following is the simplest way to update Store the data in a relational database instead and make the updates there.
individual observations in a dataframe?
A: Convert the dataframe into a text file and make the changes
there.
B: There is no way to update individual observations directly in a
dataframe.
C: Store the data in a relational database instead and make the
updates there.
D: Make the updates in the dataframe and then store the results
in a binary format.

Which R function loads multiple R data structures from a .Rda load()


file?
A: save.image()
B: save()
C: load()
D: readRDS()

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy