Chapter 5 (Final) Flashcards

1
Q

The DROP command deletes rows from a table individually or in groups.

A

False

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

If multiple Boolean operators are used in an SQL statement, NOT is evaluated first, then AND, then OR.

A

True

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

What will be returned when the following SQL statement is executed?

SELECT driver_no,count(*) as num_deliveries
FROM deliveries
GROUP BY driver_no;

A

A listing of each driver as well as the number of deliveries that he or she has made

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

Which of the following finds all groups meeting stated conditions?

A

HAVING

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

To eliminate duplicate rows in a query, the ________ qualifier is used in the SQL Select command.

A

DISTINCT

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

Given a table named store with 5 fields: store_id, address, city, state, zipcode, why would the following insert command not work?

INSERT INTO store values (‘234 Park Street’)

A

You must specify the fields to insert if you are only inserting some of the fields.

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

What does the following SQL statement do?

SELECT * From Customer WHERE Cust_Type = “Best”

A

Selects all the fields from the Customer table for each row with a customer labeled “Best”

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

Expressions are mathematical manipulations of data in a table that may be included as part of the SELECT statement.

A

True

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

The FROM clause is the first statement processed in an SQL command.

A

True

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

Adding the DISTINCT keyword to a query eliminates duplicates.

A

True

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

The main concept of relational databases was published in 1970 by:

A

E.F.Codd.

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

The DELETE TABLE DDL command is used to remove a table from the database.

A

False

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

The views are created by executing a CREATE VIEW SQL command.

A

True

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

Applications can be moved from one machine to another when each machine uses SQL.

A

True

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

SQL originated from a project called System-S.

A

False

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

The SQL command used to populate tables is the INSERT command.

A

True

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

In an SQL statement, which of the following parts states the conditions for row selection?

A

WHERE

18
Q

The following query totals sales in state= ‘MA’ for each salesperson.

SELECT salesperson_id, sum(sales)
FROM salesperson
GROUP BY salesperson_id
HAVING state = ‘MA’;

A

False

19
Q

The WHERE clause is always processed before the GROUP BY clause when both occur in a SELECT statement.

A

True

20
Q

Which of the following counts ONLY rows that contain a value?

A

COUNT

21
Q

Relational databases are heavily based on the mathematical concept of:

A

set theory

22
Q

Which of the following is a purpose of the SQL standard?

A

To specify syntax and semantics of SQL data definition and manipulation languages

23
Q

A catalog is the structure that contains object descriptions created by a user.

A

False

24
Q

Implementation of a standard can never stifle creativity and innovation.

A

False

25
Q

SQL originated from a project called System-S.

A

False

26
Q

A single value returned from an SQL query that includes an aggregate function is called a(n):

A

scalar aggregate.

27
Q

An INSERT command does not need to have the fields listed.

A

True

28
Q

When creating a table, it is not important to consider foreign key–primary key mates.

A

False

29
Q

What does the following SQL statement do?

ALTER TABLE Customer_T
ADD (Type Varchar (2));

A

Alters the Customer_T table by adding a field called “Type”

30
Q

What result set is returned from the following query?

SELECT Customer_Name, telephone
FROM customers
WHERE city in (‘Boston’,’New York’,’Denver’);

A

The Customer_Name and telephone of all customers living in either Boston, New York or Denver

31
Q

What result set will the following query return?

SELECT Item_No, description
FROM item
WHERE weight > 100 and weight < 200;

A

The Item_No and description for all items weighing between 101 and 199

32
Q

Which of the following is true of the order in which SQL statements are evaluated?

A

The SELECT clause is processed before the ORDER BY clause.

33
Q

The following two SQL statements will produce different results.

SELECT last_name, first_name
FROM customer
WHERE state = ‘MA’ OR state = ‘NY’ OR state = ‘NJ’ OR state = ‘NH’ OR state = ‘CT’;

SELECT last_name, first_name
FROM customer
WHERE state in (‘MA’,’NY’,’NJ’,’NH’,’CT’);

A

False

34
Q

INSERT INTO is an example of ________ code.

A

DML

35
Q

Indexes are created in most RDBMSs to:

A

provide rapid random and sequential access to base-table data.

36
Q

________ is a set of commands used to update and query a database.

A

DML

37
Q

The following INSERT command would work fine:

INSERT INTO budget values 121,222,111;

A

False

38
Q

A database table is defined using the data definition language (DDL).

A

True

39
Q

A referential integrity constraint specifies that the existence of an attribute in one table depends upon the existence of a foreign key in the same or another table.

A

False

40
Q

If multiple Boolean operators are used in an SQL statement, NOT is evaluated first, then AND, then OR.

A

True