Chapter 07: Introduction to Structured Query Language (SQL)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/69

flashcard set

Earn XP

Description and Tags

ch07

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

70 Terms

1
New cards

A database language enables the user to perform complex queries designed to transform the raw data into useful information.

TRUE

2
New cards

SQL is considered difficult to learn; its command set has a vocabulary of more than 300 words.

FALSE

3
New cards

The ANSI SQL standards are also accepted by the ISO.

TRUE

4
New cards

The COMMIT command does not permanently save all changes. In order to do that, you must use SAVE.

FALSE

5
New cards

All SQL commands must be issued on a single line.

FALSE

6
New cards

Although SQL commands can be grouped together on a single line, complex command sequences are best shown on separate lines, with space between the SQL command and the command's components.

TRUE

7
New cards

An alias cannot be used when a table is required to be joined to itself in a recursive query.

FALSE

8
New cards

Oracle users can use the Access QBE (query by example) query generator.

FALSE

9
New cards

You can select partial table contents by naming the desired fields and by placing restrictions on the rows to be included in the output.

TRUE

10
New cards

Comparison operators cannot be used to place restrictions on character-based attributes.

FALSE

11
New cards

String comparisons are made from left to right.

TRUE

12
New cards

Date procedures are often more software-specific than other SQL procedures.

TRUE

13
New cards

SQL allows the use of logical restrictions on its inquiries such as OR, AND, and NOT.

TRUE

14
New cards

You cannot insert a row containing a null attribute value using SQL.

FALSE

15
New cards

ANSI-standard SQL allows the use of special operators in conjunction with the WHERE clause.

TRUE

16
New cards

The conditional LIKE must be used in conjunction with wildcard characters.

TRUE

17
New cards

Most SQL implementations yield case-insensitive searches.

FALSE

18
New cards

Some RDBMSs, such as Microsoft Access, automatically make the necessary conversions to eliminate case sensitivity.

TRUE

19
New cards

The COUNT function is designed to tally the number of non-null 'values' of an attribute, and is often used in conjunction with the DISTINCT clause.

TRUE

20
New cards

Numeric functions take one numeric parameter and return one value.

TRUE

21
New cards

The SQL data manipulation command HAVING:

restricts the selection of grouped rows based on a condition

22
New cards

The SQL command that allows a user to permanently save data changes is _.

COMMIT

23
New cards

The _ command defines a default value for a column when no value is given.

DEFAULT

24
New cards

The _ command restricts the selection of grouped rows based on a condition.

HAVING

25
New cards

A(n) _ query specifies which data should be retrieved and how it should be filtered, aggregated, and displayed.

SELECT

26
New cards

A(n) _ is an alternate name given to a column or table in any SQL statement.

alias

27
New cards

According to the rules of precedence, which of the following computations should be completed first?

Operations within parentheses

28
New cards

Which query is used to list a unique value for V_CODE, where the list will produce only a list of those values that are different from one another?

SELECT DISTINCT V_CODE FROM PRODUCT;

29
New cards

When using a(n) _ join, only rows from the tables that match on a common value are returned.

inner

30
New cards

A(n) _ join will select only the rows with matching values in the common attribute(s).

natural

31
New cards

If a designer wishes to create an inner join, but the two tables do not have a commonly named attribute, he can use a(n) _ clause.

JOIN ON

32
New cards

A(n) _ join returns not only the rows matching the join condition (that is, rows with matching values in the common columns) but also the rows with unmatched values.

outer

33
New cards

The syntax for a left outer join is _.

SELECT column-list FROM table1 LEFT [OUTER] JOIN table2 ON join-condition

34
New cards

A(n) _ join performs a relational product (also known as the Cartesian product) of two tables.

cross

35
New cards

How many rows would be returned from a cross join of tables A and B, if A contains 8 rows and B contains 18?

144

36
New cards

Which comparison operator indicates a value is not equal?

<>

37
New cards

What type of command does this SQL statement use? SELECT PCODE, PDESCRIPT, PPRICEVNAME FROM PRODUCT, VENDOR WHERE PRODUCT.VCODE=VENDOR. V_CODE

old-style' join

38
New cards

The special operator used to check whether an attribute value is within a range of values is _.

BETWEEN

39
New cards

The special operator used to check whether an attribute value matches a given string pattern is _.

LIKE

40
New cards

The SQL aggregate function that gives the number of rows containing non-null values for a given column is _.

COUNT

41
New cards

A(n) _ is a query that is embedded (or nested) inside another query.

subquery

42
New cards

In subquery terminology, the first query in the SQL statement is known as the _ query.

outer

43
New cards

The special operator used to check whether a subquery returns any rows is _.

EXISTS

44
New cards

Which is a feature of a correlated subquery?

The outer subquery initiates the process of execution in a subquery

45
New cards

The _ function returns the current system date in MS Access.

DATE()

46
New cards

When using the Oracle TODATE function, the code represents a three-letter month name.

MON

47
New cards

_ is a string function that returns the number of characters in a string value.

LENGTH

48
New cards

The Oracle _ function compares an attribute or expression with a series of values and returns an associated value or a default value if no match is found.

DECODE

49
New cards

In Oracle, the _ function converts a date to a character string.

TO_CHAR()

50
New cards

_ is a relational set operator.

EXCEPT

51
New cards

The basic SQL vocabulary has fewer than _words.

100

52
New cards

The _ specification is used to avoid having duplicated values in a column.

UNIQUE

53
New cards

In the SQL environment, the word _ covers both questions and actions.

query

54
New cards

A(n) _ character is a symbol that can be used as a general substitute for other characters or commands.

wildcard

55
New cards

The _ condition is generally composed of an equality comparison between the foreign key and the primary key of related tables.

join

56
New cards

A(n) _ order sequence is a multilevel ordered sequence that can be created easily by listing several attributes, separated by commas, after the ORDER BY clause.

cascading

57
New cards

An alias is especially useful when a table must be joined to itself in a(n) _ query.

recursive

58
New cards

The _ command, coupled with appropriate search conditions, is an incredibly powerful tool that enables a user to transform data into information.

SELECT

59
New cards

A specialty field in mathematics, known as _ algebra, is dedicated to the use of logical operators.

Boolean

60
New cards

In SQL, all _ expressions evaluate to true or false.

conditional

61
New cards

Rows can be grouped into smaller collections quickly and easily using the _ clause within the SELECT statement.

GROUP BY

62
New cards

The _ clause of the GROUP BY statement operates very much like the WHERE clause in the SELECT statement.

HAVING

63
New cards

A(n) _, also known as a nested query or an inner query, is a query that is embedded (or nested) inside another query.

subquery

64
New cards

DATE() and SYSDATE are special functions that return today's date in MS Access and _, respectively.

Oracle

65
New cards

_ functions allow you to take a value of a given data type and convert it to the equivalent value in another data type.

Conversion

66
New cards

_' means that the names of the relation attributes must be the same and their data types must be alike.

Union-compatible

67
New cards

The _ statement in SQL combines rows from two queries and returns only the rows that appear in the first set but not in the second.

EXCEPT

68
New cards

The _ operator could be used in place of INTERSECT if the DBMS does not support it.

IN

69
New cards

The _ operator could be used in place of EXCEPT (MINUS) if the DBMS does not support it.

NOT IN

70
New cards

The syntax of the EXCEPT statement in Oracle is _.

query EXCEPT query