Docsity

SQL Operators, Functions, and Clauses, Exams of Nursing

Toggle sidebar
bg1
D427 Data management applications -
Chapter 2
IN - correct answer ✔This operator is used in a WHERE clause to determine
if a value matches one of several values.
BETWEEN (value BETWEEN minValue AND maxValue)
<= value => - correct answer ✔This operator provides an alternative way to
determine if a value is between two other values.
LIKE
% matches any number of characters
_ matches exactly one character - correct answer ✔Used in a WHERE
clause, matches text against a pattern using the two wildcard characters %
and _
BINARY - correct answer ✔The LIKE operator performs case-insensitive
pattern matching by default case or case-sensitive pattern matching if
followed by this keyword.
DISTINCT - correct answer ✔Used with the SELECT statement to return
only unique values.
ORDER BY - correct answer ✔Orders selected rows by one or more
columns in ascending order.
DESC - correct answer ✔Use this with the ORDER BY clause to order rows
in descending order.
pf3
pf4
pf5

Partial preview of the text

Download SQL Operators, Functions, and Clauses and more Exams Nursing in PDF only on Docsity!

D427 Data management applications -

Chapter 2

IN - correct answer ✔This operator is used in a WHERE clause to determine if a value matches one of several values. BETWEEN (value BETWEEN minValue AND maxValue) <= value => - correct answer ✔This operator provides an alternative way to determine if a value is between two other values. LIKE % matches any number of characters _ matches exactly one character - correct answer ✔Used in a WHERE clause, matches text against a pattern using the two wildcard characters % and _ BINARY - correct answer ✔The LIKE operator performs case-insensitive pattern matching by default case or case-sensitive pattern matching if followed by this keyword. DISTINCT - correct answer ✔Used with the SELECT statement to return only unique values. ORDER BY - correct answer ✔Orders selected rows by one or more columns in ascending order. DESC - correct answer ✔Use this with the ORDER BY clause to order rows in descending order.

Function - correct answer ✔This operates on an expression enclosed in parentheses, or an argument. Argument - correct answer ✔An expression enclosed in parenthesis that returns a value. Aggregate Function COUNT(): Counts the number of rows in the set. MIN() MAX() SUM() AVG() - correct answer ✔Processes values from a set of rows and returns a summary value. The GROUP BY clause consists of the GROUP BY keyword and one or more columns. - correct answer ✔What does the GROUP BY clause consist of? HAVING GROUP BY CountryCode HAVING SUM(Population) > 69420 - correct answer ✔This clause is used with the GROUP BY clause to filter group results. Join The tables are combined by comparing columns left and right, usually with the = operator. SELECT DepartmentName, EmployeeName FROM Department, Employee

Equijoin - correct answer ✔Compares columns of two tables with the = operator. Most joins are this. non-equijoin - correct answer ✔Compares columns with an operator other than =, such as < and >. Self-join - correct answer ✔Joins a table to itself. CROSS JOIN - correct answer ✔Combines two tables without comparing columns. Subquery (nested query, inner query) - correct answer ✔A query within another SQL query. Correlated - correct answer ✔A subquery is ______ when the subquery's WHERE clause references a column from the outer query. Alias - correct answer ✔A temporary name assigned to a column or table. EXISTS - correct answer ✔Returns TRUE if a subquery selects at least one row, and FALSE if no rows are selected. NOT EXISTS - correct answer ✔Returns true if a subquery selects no rows, and FALSE if at least one row is selected. Flattening - correct answer ✔Replacing a subquery with an equivalent join. View Table; View Query - correct answer ✔A ____________ is a table name associated with a SELECT statement, called the _____________.

CREATE VIEW - correct answer ✔Creates a view table and specifies the view name, query, and optionally, column names. Base Table - correct answer ✔A table specified in the view query's FROM clause. Materialized View - correct answer ✔A view for which data is stored at all times. Whenever a base table changes, the corresponding view tables also change. Protect sensitive data; Save complex queries; Save optimized queries - correct answer ✔Some advantages of view tables are: Primary Keys - If a primary key does not appear in a view, an insert to the view generates a NULL Aggregate values - may not be allowed Join views - It might delete primary or foreign keys. May not be allowed. - correct answer ✔Issues with view tables. WITH CHECK OPTION - correct answer ✔The database rejects inserts and updates that do not satisfy the view query WHERE clause.