Chapter 5 (Final) Flashcards

(40 cards)

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?

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’;

19
Q

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

20
Q

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

21
Q

Relational databases are heavily based on the mathematical concept of:

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.

24
Q

Implementation of a standard can never stifle creativity and innovation.

25
SQL originated from a project called System-S.
False
26
A single value returned from an SQL query that includes an aggregate function is called a(n):
scalar aggregate.
27
An INSERT command does not need to have the fields listed.
True
28
When creating a table, it is not important to consider foreign key–primary key mates.
False
29
What does the following SQL statement do? ALTER TABLE Customer_T ADD (Type Varchar (2));
Alters the Customer_T table by adding a field called "Type"
30
What result set is returned from the following query? SELECT Customer_Name, telephone FROM customers WHERE city in ('Boston','New York','Denver');
The Customer_Name and telephone of all customers living in either Boston, New York or Denver
31
What result set will the following query return? SELECT Item_No, description FROM item WHERE weight > 100 and weight < 200;
The Item_No and description for all items weighing between 101 and 199
32
Which of the following is true of the order in which SQL statements are evaluated?
The SELECT clause is processed before the ORDER BY clause.
33
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');
False
34
INSERT INTO is an example of ________ code.
DML
35
Indexes are created in most RDBMSs to:
provide rapid random and sequential access to base-table data.
36
________ is a set of commands used to update and query a database.
DML
37
The following INSERT command would work fine: INSERT INTO budget values 121,222,111;
False
38
A database table is defined using the data definition language (DDL).
True
39
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.
False
40
If multiple Boolean operators are used in an SQL statement, NOT is evaluated first, then AND, then OR.
True