Chapter 2 Flashcards

0
Q

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

A

True

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

SQL stands for Standard Query Language

A

False

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

SQL is only a data manipulation language (DML)

A

False

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

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

A

True

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

SQL was developed by IBM in the late 70s

A

True

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

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

A

True

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

In addition to being a data sub language, SQL is also a programming language, like java or C#

A

False

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

SQL commands can be embedded in application programs

A

True

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

SQL although very popular has never become a national standard

A

False

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

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

A

True

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

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

A

False

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

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

A

True

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

SQL can only query a single table

A

False

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

SQL statements end with a colon

A

False

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

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

A

False

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

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

A

True

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

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

A

True

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

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

A

True

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

The result of an SQL SELECT operation can contain duplicate rows

A

True

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

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

A

False

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

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

A

True

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

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

A

False

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

SQL is a

A

Data sub language, product of IBM, national standard, combination that includes a data definition language and a data manipulation language

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

When making an SQL query, we are using SQL as a(n)

A

DML

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

In an SQL query, which SQL keyword actually creates the query

A

SELECT

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

In an SQL query, which SQL keyword is used to specify the table(s) to be used?

A

FROM

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

In an SQL query, which SQL keyword must be used to remove duplicate rows from the result table?

A

DISTINCT

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

In an SQL query, which of the follows symbols is used by ANSI SQL to represent all the columns in a single table?

A
  • (asterisk)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

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

A

true

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

sorting is specified by the use of the SORT BY phrase

A

False

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

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

A

False

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

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

A

True

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

A WHERE clause can contain only one condition

A

False

33
Q

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

A

True

34
Q

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

A

False

35
Q

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

A

True

36
Q

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

A

True

37
Q

The SQL keyword LIKE is used in SQL expression to select on partial values

A

True

38
Q

The SQL wildcard character “%” represents a series of one or more unspecified characters

A

True

39
Q

The SQL wildcard character “#” indicates a single, unspecified character in a specific location in a SQL query

A

False

40
Q

The Microsoft Access wildcard character “*” indicated a sequence of one or more unspecified characters in a Microsoft Access SQL query

A

True

41
Q

The Microsoft Access wildcard character “_” indicated a single, unspecified character in a specific location in a Microsoft Access SQL query

A

False

42
Q

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

43
Q

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

IN

44
Q

In an SQL query, which of the following symbols is used by ANSI SQL to represents a single unspecified character?

A

_ (underscore)

45
Q

In an SQL query, which of the following symbols is used by Microsoft Access to represent a single unspecified character?

A

? (question mark)

46
Q

In an SQL query, which SQL keyword is used to sort the result table by the values in one or more columns?

A

ORDER BY

47
Q

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 LIKE ‘S%’;

48
Q

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 Name
WHERE EMPLOYEE LIKE ‘S*’;

49
Q

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

A

True

50
Q

A WHERE clause can contain another SELECT statement enclosed in parentheses.

A

True

51
Q

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

A

True

52
Q

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.

A

True

53
Q

Only two tables can be queried by using a subquery.

A

False

54
Q

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

A

True

55
Q

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

A

True

56
Q

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

A

False

57
Q

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

A

True

58
Q

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.

A

True

59
Q

Every subquery can be alternatively expressed by a join.

A

False

60
Q

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

A

True

61
Q

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

A

True

62
Q

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

A

True

63
Q

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

A

True

64
Q

Outer joins can be either up joins or down joins.

A

False

65
Q

In an SQL query, which built-in function is used to total numeric columns?

A

SUM

66
Q

In an SQL query, which built-in function is used to compute the average value of numeric columns?

A

AVG

67
Q

In an SQL query, which built-in function is used to obtain the largest value of numeric columns?

A

MAX

68
Q

In an SQL query, which built-in function is used to obtain the smallest value of numeric columns?

A

MIN

69
Q

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 and Numeric

70
Q

In an SQL query, which built-in function is used to compute the number of rows in a table?

A

COUNT

71
Q

In an SQL query, the built-in function COUNT works with columns containing data of which of the following data types?

A

Integer, Numeric, Char

72
Q

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

73
Q

In an SQL query, which SQL keyword is used with GROUP BY to select groups meeting specified criteria?

A

HAVING

74
Q

In an SQL query, which SQL keyword is used to implement a subquery?

A

SELECT

75
Q

When one SQL query is embedded in another SQL query, this is referred to as a _____ .

A

subquery

76
Q

When one SQL query is embedded in another SQL query, the second SQL query is embedded in the ____ of the first query.

A

WHERE

77
Q

When one SQL query is embedded in another SQL query, the first SQ query can still contain an SQL _____ clause.

A

ORDER BY and GROUP BY

78
Q

In an SQL query, which SQL keyword is used to specify the names of tables to be joined?

A

FROM

79
Q

In an SQL query, which SQL keyword is used to specify the column names to be used in a join?

A

WHERE

80
Q

Regarding the interchangeability of subqueries and joins,

A

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 (B)

81
Q

In an SQL query of two tables, which SQL keyword indicated 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 and RIGHT JOIN