Chapter Five Flashcards

(40 cards)

1
Q

What are the benefits of a standardized relational language?

A
  • Reduced training costs
  • Productivity
  • Application portability
  • Application longevity
  • Reduced dependence on a single vendor
  • Cross-system communication

None

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

What is the processing order of Boolean operators by default?

A

NOT, then AND, then OR

None

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

What does the SQL SELECT statement do?

A

Used for queries on single or multiple tables

None

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

What are the main clauses of the SELECT statement?

A
  • SELECT: List the columns to be returned
  • FROM: Indicate the table(s) or view(s)
  • WHERE: Indicate conditions for rows
  • GROUP BY: Indicate categorization of results
  • HAVING: Conditions for categories
  • ORDER BY: Sort results according to criteria

None

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

What is an alias in SQL?

A

An alternative column or table name

None

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

Fill in the blank: Comparison operators include =, >, >=, <, <=, <> and _______.

A

!=

None

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

What is the purpose of the GROUP BY clause?

A

To categorize results for use with aggregate functions

None

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

What is the purpose of the HAVING clause?

A

Qualifying results by categories, operates on groups, not individual rows

None

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

What does the MERGE statement do in SQL?

A

Easier to update a table, combines Insert and Update in one statement

None

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

What is the function of the DELETE statement?

A

Removes rows from a table

None

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

What are the major CREATE statements in Data Definition Language (DDL)?

A
  • CREATE SCHEMA
  • CREATE TABLE
  • CREATE VIEW

None

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

What types of data can be defined in SQL?

A
  • Strings: CHARACTER, VARYING CHARACTER
  • Binary: BLOB
  • Number: Numeric, Decimal, Integer
  • Temporal: Timestamp
  • Boolean: True or False

None

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

What is the role of Data Definition Language (DDL)?

A

Commands that define a database, including creating, altering, and dropping tables

None

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

What does the UPDATE statement do?

A

Modifies data in existing rows

None

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

What does the ALTER TABLE statement allow you to do?

A

Change column specifications in a table

None

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

What is the purpose of the DROP TABLE statement?

A

Removes tables from your schema

None

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

What does the INSERT statement do?

A

Adds one or more rows to a table

None

18
Q

What is referential integrity in SQL?

A

Constraint ensuring foreign key values must match primary key values in related tables

None

19
Q

What are the steps in table creation?

A
  • Identify data types for attributes
  • Identify columns that can/cannot be null
  • Identify unique columns
  • Identify primary key–foreign key relationships
  • Determine default values
  • Identify constraints on columns
  • Create the table and associated indexes

None

20
Q

What does the SQL:1999 and SQL:2016 standards refer to?

A

Updates to the SQL standard over the years

None

21
Q

Is SQL a standard certified by NIST?

A

No, it is no longer certified by NIST

None

22
Q

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

23
Q

What will result from the following SQL Select statement?

SELECT MIN(Product_Description)
FROM Product_V;

A

SELECT @ will be displayed.

*The first product description alphabetically in Product_V will be shown. *

An error message will be generated.

The minimum value of Product_Description will be displayed.

24
Q

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

25
One of the original purposes of the SQL standard was to provide a vehicle for portability of database definition and application modules between conforming DBMSs.
True
26
A view may not be updated directly if it contains:
the WHERE clause. * the HAVING clause. * the FROM clause. the SELECT clause
27
What will be returned when the following SQL query is executed? SELECT driver_no, COUNT(*) as num_deliveries FROM deliveries GROUP BY driver_no HAVING COUNT(*) > 2;
A listing of the number of deliveries greater than 2 * A listing of all drivers who made more than 2 deliveries as well as a count of the number of deliveries* A listing of all drivers A listing of all drivers who made more than 2 deliveries
28
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 The Customer_Name of all customers living in Boston, New York or Denver * The Customer_Name and telephone of all customers living in either Boston, New York or Denver * The Customer_Name and telephone of all customers living in Boston and New York and Denver
29
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')
*You must specify the fields to insert if you are only inserting some of the fields. * It would work just fine. There is no table keyword. INSERT INTO should be INSERT to.
30
Indexes are created in most RDBMSs to:
increase the cost of implementation. decrease the amount of disk space utilized. provide a quicker way to store data. * provide rapid random and sequential access to base-table data. *
31
The following INSERT command would work fine: INSERT INTO budget values 121,222,111;
False
32
SQL originated from a project called System-S.
False
33
INSERT INTO is an example of ________ code.
*DML * TIO DDL DCL
34
The ________ is the structure that contains descriptions of objects such as tables and views created by users.
catalog master view SQL * schema *
35
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 * The Item_No and description for all items weighing less than 100 The Item_No for all items weighing between 101 and 199 The Item_No for all items weighing more than 200
36
A database is maintained and queried using the data mapping language (DML).
False
37
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';
False
38
The CREATE SCHEMA DDL command is used to create a table.
False
39
In an SQL statement, which of the following parts states the conditions for row selection?
*WHERE * FROM GROUP BY SELECT
40
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. * The SELECT clause is always processed last. The GROUP BY clause is processed before the WHERE clause. The SELECT clause is always processed first.