Chapter 2

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

94) In an SQL query, which SQL keyword is used to implement a subquery? A) GROUP BY B) HAVING C) ORDER BY D) SELECT

D) SELECT

82) In an SQL query, which built-in function is used to total numeric columns? A) AVG B) COUNT C) MAX D) SUM

D) SUM

88) Assuming the "Quantity" column of an ORDER table contains integer data, what does COUNT(Quantity) compute? A) The number of rows in the ORDER table B) The number of non-zero values in the Quantity column C) The number of distinct values in the Quantity column D) The number of non-null values in the Quantity column

D) The number of non-null values in the Quantity column

98) In an SQL query, which SQL keyword is used to specify the names of tables to be joined? A) FROM B) HAVING C) JOIN D) WHERE

D) WHERE

In an SQL query, which SQL keyword is used to state the condition that specifies which rows are to be selected? A) SET B) FROM C) SELECT D) WHERE

D) WHERE

The SQL keyword SELECT is used to specify the columns to be listed in the query results.

True

SQL commands can be embedded in application programs.

True

To sort the rows of the result table, the ORDER BY clause is specified.

True

When SQL statements are executed, the statements transform tables.

True

When people use the term join they normally mean an equijoin.

True

When two conditions must both be true for the rows to be selected, the conditions are separated by the SQL AND keyword.

True

While many subqueries can be alternatively written as joins, correlated subqueries do work that cannot be duplicated as a join.

True

In an SQL query, which SQL keyword is used to link two conditions that both must be true for the rows to be selected? A) AND B) EXISTS C) OR D) IN

A) AND

83) In an SQL query, which built-in function is used to compute the average value of numeric columns? A) AVG B) MEAN C) AVERAGE D) SUM

A) AVG

89) In an SQL query, which SQL keyword is used with built-in functions to group together rows that have the same value in a specified column or columns? A) GROUP BY B) ORDER BY C) SELECT D) SORT BY

A) GROUP BY

95) When one SQL query is embedded in another SQL query, this is referred to as a ________. A) subquery B) join C) WHERE Query D) subset query

A) Subquery

In an SQL query, which of the following symbols is used by ANSI SQL to represent a single unspecified character? A) _ (underscore) B) ? (question mark) C) * (asterisk) D) % (percent)

A) _ (underscore)

SQL is a ________. A) data sublanguage B) data placement source C) data subjective source D) a full-blown programming language

A) data sublanguage

100) Regarding the interchangeability of subqueries and joins, ________. A) a join can always be used as an alternative to a subquery, and a subquery can always be used as an alternative to a join B) a join can sometimes be used as an alternative to a subquery, and a subquery can sometimes be used as an alternative to a join C) a join can always be used as an alternative to a subquery, and a subquery can sometimes be used as an alternative to a join D) a join can sometimes be used as an alternative to a subquery, and a subquery can always be used as an alternative to a join

B)

92) Based on the tables below, which of the following SQL commands would return the average customer balance grouped by SalesRepNo? A) SELECT AVG (Balance) FROM CUSTOMER WHERE SalesRepNo; B) SELECT AVG (Balance) FROM CUSTOMER GROUP BY SalesRepNo; C) SELECT AVG (Balance) FROM CUSTOMER, SALESREP WHERE SALESREP.SalesRepNo = CUSTOMER.SalesRepNo; D) SELECT AVG (Balance) FROM CUSTOMER ORDER BY SalesRepNo;

B)

In an SQL query, which of the following symbols is used by Microsoft Access to represent a single unspecified character? A) _ (underscore) B) ? (question mark) C) * (asterisk) D) % (percent)

B) ? (question mark)

87) In an SQL query, which built-in function is used to compute the number of rows in a table? A) AVG B) COUNT C) MAX D) SUM

B) COUNT

In an SQL query, which SQL keyword must be used to remove duplicate rows from the result table? A) DELETE B) DISTINCT C) UNIQUE D) KEY

B) DISTINCT

When making an SQL query, we are using SQL as a(n) ________. A) DDL B) DML C) embedded language D) SET

B) DML

In an SQL query, which SQL keyword is used to specify the table(s) to be used? A) EXISTS B) FROM C) SELECT D) WHERE

B) FROM

In an SQL query, which SQL keyword is used to sort the result table by the values in one or more columns? A) GROUP BY B) ORDER BY C) SELECT D) SORT BY

B) ORDER BY

An ad-hoc query is ________. A) a question about the data that requires a program to be written B) a question that can be answered from the database using SQL C) a question that can be answered only by combining several SQL queries D) never useful in Business Intelligence scenarios

B) a question that can be answered from the database using SQL

81) Given a table with the structure: EMPLOYEE (EmpNo, Name, Salary, HireDate), which of the following would find all employees whose name begins with the letter "S" using Microsoft Access? A) SELECT * FROM EMPLOYEE WHERE Name IN ['S']; B) SELECT EmpNo FROM EMPLOYEE WHERE Name LIKE 'S'; C) SELECT * FROM EMPLOYEE WHERE Name LIKE 'S*'; D) SELECT * FROM EMPLOYEE WHERE Name LIKE 'S%';

C)

In an SQL query, which of the following symbols is used by ANSI SQL to represent all the columns in a single table? A) _ (underscore) B) ? (question mark) C) * (asterisk) D) % (percent)

C) *(asterisk)

97) When one SQL query is embedded in another SQL query, the top-level SQL query can still contain an SQL ________ clause. A) FROM or SORT BY B) UNIQUE IN C) GROUP BY D) WHERE IN

C) GROUP BY

90) In an SQL query, which SQL keyword is used with GROUP BY to select groups meeting specified criteria? A) AND B) WHERE C) HAVING D) IN

C) HAVING

84) In an SQL query, which built-in function is used to obtain the largest value of numeric columns? A) AVG B) COUNT C) MAX D) MIN

C) MAX

In an SQL query, which SQL keyword begins the query? A) EXISTS B) FROM C) SELECT D) WHERE

C) SELECT

96) When one SQL query is embedded in another SQL query to simulate a join, the second SQL query is embedded in the ________ of the first query. A) SELECT B) FROM C) WHERE D) HAVING

C) WHERE

80) Given a table with the structure: EMPLOYEE (EmpNo, Name, Salary, HireDate), which of the following would find all employees whose name begins with the letter "S" using standard SQL? A) SELECT * FROM EMPLOYEE WHERE Name IN ['S']; B) SELECT EmpNo FROM EMPLOYEE WHERE Name LIKE 'S'; C) SELECT * FROM Name WHERE EMPLOYEE LIKE 'S*'; D) SELECT * FROM EMPLOYEE WHERE Name LIKE 'S%';

D)

91) Given a table with the structure: EMPLOYEE (EmpNo, Name, Salary, HireDate), which of the following is not a valid ANSI SQL command? A) SELECT * FROM EMPLOYEE WHERE Name LIKE 'Ja%'; B) SELECT COUNT(*) FROM EMPLOYEE WHERE Salary < 30000; C) SELECT HireDate, COUNT(*) FROM EMPLOYEE GROUP BY HireDate; D) SELECT HireDate, COUNT(*) FROM EMPLOYEE WHERE Salary < 30000;

D)

93) Based on the tables below, which of the following commands in ANSI SQL would return only the name of the sales representative and the name of the customer for each customer that has a balance greater than 400? A) SELECT * FROM SALESREP, CUSTOMER WHERE Balance > 400; B) SELECT DISTINCT RepName, CustName FROM SALESREP, CUSTOMER WHERE Balance > 400; C) SELECT * FROM SALESREP, CUSTOMER WHERE SALESREP.SalesRepNo = CUSTOMER.SalesRepNo AND Balance > 400; D) SELECT RepName, CustName FROM SALESREP, CUSTOMER WHERE SALESREP.SalesRepNo = CUSTOMER.SalesRepNo AND Balance > 400;

D)

101) In an SQL query of two tables, which SQL keyword indicates that we want data from all the rows of one table to be included in the result, even if the row does not correspond to any data in the other table? A) LEFT JOIN B) RIGHT JOIN C) INCLUDE D) Both A and B are correct

D) Both A and B are correct

86) In an SQL query, the built-in functions SUM and AVG work with columns containing data of which of the following data types? A) Integer B) Numeric C) Char D) Both A and B are correct

D) Both A and B are correct

In an SQL query, which SQL keyword is used to determine if a column value is equal to any one of a set of values? A) AND B) EXISTS C) OR D) IN

D) IN

85) In an SQL query, which built-in function is used to obtain the smallest value of numeric columns? A) AVG B) COUNT C) MAX D) MIN

D) MIN

A database extracted from the operational database for BI purposes typically ________. A) is an exact copy of the operational database B) contains only the metadata from the operational database C) combines all the data from the operational database into one large table D) contains just part of the operational database

D) contains just part of the operational database

A WHERE clause can contain only one condition.

False

An ad-hoc SQL query is typically written within an application program.

False

In addition to being a data sublanguage, SQL is also a programming language, like Java or C#.

False

Outer joins can be either up joins or down joins.

False

SQL can only query a single table.

False

SQL is only a data manipulation language (DML).

False

SQL queries using subqueries still function like a single table query in the sense that columns from both the top-level query and subquery can be displayed in the query results.

False

SQL stands for Standard Query Language.

False

SQL statements end with a colon.

False

SQL, although very popular, has never become a national standard.

False

Sorting is specified using the SORT BY phrase.

False

The INTERSECT of two relations A and B consists of all rows that are in relation B but are not in relation A.

False

The Microsoft Access wildcard character "*" (asterisk) indicates a sequence of one or more unspecified characters in a Microsoft Access SQL query.

False

The Microsoft Access wildcard character "_" (underscore) indicates a single, unspecified character in a specific location in a Microsoft Access SQL query.

False

The SQL built-in function ADDUP totals values in numeric columns

False

The SQL built-in function MOST obtains the largest value in a numeric column.

False

The SQL keyword FROM is used to specify the table to be used.

False

The SQL keyword WHERE is used to specify the table(s) that contain(s) the data to be retrieved.

False

The WHERE clause contains the condition that specifies which columns are to be selected.

False

The built-in function SUM can be used with any column.

False

The columns to be obtained by an SQL command are listed after the FROM keyword.

False

The wildcard character "#" indicates a single, unspecified character.

False

To exclude one or more values using a condition, the OUT keyword must be used.

False

To have SQL automatically eliminate duplicate rows from a result, use the keyword DISTINCT with the FROM keyword.

False

Two or more tables are joined by giving the table names in the WHERE clause and specifying the equality of the respective column names as a condition in the GROUP BY clause.

False

When using the COUNT function, the result is the count of all rows including those that are NULL.

False

The SQL wildcard character "%" represents a series of one or more unspecified characters.

True

The UNION of two relations A and B consists of all rows that are either in relation A or in relation B or both.

True

The WHERE clause contains the condition that specifies which rows are to be selected

True

The clause SELECT COUNT (*) results in a table with a single row and a single column.

True

The condition in WHERE clauses can refer to a set of values by using the IN operator.

True

The names of tables to be joined in an SQL query are listed in the FROM clause.

True

The result of an SELECT operation can contain duplicate rows.

True

The rows of the result table can be sorted by the values in one or more columns.

True

To obtain all columns, use an asterisk (*) wildcard character instead of listing all the column names.

True

To refer to a set of values in a condition, the values are placed inside parentheses () and separated by commas.

True

To refer to a set of values needed for a condition, use the IN operator.

True

To remove duplicate rows from the result of a query, specify the DISTINCT keyword.

True

A SELECT statement used in a WHERE clause is called a subquery.

True

A nested SELECT statement, one that appears within the WHERE clause of another SQL statement, is called a subquery and must be enclosed in parentheses.

True

An alternative to combining tables by a subquery is to use a join.

True

An asterisk (*) following the SELECT verb means that all columns are to be displayed.

True

Business Intelligence (BI) systems typically store their data in data warehouses.

True

Columns can be sorted in descending sequence by using the DESC keyword.

True

In an SQL query, a join operation is achieved by specifying the equality of the respective column names as a condition in the WHERE clause.

True

Joins that show only matching rows from the joined tables in their results are called inner joins.

True

Joins that show the matching rows from the joined tables, plus unmatched rows from one other table in their results, are called outer joins.

True

SQL includes a data definition language, a data manipulation language, and SQL/Persistent stored modules.

True

SQL is not a complete programming language. Rather it is a data sublanguage.

True

SQL was developed by IBM in the late 1970s.

True

The American National Standards Institute (ANSI) maintains the standards for SQL.

True

The JOIN operator is used to combine two or more tables by concatenating (sticking together) the rows of one table with the rows of another table.

True

The SQL built-in function AVG computes the average of values in numeric columns

True

The SQL built-in function COUNT computes the number of rows in a query.

True

The SQL built-in function MIN obtains the smallest value in a numeric column.

True

The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value in a column.

True

The SQL keyword LIKE is used in SQL expressions to select partial string values.

True

The SQL syntax JOIN . . . ON can be used as an alternate way of writing an SQL join statement.

True


संबंधित स्टडी सेट्स

Gene regulation in eukaryotes: transcriptional regulation

View Set

chapter 6 violations of a license law penalties and procedures

View Set

Systems Analysis and Design - Sprint 1

View Set

C213 - Accounting for Decision Makers 10+

View Set

Maryland Real Estate (Law) Chapter 2 - Brokerage

View Set

Adult Health - Respiratory - Silvestri

View Set

Module 11: Databases & Analytics

View Set

BIBL 104-Quiz: The Old Testament Books of Prophecy

View Set