Database Processing-Chapter 2

88 terms by oco212 

Create a new folder

Advertisement Upgrade to remove ads

Introduction to Structured Query Language (SQL)

(T or F) 1) SQL stands for Standard Query Language.

FALSE
Diff: 1 Page Ref: 32

(T or F) 2) SQL is only a data manipulation language (DML).

FALSE
Diff: 3 Page Ref: 36

(T or F) 3) SQL was developed by IBM in the late 1970s.

TRUE
Diff: 1 Page Ref: 35

(T or F) 4) In addition to being a data sublanguage, SQL is also a programming language, like Java or C#.

FALSE
Diff: 2 Page Ref: 36

(T or F) 5) SQL commands can be embedded in application programs.

TRUE
Diff: 3 Page Ref: 36

(T or F) 6) SQL, although very popular, has never become a national standard.

FALSE
Diff: 2 Page Ref: 35

(T or F) 7) The SQL keyword FROM is used to specify the table to be used.

TRUE
Diff: 1 Page Ref: 36

(T or F) 8) SQL can only query a single table.

FALSE
Diff: 2 Page Ref: 70

(T or F) 9) SQL statements end with a colon.

FALSE
Diff: 1 Page Ref: 37

(T or F) 10) The columns to be obtained by an SQL command are listed after the FROM keyword.

FALSE
Diff: 2 Page Ref: 36

(T or F) 11) The result of an SQL SELECT operation can contain duplicate rows.

TRUE
Diff: 2 Page Ref: 37

(T or F) 12) To have SQL automatically eliminate duplicate rows from a result, use the keyword DISTINCT with the FROM keyword.

FALSE
Diff: 3 Page Ref: 37

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

TRUE
Diff: 2 Page Ref: 38

(T or F) 14) The WHERE clause contains the condition that specifies which columns are to be selected.

FALSE
Diff: 2 Page Ref: 36, 38

(T or F) 15) The rows of the result table can be sorted by the values in one or more columns.

TRUE
Diff: 1 Page Ref: 53

(T or F) 16) Sorting is specified by the use of the SORT BY phrase.

FALSE
Diff: 2 Page Ref: 53

(T or F) 17) A WHERE clause can contain only one condition.

FALSE
Diff: 1 Page Ref: 55

(T or F) 18) The condition in WHERE clauses can refer to a set of values by using the IN operator.

TRUE
Diff: 2 Page Ref: 55

(T or F) 19) ANSI standard SQL uses the symbol "%" to represent a series of one or more unspecified characters.

TRUE
Diff: 3 Page Ref: 57

(T or F) 20) The built-in function SUM can be used with any column.

FALSE
Diff: 3 Page Ref: 59-62

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

TRUE
Diff: 2 Page Ref: 61-66

(T or F) 22) Arithmetic in SQL statements is limited to the operations provided by the built-in functions.

FALSE
Diff: 1 Page Ref: 62-64

(T or F) 23) The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value in a column.

TRUE
Diff: 1 Page Ref: 64

(T or F) 24) A WHERE clause can contain another SELECT statement enclosed in parenthesis.

TRUE
Diff: 1 Page Ref: 70-71

(T or F) 25) A SELECT statement used in a WHERE clause is called a subquery.

TRUE
Diff: 1 Page Ref: 70-71

(T or F) 26) Only two tables can be queried by using a subquery.

FALSE
Diff: 2 Page Ref: 71

(T or F) 27) An alternative to combining tables by a subquery is to use a join.

TRUE
Diff: 1 Page Ref: 73

(T or F) 28) When people use the term "join" they normally mean an "equijoin."

TRUE
Diff: 2 Page Ref: 75

(T or F) 29) Two or more tables are joined by giving the table names in the FROM clause and specifying the equality of the respective column names as a condition in the WHERE clause.

TRUE
Diff: 3 Page Ref: 75

(T or F) 30) Every subquery can be alternatively expressed by a join.

FALSE
Diff: 2 Page Ref: 76

31) SQL is a(n) ________.
A) data sublanguage
B) product of IBM research
C) national standard
D) combination of a data definition language and a data manipulation language
E) All of the above

E
Diff: 2 Page Ref: 35-36

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

B
Diff: 2 Page Ref: 36

33) In an SQL query, which SQL keyword actually creates the query?
A) EXISTS
B) FROM
C) SELECT
D) SET
E) WHERE

C
Diff: 1 Page Ref: 36

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

B
Diff: 1 Page Ref: 36

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

B
Diff: 3 Page Ref: 37

36) 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)
E) # (pound)

C
Diff: 2 Page Ref: 38

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

E
Diff: 1 Page Ref: 36, 38

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

A
Diff: 1 Page Ref: 55

39) 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) HAVING
D) IN
E) OR

D
Diff: 1 Page Ref: 55-56

40) 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)
E) # (pound)

A
Diff: 3 Page Ref: 57-59

41) 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)
E) # (pound)

B
Diff: 3 Page Ref: 57-59

42) 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
E) WHERE

B
Diff: 2 Page Ref: 53

43) 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%';
E) None of the above.

D
Diff: 3 Page Ref: 55-59

44) 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 Name
WHERE EMPLOYEE LIKE 'S*';
D) SELECT *
FROM EMPLOYEE
WHERE Name LIKE 'S%';
E) None of the above.

C
Diff: 3 Page Ref: 55-59

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

E
Diff: 1 Page Ref: 59-62

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

A
Diff: 2 Page Ref: 59-62

47) 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
E) SUM

C
Diff: 2 Page Ref: 59-62

48) 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
E) SUM

D
Diff: 2 Page Ref: 59-62

49) 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) A and B
E) A, B and C

D
Diff: 3 Page Ref: 59-62

50) 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) MIN
E) MEAN

B
Diff: 1 Page Ref: 59-62

51) In an SQL query, the built-in function COUNT works with columns containing data of which of the following data types?
A) Integer
B) Numeric
C) Char
D) A and B
E) A, B and C

E
Diff: 3 Page Ref: 59-62

52) 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?
A) GROUP BY
B) ORDER BY
C) SELECT
D) SORT BY
E) DISTINCT SET

A
Diff: 1 Page Ref: 64

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

C
Diff: 2 Page Ref: 66-67

54) 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 COUNT(EmpNo)
FROM EMPLOYEE;
D) SELECT HireDate, COUNT(*)
FROM EMPLOYEE
WHERE Salary < 30000;
E) SELECT HireDate, COUNT(*)
FROM EMPLOYEE
GROUP BY HireDate;

D
Diff: 3 Page Ref: 52-67

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

D
Diff: 3 Page Ref: 70-73

58) When one SQL query is embedded in the WHERE clause of another SQL query, this is referred to as a ________.
A) subset
B) join
C) WHERE Query
D) subquery
E) set query

D
Diff: 2 Page Ref: 70-73

59) 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) SELECT
E) WHERE

A
Diff: 1 Page Ref: 73-76

60) 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.
E) a join can never be used as an alternative to a subquery, and a subquery can never be used as an alternative to a join.

B
Diff: 3 Page Ref: 76-77

61) SQL stands for ________.

Structured Query Language
Diff: 1 Page Ref: 32

62) SQL includes a ________ language and a ________ language.

data definition; data manipulation
Diff: 2 Page Ref: 36

63) SQL was developed by ________ in the late 1970s.

IBM
Diff: 2 Page Ref: 35

64) The ________ maintains the standards for SQL.

American National Standards Institute (ANSI)
Diff: 3 Page Ref: 35

65) SQL is not a complete programming language. Rather it is a(n) ________.

data sublanguage
Diff: 2 Page Ref: 36

66) The SQL keyword ________ is used to specify the columns to be listed in the query results.

SELECT
Diff: 2 Page Ref: 36

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

FROM
Diff: 1 Page Ref: 36

68) To remove duplicate rows from the result of a query, specify the SQL qualifier ________.

DISTINCT
Diff: 3 Page Ref: 37

69) To obtain all columns, use a(n) ________ instead of listing all the column names.

asterisk (*)
Diff: 1 Page Ref: 38

70) The SQL ________ clause contains the condition that specifies which rows are to be selected.

WHERE
Diff: 1 Page Ref: 36, 38

71) To sort the rows of the result table, the ________ clause is specified.

ORDER BY
Diff: 2 Page Ref: 53

72) Columns can be sorted in descending sequence by using the SQL keyword ________.

DESC
Diff: 2 Page Ref: 54

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

AND
Diff: 1 Page Ref: 55

74) To refer to a set of values needed for a condition, use the SQL operator ________.

IN
Diff: 3 Page Ref: 55-56

75) To exclude one or more values using a condition, the SQL keyword ________ must be used.

NOT IN
Diff: 3 Page Ref: 55-56

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

parenthesis ( )
Diff: 3 Page Ref: 55-56

77) The SQL keyword ________ is used in SQL expressions to select on partial values.

LIKE
Diff: 2 Page Ref: 57

78) The SQL-92 wildcard ________ indicates a sequence of one or more unspecified characters in an SQL query.

% (percent sign)
Diff: 3 Page Ref: 57-59

79) The Microsoft Access-92 wildcard ________ indicates a sequence of one or more unspecified characters in an SQL query.

*(asterisk)
Diff: 3 Page Ref: 57-59

80) The SQL built-in function ________ totals values in numeric columns.

SUM
Diff: 1 Page Ref: 59-62

81) The SQL built-in function ________ computes the average of values in numeric columns.

AVG
Diff: 1 Page Ref: 59-62

82) The SQL built-in function ________ obtains the largest value in a numeric column.

MAX
Diff: 1 Page Ref: 59-62

83) The SQL built-in function ________ obtains the smallest value in a numeric column.

MIN
Diff: 1 Page Ref: 59-62

84) The SQL built-in function ________ computes the number of rows in a table.

COUNT
Diff: 1 Page Ref: 59-62

85) The SQL keyword ________ is used to collect those rows that have the same value in a specified column.

GROUP BY
Diff: 2 Page Ref: 64

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

subquery
Diff: 2 Page Ref: 70-73

87) The names of tables to be joined are listed in the ________ clause.

FROM
Diff: 1 Page Ref: 73-76

88) A join operation is achieved by specifying the equality of the respective column names as a condition in the ________ clause.

WHERE
Diff: 2 Page Ref: 73-76

89) When most people use the word "join," they are referring to an ________.

equijoin
Diff: 2 Page Ref: 73-76

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

correlated subqueries
Diff: 3 Page Ref: 76-77

Please allow access to your computer’s microphone to use Voice Recording.

Having trouble? Click here for help.

We can’t access your microphone!

Click the icon above to update your browser permissions above and try again

Example:

Reload the page to try again!

Reload

Press Cmd-0 to reset your zoom

Press Ctrl-0 to reset your zoom

It looks like your browser might be zoomed in or out. Your browser needs to be zoomed to a normal size to record audio.

Please upgrade Flash or install Chrome
to use Voice Recording.

For more help, see our troubleshooting page.

Your microphone is muted

For help fixing this issue, see this FAQ.

Star this term

You can study starred terms together

NEW! Voice Recording

Create Set