MODERN DATABASE MANAGEMENT 12TH EDITION BY HOFFER – TEST BANK A+

$35.00
MODERN DATABASE MANAGEMENT 12TH EDITION BY HOFFER – TEST BANK A+

MODERN DATABASE MANAGEMENT 12TH EDITION BY HOFFER – TEST BANK A+

$35.00
MODERN DATABASE MANAGEMENT 12TH EDITION BY HOFFER – TEST BANK A+

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

  1. A) To specify syntax and semantics of SQL data definition and manipulation
  2. B) To specify minimal and complete standards, which permit different degrees of adoption in products
  3. C) To define the data structures and basic operations for SQL databases
  4. D) All of the above

Answer: D

Diff: 2 Page Ref: 245

Topic: Origins of the SQL Standard

AACSB: Use of Information Technology

2) The benefits of a standardized relational language include:

  1. A) application longevity.
  2. B) reduced training costs.
  3. C) cross-system communication.
  4. D) all of the above.

Answer: D

Diff: 2 Page Ref: 245-246

Topic: Origins of the SQL Standard

AACSB: Use of Information Technology

3) The ________ is the structure that contains descriptions of objects such as tables and views created by users.

  1. A) SQL
  2. B) schema
  3. C) catalog
  4. D) master view

Answer: B

Diff: 1 Page Ref: 247

Topic: The SQL Environment

AACSB: Analytic Skills, Use of Information Technology

4) ________ is a set of commands used to control a database, which includes security.

  1. A) DML
  2. B) DDL
  3. C) DCL
  4. D) DPL

Answer: C

Diff: 1 Page Ref: 248

Topic: The SQL Environment

AACSB: Use of Information Technology

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

  1. A) DML
  2. B) DDL
  3. C) DCL
  4. D) DPL

Answer: A

Diff: 1 Page Ref: 248

Topic: The SQL Environment

AACSB: Use of Information Technology

6) DDL is typically used during which phases of the development process?

  1. A) Implementation
  2. B) Physical design
  3. C) Analysis
  4. D) All of the above

Answer: B

Diff: 3 Page Ref: 251

Topic: The SQL Environment

AACSB: Analytic Skills, Use of Information Technology

7) The command for creating a database is:

  1. A) create table.
  2. B) create view.
  3. C) create schema.
  4. D) create authorization.

Answer: C

Diff: 2 Page Ref: 251

Topic: Defining a Database in SQL

AACSB: Use of Information Technology

8) The SQL command ________ defines a logical table from one or more tables or views.

  1. A) create table
  2. B) alter table
  3. C) create view
  4. D) create relationship

Answer: C

Diff: 1 Page Ref: 252

Topic: Defining a Database in SQL

AACSB: Use of Information Technology

Subtopic: Generating SQL Database Definitions

9) Any create command may be reversed by using a ________ command.

  1. A) truncate
  2. B) drop
  3. C) delete
  4. D) unpack

Answer: B

Diff: 1 Page Ref: 252

Topic: Defining a Database in SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Generating SQL Database Definitions

10) The first in a series of steps to follow when creating a table is to:

  1. A) identify columns that must be unique.
  2. B) identify each attribute and its characteristics.
  3. C) create an index.
  4. D) identify columns that must be null.

Answer: B

Diff: 2 Page Ref: 252, 253

Topic: Defining a Database in SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Creating Tables

11) The SQL command ________ adds one or more new columns to a table.

  1. A) create table
  2. B) alter table
  3. C) create view
  4. D) create relationship

Answer: B

Diff: 1 Page Ref: 256

Topic: Defining a Database in SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Changing Table Definitions

12) What does the following SQL statement do?

Alter Table Customer_T

Add (Type Varchar (2));

  1. A) Alters the Customer_T table to accept Type 2 Varchars
  2. B) Alters the Customer_T table to be a Type 2 Varchar
  3. C) Alters the Customer_T table, and adds a field called “Type”
  4. D) Alters the Customer_T table by adding a 2-byte field called “Varchar”

Answer: C

Diff: 2 Page Ref: 256

Topic: Defining a Database in SQL

AACSB: Use of Information Technology

Subtopic: Changing Table Definitions

13) What does the following SQL command do?

insert into Customer_T values (001,’John Smith’,’231 West St’,’Boston’,’MA’,’02115′);

  1. A) Adds a new record to the Customer_T
  2. B) Creates the Customer_T table
  3. C) Deletes the Customer_T table
  4. D) Updates the Customer_T table

Answer: A

Diff: 2 Page Ref: 257

Topic: Inserting, Updating, and Deleting Data

AACSB: Analytic Skills

14) 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’)

  1. A) It would work just fine.
  2. B) You must specify the fields to insert if you are only inserting some of the fields.
  3. C) There is no table keyword.
  4. D) None of the above.

Answer: B

Diff: 2 Page Ref: 258

Topic: Inserting, Updating, and Deleting Data

AACSB: Analytic Skills

15) What does the following SQL statement do?

Delete from Customer_T

where state = ‘HI’;

  1. A) Deletes all records from customer_t where the state is equal to HI
  2. B) Removes the Customer_T table from the database
  3. C) Deletes all records from the Customer_T table
  4. D) None of the above

Answer: A

Diff: 2 Page Ref: 259

Topic: Inserting, Updating, and Deleting Data

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Deleting Database Contents

16) What does the following SQL statement do?

Update Product_T

Set Unit_Price = 775

Where Product_ID = 7

  1. A) Changes the price of a unit called Product_T to 7
  2. B) Changes the unit price of Product 7 to 775
  3. C) Changes the length of the Unit_Price field to 775
  4. D) Updates the Product_T table to have a unit price of 775

Answer: B

Diff: 2 Page Ref: 259

Topic: Inserting, Updating, and Deleting Data

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Updating Database Contents

17) Which of the following is a technique for optimizing the internal performance of the relational data model?

  1. A) Avoiding indexes on secondary keys
  2. B) Clustering data
  3. C) Not reporting statistics to save machine resources
  4. D) Using random index organizations

Answer: B

Diff: 2 Page Ref: 260

Topic: Internal Schema Definitions in RDBMSs

AACSB: Use of Information Technology

18) Indexes are created in most RDBMSs to:

  1. A) provide a quicker way to store data.
  2. B) decrease the amount of disk space utilized.
  3. C) provide rapid random and sequential access to base-table data.
  4. D) increase the cost of implementation.

Answer: C

Diff: 2 Page Ref: 260

Topic: Internal Schema Definitions in RDBMSs

AACSB: Use of Information Technology

Subtopic: Creating Indexes

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

  1. A) Select
  2. B) From
  3. C) Where
  4. D) Group By

Answer: C

Diff: 1 Page Ref: 261

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Clauses of the SELECT Statement

20) What does the following SQL statement do?

Select * From Customer Where Cust_Type = “Best”

  1. A) Selects all the fields from the Customer table for each row with a customer labeled “Best”
  2. B) Selects the “*” field from the Customer table for each row with a customer labeled “Best”
  3. C) Selects fields with a “*” in them from the Customer table
  4. D) Selects all the fields from the Customer table for each row with a customer labeled “*”

Answer: A

Diff: 2 Page Ref: 262

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Clauses of the SELECT Statement

21) What result will the following SQL statement produce?

Select Avg(standard_price) as average from Product_V;

  1. A) The average of all products in Product_V
  2. B) The average Standard_Price of all products in Product_V
  3. C) The average price of all products
  4. D) None of the above

Answer: B

Diff: 2 Page Ref: 265

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Expressions

22) Which of the following questions is answered by the SQL statement?

Select Count (Product_Description) from Product_T;

  1. A) How many products are in the table Product_T?
  2. B) How many products have product descriptions in the Product Table?
  3. C) How many characters are in the field name “Product_Description”?
  4. D) How many different columns named “Product_Description” are there in table Product_T?

Answer: B

Diff: 2 Page Ref: 265

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Functions

23) What results will be produced by the following SQL query?

Select sum(standard_price) as Total_Price

from Product_V

where Product_Type = ‘WOOD’;

  1. A) The total price of all products that are of type wood
  2. B) The total price of all products
  3. C) The Standard_Price of the first wood product in the table
  4. D) The Standard_Price of any wood product in the table

Answer: A

Diff: 3 Page Ref: 266

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Expressions

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

  1. A) Count
  2. B) Count(*)
  3. C) Tally(*)
  4. D) Checknum

Answer: A

Diff: 2 Page Ref: 266

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Functions

25) Which of the following will produce the minimum of all standard prices?

  1. A) Select standard_price from Product_V where Standard_Price = min;
  2. B) Select min(standard_price) from Product_V;
  3. C) Select Standard_Price from min(Product_V);
  4. D) Select min(Standard_Price) from Product_V where Standard_Price = min(Standard_Price);

Answer: B

Diff: 2 Page Ref: 266

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Functions

26) What will result from the following SQL Select statement?

Select min(Product_Description)

from Product_V;

  1. A) The minimum value of Product_Description will be displayed.
  2. B) An error message will be generated.
  3. C) The first product description alphabetically in Product_V will be shown.
  4. D) None of the above.

Answer: C

Diff: 3 Page Ref: 266

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Functions

27) Which of the following is the wildcard operator in SQL statements?

  1. A) < >
  2. B) *
  3. C) =
  4. D) &

Answer: B

Diff: 1 Page Ref: 267

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Wildcards

28) What result set will the following query return?

Select Item_No

from Order_V

where quantity > 10;

  1. A) The Item_No of all orders that had more than 10 items
  2. B) The Order_Id of all orders that had more than one item
  3. C) The Order_Id of all orders that had more than 10 items
  4. D) The Item_No of all orders that had 10 or more items

Answer: A

Diff: 2 Page Ref: 267

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Comparison Operators

29) What result set will the following query return?

Select Item_No, description

from item

where weight > 100 and weight < 200;

  1. A) The Item_No and description for all items weighing less than 100
  2. B) The Item_No for all items weighing between 101 and 199
  3. C) The Item_No and description for all items weighing between 101 and 199
  4. D) The Item_No for all items weighing more than 200

Answer: C

Diff: 2 Page Ref: 270, 271

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Ranges for Qualification

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

  1. A) alter
  2. B) distinct
  3. C) check
  4. D) specific

Answer: B

Diff: 1 Page Ref: 271, 272

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Using Distinct Values

31) What result set is returned from the following query?

Select Customer_Name, telephone

from customers

where city in (‘Boston’,’New York’,’Denver’);

  1. A) The Customer_Name and telephone of all customers
  2. B) The Customer_Name and telephone of all customers living in either Boston, New York or Denver
  3. C) The Customer_Name and telephone of all customers living in Boston and New York and Denver
  4. D) The Customer_Name of all customers living in Boston, New York or Denver

Answer: B

Diff: 2 Page Ref: 273

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: IN and NOT IN with Lists

32) To get all the customers from Hawaii sorted together, which of the following would be used?

  1. A) Order By
  2. B) Group By
  3. C) Having
  4. D) Sort

Answer: A

Diff: 1 Page Ref: 274

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Sorting Results: The ORDER BY Clause

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

  1. A) agate.
  2. B) scalar aggregate.
  3. C) vector aggregate.
  4. D) summation.

Answer: B

Diff: 1 Page Ref: 274

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Categorizing Results: The GROUP BY Clause

34) Multiple values returned from an SQL query that includes an aggregate function are called:

  1. A) vector aggregates.
  2. B) scalar aggregates.
  3. C) agates.
  4. D) summations.

Answer: A

Diff: 1 Page Ref: 274

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Categorizing Results: The GROUP BY Clause

35) Which of the following can produce scalar and vector aggregates?

  1. A) Order By
  2. B) Group By
  3. C) Having
  4. D) Sort

Answer: B

Diff: 2 Page Ref: 274

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Categorizing Results: The GROUP BY Clause

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

Select driver_no,count(*) as num_deliveries

from deliveries

group by driver_no;

  1. A) A listing of all drivers, sorted by driver number
  2. B) A listing of each driver as well as the number of deliveries that he or she has made
  3. C) A count of all of the deliveries made by all drivers
  4. D) None of the above

Answer: B

Diff: 3 Page Ref: 275

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Categorizing Results: The GROUP BY Clause

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

Select driver_no, count(*) as num_deliveries

from deliveries

where state = ‘MA’

group by driver_no;

  1. A) A listing of all drivers who made deliveries to state = ‘MA’, sorted by driver number
  2. B) A listing of each driver who made deliveries to state = ‘MA’ as well as the number of deliveries that each driver has made to that state
  3. C) A count of all of the deliveries made to state = ‘MA’ by all drivers
  4. D) None of the above

Answer: B

Diff: 3 Page Ref: 275

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Categorizing Results: The GROUP BY Clause

38) Which of the following finds all groups meeting stated conditions?

  1. A) Select
  2. B) Where
  3. C) Having
  4. D) Find

Answer: C

Diff: 1 Page Ref: 276

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Qualifying Results by Categories: The HAVING Clause

39) 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;

  1. A) A listing of all drivers who made more than 2 deliveries as well as a count of the number of deliveries
  2. B) A listing of all drivers
  3. C) A listing of the number of deliveries greater than 2
  4. D) A listing of all drivers who made more than 2 deliveries

Answer: A

Diff: 3 Page Ref: 276

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Qualifying Results by Categories: The HAVING Clause

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

  1. A) The SELECT clause is always processed first.
  2. B) The SELECT clause is always processed last.
  3. C) The SELECT clause is processed before the ORDER BY clause.
  4. D) The GROUP BY clause is processed before the WHERE clause.

Answer: C

Diff: 3 Page Ref: 277

Topic: Processing Single Tables

AACSB: Use of Information Technology

41) A ________ view is materialized when referenced.

  1. A) virtual
  2. B) dynamic
  3. C) materialized
  4. D) base

Answer: B

Diff: 2 Page Ref: 277

Topic: Using and Defining Views

AACSB: Use of Information Technology

42) A view may not be updated directly if it contains:

  1. A) the DISTINCT keyword.
  2. B) derived columns and expressions in the SELECT clause.
  3. C) uses the GROUP BY or HAVING clause.
  4. D) all of the above.

Answer: D

Diff: 1 Page Ref: 280

Topic: Using and Defining Views

AACSB: Use of Information Technology

43) SQL is both an American and international standard for database access.

Answer: TRUE

Diff: 1 Page Ref: 243

Topic: Introduction

AACSB: Use of Information Technology

44) SQL has been implemented only in the mainframe and midrange environments.

Answer: FALSE

Diff: 1 Page Ref: 244

Topic: Introduction

AACSB: Use of Information Technology

45) SQL originated from a project called System-S.

Answer: FALSE

Diff: 1 Page Ref: 245

Topic: History of the SQL Standard

AACSB: Use of Information Technology

46) 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.

Answer: TRUE

Diff: 1 Page Ref: 245

Topic: Origins of the SQL Standard

AACSB: Use of Information Technology

47) A major benefit of SQL as a standard is reduced training costs.

Answer: TRUE

Diff: 1 Page Ref: 245

Topic: Origins of the SQL Standard

AACSB: Use of Information Technology

48) Implementation of a standard can never stifle creativity and innovation.

Answer: FALSE

Diff: 2 Page Ref: 246

Topic: Origins of the SQL Standard

AACSB: Use of Information Technology

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

Answer: TRUE

Diff: 1 Page Ref: 245

Topic: Origins of the SQL Standard

AACSB: Use of Information Technology

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

Answer: FALSE

Diff: 1 Page Ref: 247

Topic: The SQL Environment

AACSB: Use of Information Technology

51) Some DBMS can handle graphic data types as well as text and numbers.

Answer: TRUE

Diff: 2 Page Ref: 248

Topic: The SQL Environment

AACSB: Use of Information Technology

52) DCL is used to update the database with new records.

Answer: FALSE

Diff: 1 Page Ref: 248

Topic: The SQL Environment

AACSB: Use of Information Technology

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

Answer: TRUE

Diff: 1 Page Ref: 248

Topic: The SQL Environment

AACSB: Use of Information Technology

54) A database is maintained and queried using the data mapping language (DML).

Answer: FALSE

Diff: 1 Page Ref: 248

Topic: The SQL Environment

AACSB: Use of Information Technology

55) The CREATE SCHEMA DDL command is used to create a table.

Answer: FALSE

Diff: 1 Page Ref: 252

Topic: Defining a Database in SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Generating SQL Database Definitions

56) When creating tables, it’s important to decide which columns will allow null values before the table is created.

Answer: TRUE

Diff: 1 Page Ref: 252

Topic: Defining a Database in SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Creating Tables

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

Answer: FALSE

Diff: 1 Page Ref: 253

Topic: Defining a Database in SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Creating Tables

58) 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.

Answer: FALSE

Diff: 2 Page Ref: 255

Topic: Defining a Database in SQL

AACSB: Use of Information Technology

Subtopic: Creating Data Integrity Controls

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

Answer: FALSE

Diff: 2 Page Ref: 257

Topic: Defining a Database in SQL

AACSB: Use of Information Technology

Subtopic: Removing Tables

60) The ALTER TABLE command is used to change a table definition.

Answer: TRUE

Diff: 1 Page Ref: 256

Topic: Defining a Database in SQL

AACSB: Use of Information Technology

Subtopic: Changing Table Definitions

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

Answer: TRUE

Diff: 1 Page Ref: 257

Topic: Inserting, Updating, and Deleting Data

AACSB: Use of Information Technology

62) An insert command does not need to have the fields listed.

Answer: TRUE

Diff: 1 Page Ref: 257

Topic: Inserting, Updating, and Deleting Data

AACSB: Analytic Skills

63) The following command would work fine:

insert into budget values 121,222,111;

Answer: FALSE

Diff: 1 Page Ref: 257

Topic: Inserting, Updating, and Deleting Data

AACSB: Analytic Skills

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

Answer: FALSE

Diff: 1 Page Ref: 259

Topic: Inserting, Updating, and Deleting Data

AACSB: Use of Information Technology

Subtopic: Deleting Database Contents

65) In order to update data in SQL, one must inform the DBMS which relation, columns, and rows are involved.

Answer: TRUE

Diff: 2 Page Ref: 259

Topic: Inserting, Updating, and Deleting Data

AACSB: Use of Information Technology

Subtopic: Updating Database Contents

66) Indexes generally slow down access speed in most RDMS.

Answer: FALSE

Diff: 2 Page Ref: 260

Topic: Internal Schema Definitions in RDBMSs

AACSB: Use of Information Technology

67) The WHERE clause includes the conditions for row selection within a single table or view and the conditions between tables or views for joining.

Answer: TRUE

Diff: 1 Page Ref: 261

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Clauses of the SELECT Statement

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

Answer: TRUE

Diff: 2 Page Ref: 263, 264

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Expressions

69) Count(*) tallies only those rows that contain a value, while Count counts all rows.

Answer: FALSE

Diff: 2 Page Ref: 265

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Functions

70) The asterisk (*) wildcard designator can be used to select all fields from a table as well as in WHERE clauses when an exact match is not possible.

Answer: TRUE

Diff: 1 Page Ref: 267

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Wildcards

71) The comparison operators = and != are used to establish a range of values.

Answer: FALSE

Diff: 2 Page Ref: 267

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Using Comparison Operators

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

Answer: TRUE

Diff: 2 Page Ref: 268

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Boolean Operators

73) The following two SQL statements will produce the same results.

Select last_name, first_name

from customer

where credit_limit > 99 and credit_limit < 10001;

Select last_name, first_name

from customer

where credit_limit between 100 and 10000;

Answer: TRUE

Diff: 2 Page Ref: 270, 271

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using Ranges for Qualification

74) Adding the DISTINCT keyword to a query eliminates duplicates.

Answer: TRUE

Diff: 1 Page Ref: 271, 272

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Using Distinct Values

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

Answer: FALSE

Diff: 2 Page Ref: 273

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using IN and NOT IN with Lists

76) The ORDER BY clause sorts the final results rows in ascending or descending order.

Answer: TRUE

Diff: 1 Page Ref: 273, 274

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Sorting Results: The ORDER BY Clause

77) A single value returned from an SQL query that includes an aggregate function is called a vector aggregate.

Answer: FALSE

Diff: 1 Page Ref: 274

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Categorizing Results: The GROUP BY Clause

78) When a GROUP BY clause is included in an SQL statement, only those columns with a single value for each group can be included.

Answer: TRUE

Diff: 2 Page Ref: 274, 275

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Categorizing Results: The GROUP BY Clause

79) The HAVING clause and the WHERE clause perform the same operation.

Answer: FALSE

Diff: 2 Page Ref: 276, 277

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Qualifying Results by Categories: The HAVING Clause

80) The following query totals sales for each salesperson.

Select salesperson_id, sum(sales)

from salesperson

group by salesperson_id;

Answer: TRUE

Diff: 2 Page Ref: 276

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Categorizing Results: The GROUP BY Clause

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

Answer: FALSE

Diff: 3 Page Ref: 276

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Qualifying Results by Categories: The HAVING Clause

82) The ORDER BY clause is the first statement processed in an SQL command.

Answer: FALSE

Diff: 2 Page Ref: 277

Topic: Processing Single Tables

AACSB: Use of Information Technology

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

Answer: TRUE

Diff: 2 Page Ref: 277

Topic: Processing Single Tables

AACSB: Use of Information Technology

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

Answer: TRUE

Diff: 2 Page Ref: 277

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

85) The content of dynamic views is generated when they are referenced.

Answer: TRUE

Diff: 1 Page Ref: 278

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Using and Defining Views

86) Materialized views are stored on disk and are never refreshed.

Answer: FALSE

Diff: 2 Page Ref: 278, 279

Topic: Processing Single Tables

AACSB: Use of Information Technology

Subtopic: Using and Defining Views

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

Answer: TRUE

Diff: 1 Page Ref: 279

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using and Defining Views

88) When the SELECT clause in the create view statement contains the keyword DISTINCT, the view can be used to update data.

Answer: FALSE

Diff: 1 Page Ref: 280

Topic: Processing Single Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Using and Defining Views

89) What were the original purposes of SQL, and does SQL as we know it today live up to those standards?

Answer: The following were the original purposes of SQL:

  1. To specify the syntax and semantics of SQL data definition and manipulation languages
  2. To define the data structures and basic operations for designing, accessing, maintaining, controlling, and protecting an SQL database
  3. To provide a vehicle for portability of database definition and application modules between conforming DBMSs
  4. To specify both minimal (Level 1) and complete (Level 2) standards, which permit different degrees of adoption in products
  5. To provide an initial standard, although incomplete, that will be enhanced later to include specifications for handling such topics as referential integrity, transaction management, user-defined functions, join operators beyond the equi-join, and national character sets

While SQL as we know it today does have some variants, there is a basic standard which is adhered to. As mentioned in the text, it seems that industry lags behind the standards somewhat. Each vendor has its own set of proprietary features which differ from the standard.

Diff: 3 Page Ref: 245

Topic: Origins of the SQL Standard

AACSB: Reflective Thinking

90) What are some of the advantages and disadvantages to an SQL standard?

Answer: Some of the advantages are: reduced training costs, increased productivity, application portability, application longevity, reduced dependence on a single vendor and cross-system communication. Some disadvantages include: stifling creativity, difficulty in changing standard, and loss of application portability when adding additional proprietary features.

Diff: 3 Page Ref: 245, 246

Topic: Origins of the SQL Standard

AACSB: Reflective Thinking

91) Explain the three classes of SQL commands and when they would be used.

Answer: There are three classes or types of SQL commands. Data definition language commands are used to create tables, alter and drop tables, views and indexes. These commands are used to build the structure of the database as well as some additional objects. The next type is Data Manipulation Language commands, which are used to maintain and query a database. Commands in this class include select, update, delete and insert. The last type is the data control language commands, which are used to grant and revoke privileges on tables and other objects in the database.

Diff: 3 Page Ref: 248

Topic: The SQL Environment

AACSB: Analytic Skills, Reflective Thinking

92) What steps should be followed when preparing to create a table?

Answer: When preparing to create a table, one should:

  1. Identify the appropriate data type and length for each attribute
  2. Identify the columns that should accept null values
  3. Identify that columns that need to be unique
  4. Identify all primary-foreign key mates
  5. Determine default values
  6. Identify any columns for which domain constraints, such as check, need to be stated
  7. Create the table and any indexes using create table and create index statements

Diff: 3 Page Ref: 252, 253

Topic: Defining a Database in SQL

AACSB: Analytic Skills

Subtopic: Creating Tables

93) What three clauses are contained in most SQL retrieval statements?

Answer: The SELECT clause, which lists the columns and calculated expression from base tables. The FROM clause, which identifies tables and views which we want to gather data from in the query. Finally, the WHERE clause, which is used to specify conditions for selection of rows in the result set.

Diff: 3 Page Ref: 261

Topic: Processing Single Tables

AACSB: Analytic Skills

Subtopic: Clauses of the SELECT Statement

94) What are some of the standard SQL functions that can be used in the SELECT clause?

Answer: The standard functions can be broken down into 4 categories: Mathematical, String, Date and Analytical. Mathematical functions include: Min, Max, Count, Sum, Round, Trunc and Mod. String functions include lower, upper, initcap, concat, substr and coalesce. Date functions are used for converting dates and calculating dates and include next_day, add_months and months_between. Top (to find the top n values) is one of the analytical functions.

Diff: 2 Page Ref: 264

Topic: Processing Single Tables

AACSB: Analytic Skills

Subtopic: Using Functions

95) Discuss when to use the GROUP BY clause.

Answer: The GROUP BY clause is useful when you have a set of values for one column (such as a salesperson ID) and you would like to then calculate something like total sales for each salesperson. Rather than having to use the sum function with one salesperson’s ID in the WHERE clause (and run multiple queries) you can use the GROUP BY to get the same results in one query.

Diff: 2 Page Ref: 275, 276

Topic: Processing Single Tables

AACSB: Analytic Skills

Subtopic: Categorizing Results: The GROUP BY Clause

96) How is the HAVING clause different from the WHERE clause?

Answer: While the WHERE clause works on each row in a query resultset, the HAVING clause works on the aggregate (or combined) rows in a GROUP BY. WHERE does not allow aggregates while the HAVING does allow aggregates. For example, if you had the following query:

select customer_id, sum(purchase_price*quantity)

from customer

where sum(purchase_price*quantity) > 100

this would not work. However, with a GROUP BY and HAVING written as follows we would get back all customers whose total purchases were greater than $100

select customer_id, sum(purchase_price*quantity)

from customer

group by customer_id

having sum(purchase_price*quantity) > 100

Diff: 3 Page Ref: 276

Topic: Processing Single Tables

AACSB: Analytic Skills, Reflective Thinking

Subtopic: Qualifying Results by Categories: The HAVING Clause

97) Discuss the pros and cons of using dynamic views.

Answer: A dynamic view is useful, since it provides a way to access part of a table or a combination of columns from multiple tables. A view can simplify query commands, since much of the complicated syntax of a query can be done to create the view. A view can also improve programmer productivity, since programmers can access views rather than have to rewrite the SQL commands for a query. Security is increased, since users can only see what the view presents. Also, views use little or no storage space. On the downside, views use processing time each time that the view is recreated for reference. Also, the views may or may not be recreatable.

Diff: 3 Page Ref: 278

Topic: Using and Defining Views

AACSB: Analytic Skills, Reflective Thinking

98) What is a materialized view, and when would it be used?

Answer: Materialized views are just like dynamic views, except that an actual copy of the data is kept. With a dynamic view, the SQL is stored on the server and executed when the view is referenced. A materialized view, on the other hand, keeps a copy of the actual data. This increases performance and is particularly useful if the data are relatively static and the number of queries against the view are high.

Diff: 3 Page Ref: 281

Topic: Using and Defining Views

AACSB: Analytic Skills

Subtopic: Materialized Views

Modern Database Management, 11e (Hoffer et al.)

Chapter 7 Advanced SQL

1) A join operation:

  1. A) brings together data from two different fields.
  2. B) causes two tables with a common domain to be combined into a single table or view.
  3. C) causes two disparate tables to be combined into a single table or view.
  4. D) is used to combine indexing operations.

Answer: B

Diff: 1 Page Ref: 290

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

2) A join in which the joining condition is based on equality between values in the common columns is called a(n):

  1. A) equi-join.
  2. B) unilateral join.
  3. C) natural join.
  4. D) both A and C.

Answer: D

Diff: 1 Page Ref: 291, 292

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Equi-join

3) A join that is based upon equality between values in two common columns with the same name and where one duplicate column has been removed is called a(n):

  1. A) equi-join.
  2. B) natural join.
  3. C) multivariate join.
  4. D) inner join.

Answer: B

Diff: 1 Page Ref: 292, 293

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Natural Join

4) The most commonly used form of join operation is the:

  1. A) outer join.
  2. B) union join.
  3. C) equi-join.
  4. D) natural join.

Answer: D

Diff: 2 Page Ref: 292

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Natural Join

5) A join in which rows that do not have matching values in common columns are still included in the result table is called a(n):

  1. A) natural join.
  2. B) equi-join.
  3. C) outer join.
  4. D) union join.

Answer: C

Diff: 1 Page Ref: 293, 294

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Outer Join

6) The outer join syntax does not apply easily to a join condition of more than ________ tables.

  1. A) two
  2. B) three
  3. C) four
  4. D) any number of

Answer: A

Diff: 2 Page Ref: 294

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Outer Join

7) In which of the following situations would one have to use an outer join in order to obtain the desired results?

  1. A) A report is desired that lists all customers who placed an order.
  2. B) A report is desired that lists all customers and the total of their orders.
  3. C) A report is desired that lists all customers, the total of their orders during the most recent month, and includes customers who did not place an order during the month (their total will be zero).
  4. D) There is never a situation that requires only an outer join.

Answer: C

Diff: 3 Page Ref: 293, 294

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Outer Join

8) One major advantage of the outer join is that:

  1. A) information is easily accessible.
  2. B) information is not lost.
  3. C) the query is easier to write.
  4. D) all of the above.

Answer: B

Diff: 2 Page Ref: 295

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Outer Join

9) An operation to join a table to itself is called a:

  1. A) sufficient-join.
  2. B) inner join.
  3. C) outer join.
  4. D) self-join.

Answer: D

Diff: 1 Page Ref: 297

Topic: Processing Multiple Tables

AACSB: Analytic Skills

Subtopic: Self Join

10) A type of join where a table is joined to itself is called a(n):

  1. A) unary join.
  2. B) self-join.
  3. C) unnatural join.
  4. D) pinned join.

Answer: B

Diff: 2 Page Ref: 297

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Self Join

11) A type of query that is placed within a WHERE or HAVING clause of another query is called a:

  1. A) master query.
  2. B) subquery.
  3. C) superquery.
  4. D) multi-query.

Answer: B

Diff: 1 Page Ref: 298

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Subqueries

12) SQL provides the ________ technique, which involves placing an inner query within the WHERE or HAVING clause of an outer query.

  1. A) grouping
  2. B) joining
  3. C) subquery
  4. D) union

Answer: C

Diff: 2 Page Ref: 298, 299

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Subqueries

13) ________ takes a value of true if a subquery returns an intermediate results table which contains one or more rows.

  1. A) In
  2. B) Having
  3. C) Exists
  4. D) Extents

Answer: C

Diff: 2 Page Ref: 301, 302

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Subqueries

14) EXISTS will take a value of ________ if the subquery returns an intermediate results table which contains one or more rows.

  1. A) FALSE
  2. B) 1
  3. C) TRUE
  4. D) undefined

Answer: C

Diff: 1 Page Ref: 302

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Subqueries

15) In SQL, a(n) ________ subquery is a type of subquery in which processing the inner query depends on data from the outer query.

  1. A) correlated
  2. B) paired
  3. C) natural
  4. D) inner

Answer: A

Diff: 2 Page Ref: 303

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Correlated Subqueries

16) ________ use the result of the outer query to determine the processing of the inner query.

  1. A) Correlated subqueries
  2. B) Outer subqueries
  3. C) Inner subqueries
  4. D) Subqueries

Answer: A

Diff: 2 Page Ref: 303

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Subqueries

17) The ________ clause is used to combine the output from multiple queries into a single result table.

  1. A) INTERSECT
  2. B) DIVIDE
  3. C) COLLATE
  4. D) UNION

Answer: D

Diff: 1 Page Ref: 306

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Combining Queries

18) A ________ is a temporary table used in the FROM clause of an SQL query.

  1. A) correlated subquery
  2. B) derived table
  3. C) view table
  4. D) none of the above

Answer: B

Diff: 2 Page Ref: 305, 306

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Using Derived Tables

19) In order for two queries to be UNION-compatible, they must:

  1. A) both have the same number of lines in their SQL statements.
  2. B) both output compatible data types for each column and return the same number of rows.
  3. C) both return at least one row.
  4. D) all of the above.

Answer: B

Diff: 2 Page Ref: 306

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Combining Queries

20) The UNION clause is used to:

  1. A) combine the output from multiple queries into a single result table.
  2. B) join two tables together to form one table.
  3. C) find all rows that do not match in two tables.
  4. D) none of the above.

Answer: A

Diff: 1 Page Ref: 306

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Combining Queries

21) Establishing IF-THEN-ELSE logical processing within an SQL statement can be accomplished by:

  1. A) using the if-then-else construct.
  2. B) using the immediate if statement.
  3. C) using the CASE keyword in a statement.
  4. D) using a subquery.

Answer: C

Diff: 2 Page Ref: 308

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Conditional Expressions

22) All of the following are guidelines for better query design EXCEPT:

  1. A) understand how indexes are used in query processing.
  2. B) use a lot of self-joins.
  3. C) write simple queries.
  4. D) retrieve on the data that you need.

Answer: B

Diff: 2 Page Ref: 312, 313

Topic: Tips for Developing Queries

AACSB: Analytic Skills

Subtopic: Guidelines for Better Query Design

23) Explicit commands to manage transactions are needed when:

  1. A) a transaction consists of just one SQL command.
  2. B) multiple SQL commands must be run as part of a transaction.
  3. C) autocommit is set to off.
  4. D) none of the above.

Answer: B

Diff: 3 Page Ref: 314

Topic: Ensuring Transaction Integrity

AACSB: Use of Information Technology

24) User-defined transactions can improve system performance because:

  1. A) transactions are processed as sets, reducing system overhead.
  2. B) transactions are mapped to SQL statements.
  3. C) speed is improved due to query optimization.
  4. D) all of the above.

Answer: A

Diff: 2 Page Ref: 315

Topic: Ensuring Transaction Integrity

AACSB: Use of Information Technology

25) An interactive command that can be used to dynamically control a user session for appropriate integrity measures is:

  1. A) rollback.
  2. B) rollforward.
  3. C) set autocommit.
  4. D) expunge.

Answer: C

Diff: 2 Page Ref: 315

Topic: Ensuring Transaction Integrity

AACSB: Analytic Skills, Use of Information Technology

26) The ________ DBA view shows information about all users of the database in Oracle.

  1. A) DBA_USERS
  2. B) USERS
  3. C) DBA_VIEWS
  4. D) DBA_INDEXES

Answer: A

Diff: 1 Page Ref: 316

Topic: Data Dictionary Facilities

AACSB: Use of Information Technology

27) If the DBA wishes to describe all tables in the database, which data dictionary view should be accessed in Oracle?

  1. A) dba_tab_privs
  2. B) dba_tab_comments
  3. C) dba_table_label
  4. D) dba_tables

Answer: D

Diff: 2 Page Ref: 316

Topic: Data Dictionary Facilities

AACSB: Analytic Skills, Use of Information Technology

28) What results would the following SQL statement produce?

select owner, table_name

from dba_tables

where table_name = ‘CUSTOMER’;

  1. A) A listing of all customers in the customer table
  2. B) A listing of the owner of the customer table
  3. C) A listing of the owner of the customer table as well as customers
  4. D) An error message

Answer: B

Diff: 2 Page Ref: 316

Topic: Data Dictionary Facilities

AACSB: Analytic Skills, Use of Information Technology

29) User-defined data types:

  1. A) can be a subclass of a standard type.
  2. B) can behave as an object.
  3. C) can have defined functions and methods.
  4. D) can have all of the above.

Answer: D

Diff: 2 Page Ref: 317

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Use of Information Technology

30) A new set of analytical functions added in SQL:2008 is referred to as:

  1. A) OLAF functions.
  2. B) MOLAP functions.
  3. C) average functions.
  4. D) OLAP functions.

Answer: D

Diff: 2 Page Ref: 317

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Use of Information Technology

Subtopic: Analytical Functions

31) RANK and DENSE-RANK are examples of:

  1. A) ceilings.
  2. B) door functions.
  3. C) window functions.
  4. D) moving functions.

Answer: C

Diff: 2 Page Ref: 318

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Analytical Functions

32) All of the following are new data types added in SQL:200n EXCEPT:

  1. A) BIGINT.
  2. B) BIT.
  3. C) MULTISET.
  4. D) XML.

Answer: B

Diff: 2 Page Ref: 319

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: New Data Types

33) ________ differs from array because it can contain duplicates.

  1. A) BIGINT
  2. B) XML
  3. C) MULTISET
  4. D) TABLE

Answer: C

Diff: 2 Page Ref: 319

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Analytic Skills

Subtopic: New Data Types

34) The MERGE command:

  1. A) allows one to combine the INSERT and UPDATE operations.
  2. B) allows one to combine the INSERT and DELETE operations.
  3. C) joins 2 tables together.
  4. D) none of the above.

Answer: A

Diff: 2 Page Ref: 319-320

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Other Enhancements

35) Extensions defined in SQL-99 that include the capability to create and drop modules of code stored in the database schema across user sessions are called:

  1. A) stored procedures.
  2. B) Persistent Stored Modules.
  3. C) flow control modules.
  4. D) none of the above.

Answer: B

Diff: 2 Page Ref: 320

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Use of Information Technology

Subtopic: Programming Extensions

36) A named set of SQL statements that are considered when a data modification occurs are called:

  1. A) stored procedures.
  2. B) treatments.
  3. C) triggers.
  4. D) trapdoors.

Answer: C

Diff: 1 Page Ref: 321

Topic: Triggers and Routines

AACSB: Use of Information Technology

37) All of the following are part of the coding structure for triggers EXCEPT:

  1. A) event.
  2. B) condition.
  3. C) selection.
  4. D) action.

Answer: C

Diff: 1 Page Ref: 323

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Triggers

38) While triggers run automatically, ________ do not and have to be called.

  1. A) trapdoors
  2. B) routines
  3. C) selects
  4. D) updates

Answer: B

Diff: 2 Page Ref: 324

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Routines

39) SQL-invoked routines can be:

  1. A) procedures.
  2. B) functions.
  3. C) all of the above.
  4. D) none of the above.

Answer: C

Diff: 1 Page Ref: 324

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Routines

40) All of the following are advantages of SQL-invoked routines EXCEPT:

  1. A) flexibility.
  2. B) efficiency.
  3. C) sharability.
  4. D) security.

Answer: D

Diff: 2 Page Ref: 324

Topic: Triggers and Routines

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Routines

41) A procedure is:

  1. A) stored within the database.
  2. B) given a unique name.
  3. C) called by name.
  4. D) all of the above.

Answer: D

Diff: 2 Page Ref: 324

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Routines

42) Embedded SQL consists of:

  1. A) hard-coded SQL statements included in a program written in another language.
  2. B) SQL encapsulated inside of other SQL statements.
  3. C) SQL written into a front-end application.
  4. D) SQL translated to a lower-level language.

Answer: A

Diff: 1 Page Ref: 327

Topic: Embedded SQL and Dynamic SQL

AACSB: Use of Information Technology

43) In order to embed SQL inside of another language, the ________ statement must be placed before the SQL in the host language.

  1. A) GET SQL
  2. B) EXEC SQL
  3. C) RUN SQL
  4. D) SQL SQL

Answer: B

Diff: 2 Page Ref: 328

Topic: Embedded SQL and Dynamic SQL

AACSB: Analytic Skills, Use of Information Technology

44) Dynamic SQL:

  1. A) is used to generate appropriate SQL code on the fly as an application is processing.
  2. B) is quite volatile.
  3. C) is not used widely on the Internet.
  4. D) creates a less flexible application.

Answer: A

Diff: 1 Page Ref: 327

Topic: Embedded SQL and Dynamic SQL

AACSB: Use of Information Technology

45) An equi-join is a join in which one of the duplicate columns is eliminated in the result table.

Answer: FALSE

Diff: 2 Page Ref: 291

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Equi-join

46) A join in which the joining condition is based on equality between values in the common column is called a(n) equi-join.

Answer: TRUE

Diff: 1 Page Ref: 291

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Equi-join

47) The joining condition of an equi-join is based upon an equality.

Answer: TRUE

Diff: 2 Page Ref: 291

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Equi-join

48) A natural join is the same as an equi-join, except that it is performed over matching columns that have been defined with the same name, and one of the duplicate columns is eliminated.

Answer: TRUE

Diff: 1 Page Ref: 292

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Natural Join

49) The natural join is very rarely used.

Answer: FALSE

Diff: 1 Page Ref: 292

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Natural Join

50) An SQL query that implements an outer join will return rows that do not have matching values in common columns.

Answer: TRUE

Diff: 1 Page Ref: 293

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Outer Join

51) Using an outer join produces this information: rows that do not have matching values in common columns are not included in the result table.

Answer: FALSE

Diff: 1 Page Ref: 293

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Outer Join

52) One major disadvantage of the outer join is that information is easily lost.

Answer: FALSE

Diff: 3 Page Ref: 295

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Outer Join

53) There is a special operation in SQL to join a table to itself.

Answer: FALSE

Diff: 3 Page Ref: 297

Topic: Processing Multiple Tables

AACSB: Analytic Skills

Subtopic: Self Join

54) Joining tables or using a subquery may produce the same result.

Answer: TRUE

Diff: 2 Page Ref: 299

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Subqueries

55) The following queries produce the same results.

select customer_name, customer_city

from customer, salesman

where customer.salesman_id = salesman.salesman_id

and salesman.lname = ‘SMITH’;

select customer_name, customer_city

from customer

where customer.salesman_id =

(select salesman_id

from salesman

where lname = ‘SMITH’);

Answer: TRUE

Diff: 2 Page Ref: 299

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Subqueries

56) The following query will execute without errors.

select customer.customer_name, salesman.sales_quota

from customer

where customer.salesman_id =

(select salesman_id

where lname = ‘SMITH’);

Answer: FALSE

Diff: 2 Page Ref: 298

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Subqueries

57) In order to find out what customers have not placed an order for a particular item, one might use the NOT qualifier along with the IN qualifier.

Answer: TRUE

Diff: 2 Page Ref: 301

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Subqueries

58) EXISTS takes a value of false if the subquery returns an intermediate result set.

Answer: FALSE

Diff: 2 Page Ref: 302

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Subqueries

59) When EXISTS or NOT EXISTS is used in a subquery, the select list of the subquery will usually just select all columns as a placeholder because it doesn’t matter which columns are returned.

Answer: TRUE

Diff: 1 Page Ref: 303

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Subqueries

60) A subquery in which processing the inner query depends on data from the outer query is called a codependent query.

Answer: FALSE

Diff: 2 Page Ref: 303

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Subqueries

61) The following SQL statement is an example of a correlated subquery.

select first_name, last_name, total_sales

from salesman s1

where total_sales > all

(select total_sales from salesman s2

where s1.salesman_id != s2.salesman_id);

Answer: TRUE

Diff: 3 Page Ref: 303

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Subqueries

62) A correlated subquery is executed once for each iteration through the outer loop.

Answer: TRUE

Diff: 2 Page Ref: 303

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Correlated Subqueries

63) Subqueries can only be used in the WHERE clause.

Answer: FALSE

Diff: 1 Page Ref: 305

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Using Derived Tables

64) The UNION clause is used to combine the output from multiple queries into a single result table.

Answer: TRUE

Diff: 1 Page Ref: 307

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Combining Queries

65) IF-THEN-ELSE logical processing cannot be accomplished within an SQL statement.

Answer: FALSE

Diff: 1 Page Ref: 308

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Conditional Expressions

66) Figuring out what attributes you want in your query before you write the query will help with query writing.

Answer: TRUE

Diff: 1 Page Ref: 311

Topic: Tips for Developing Queries

AACSB: Use of Information Technology

67) It is better not to have a result set identified before writing GROUP BY and HAVING clauses for a query.

Answer: FALSE

Diff: 1 Page Ref: 311

Topic: Tips for Developing Queries

AACSB: Use of Information Technology

68) Specifying the attribute names in the SELECT statement will make it easier to find errors in queries and also correct for problems that may occur in the base system.

Answer: FALSE

Diff: 1 Page Ref: 312

Topic: Tips for Developing Queries

AACSB: Analytic Skills

69) Correlated subqueries are less efficient than queries that do not use nesting.

Answer: TRUE

Diff: 1 Page Ref: 313

Topic: Tips for Developing Queries

AACSB: Analytic Skills

Subtopic: Guidelines for Better Query Design

70) Combining a table with itself results in a faster query.

Answer: FALSE

Diff: 1 Page Ref: 313

Topic: Three-Tiered Database Location Architecture

AACSB: Analytic Skills

Subtopic: Guidelines for Better Query Design

71) A transaction is the complete set of closely related update commands that must all be done, or none of them done, for the database to remain valid.

Answer: TRUE

Diff: 2 Page Ref: 314

Topic: Ensuring Transaction Integrity

AACSB: Use of Information Technology

72) Transaction integrity commands are not used to identify whole units of database changes that must be completed in full for the database to retain integrity.

Answer: FALSE

Diff: 3 Page Ref: 315

Topic: Ensuring Transaction Integrity

AACSB: Analytic Skills, Use of Information Technology

73) RDBMSs store database definition information in system-created tables which can be considered a data dictionary.

Answer: TRUE

Diff: 1 Page Ref: 315

Topic: Data Dictionary Facilities

AACSB: Use of Information Technology

74) DBA_USERS contains comments on all tables in an Oracle database.

Answer: FALSE

Diff: 2 Page Ref: 316

Topic: Data Dictionary Facilities

AACSB: Use of Information Technology

75) SQL:2008 allows one to calculate linear regressions, moving averages and correlations without moving the data outside of the database.

Answer: TRUE

Diff: 1 Page Ref: 317

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Analytical Functions

76) MULTISET is similar to the table datatype.

Answer: FALSE

Diff: 1 Page Ref: 319

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Use of Information Technology

Subtopic: New Data Types

77) Persistent Stored Modules are extensions defined in SQL:1999 that include the capability to add and drop modules of code.

Answer: TRUE

Diff: 1 Page Ref: 320

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Use of Information Technology

Subtopic: Programming Extensions

78) A routine is a named set of SQL statements that are considered when a data modification occurs.

Answer: FALSE

Diff: 1 Page Ref: 321

Topic: Triggers and Routines

AACSB: Use of Information Technology

79) Constraints are a special case of triggers.

Answer: TRUE

Diff: 2 Page Ref: 322

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Triggers

80) Triggers can be used to ensure referential integrity, enforce business rules, create audit trails, replicate tables, but cannot call other triggers.

Answer: FALSE

Diff: 2 Page Ref: 322

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Triggers

81) Triggers have three parts: the event, the condition, and the action.

Answer: TRUE

Diff: 1 Page Ref: 323

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Triggers

82) A function has only input parameters but can return multiple values.

Answer: FALSE

Diff: 1 Page Ref: 324

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Routines

83) The advantages of SQL-invoked routines are flexibility, efficiency, shareability and applicability.

Answer: TRUE

Diff: 1 Page Ref: 324

Topic: Triggers and Routines

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Routines

84) A procedure is run by calling it by its name.

Answer: TRUE

Diff: 2 Page Ref: 325

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Routines

85) SQL statements can be included in another language, such as C or Java.

Answer: TRUE

Diff: 2 Page Ref: 327

Topic: Embedded SQL and Dynamic SQL

AACSB: Use of Information Technology

86) When a subquery is used in the FROM clause, it is called a denied table.

Answer: FALSE

Diff: 1 Page Ref: 305

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Using Derived Tables

87) Establishing IF-THEN-ELSE logical processing within an SQL statement can now be accomplished by using the CASE keyword in a statement.

Answer: TRUE

Diff: 1 Page Ref: 308

Topic: Processing Multiple Tables

AACSB: Use of Information Technology

Subtopic: Conditional Expressions

88) User-defined functions can improve system performance because they will be processed as sets rather than individually, thus reducing system overhead.

Answer: FALSE

Diff: 2 Page Ref: 315

Topic: Ensuring Transaction Integrity

AACSB: Use of Information Technology

89) Persistent Sorted Modules are extensions defined in SQL-99 that include the capability to create and drop modules of code stored in the database schema across user sessions.

Answer: FALSE

Diff: 1 Page Ref: 320

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Use of Information Technology

Subtopic: Programming Extensions

90) A trigger is a named set of SQL statements that are considered when a data modification occurs.

Answer: TRUE

Diff: 1 Page Ref: 321

Topic: Triggers and Routines

AACSB: Use of Information Technology

Subtopic: Triggers

91) Discuss the differences between an equi-join, natural join and outer join.

Answer: Both a natural join and an equi-join create a join based upon equality between some common columns. While the equi-join keeps the redundant columns that are used for the match, the natural join removes duplicates. There are situations where one table may contain information that is not in the other table. However, it is necessary to display both matching data as well as records which do not have a match in the second table. This situation is where we would use an outer join.

Diff: 2 Page Ref: 291-295

Topic: Processing Multiple Tables

AACSB: Analytic Skills

92) What is a self-join and how is it used?

Answer: A self-join is a join of one table to itself. This is often used for unary relationships where you have a recursive foreign key. One possible use for this would be to produce a list of who is supervised by another staff member. Self-joins can be slow, so they should be used with caution.

Diff: 2 Page Ref: 297

Topic: Physical Database Design Process

AACSB: Analytic Skills

Subtopic: Self Join

93) When is it better to use a subquery over using a join?

Answer: Often, a subquery and join will return the same results. Joining is most useful when data from several tables needs to be retrieved and there is no nesting. When relationships are nested, it is best to use a subquery. Also, some queries (such as some not in queries) could not be done with joins.

Diff: 2 Page Ref: 299

Topic: Physical Database Design Process

AACSB: Analytic Skills

Subtopic: Subqueries

94) What is a derived table? When is it used? Can you describe any situations where you would have to use it over a subquery in the WHERE clause?

Answer: A derived table can be created by placing a subquery within the FROM clause. The derived table is simply a temporary table in memory which can be accessed just like a table or view. Sometimes, these are referred to as inline views. A derived table is useful for situations where you need to create aggregate values (such as a sum) and then use these in another query. A derived table would be used instead of a subquery in cases where you need to display results from multiple tables. If the results need to come from a subselect, this is not possible, so we would have to use a derived table.

Diff: 2 Page Ref: 305-306

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Reflective Thinking

Subtopic: Using Derived Tables

95) Explain how to combine queries using the UNION clause.

Answer: The UNION clause is used to combine the output of multiple queries into one set of output. In order for the union to work, each query must return the same number of columns. Also, each output column must be union compatible, meaning it is of the same type. The CAST command can be used to convert from one datatype to another if need be. If you wish to order the output rows, you must specify an ORDER BY clause in the last query.

Diff: 2 Page Ref: 306, 307

Topic: Processing Multiple Tables

AACSB: Analytic Skills, Use of Information Technology

Subtopic: Combining Queries

96) What are some tips for developing queries?

Answer: Some suggestions to help the query writing process include: gaining familiarity with the data model, entity and attributes that you are querying. It is also very important to think about the results that you wish to obtain from the query. Related to this, figure out what attributes you want the query to return. Once this is done, figure out which tables contain the attributes and include these in the FROM clause. By reviewing the ERD, you can determine which columns in each table will be used to establish relationships and establish a link in the WHERE clause. Once everything works fine, then you can look at the use of GROUP BY and HAVING.

Diff: 2 Page Ref: 310, 311

Topic: Tips for Developing Queries

AACSB: Analytic Skills, Use of Information Technology

97) What strategies can be used to write queries that run more efficiently?

Answer: It makes sense to specify the attribute names rather than just * in the SELECT clause. If you are writing a query for a wide table, specifying only the attributes that are needed is going to save a great deal of processing time. Also, changes in the base table post-production could affect query results. Specifying the attribute names will make it easier to notice and correct for such errors.

Use subqueries sparingly, since these increase processing time.

If you have several separate reports which need data from one table, write one query to retrieve all of the data and use what you need in each report.

Diff: 2 Page Ref: 312

Topic: Tips for Developing Queries

AACSB: Analytic Skills, Reflective Thinking

98) Discuss some of the SQL:2008 enhancements and extensions to SQL.

Answer: Several built-in functions were added in SQL:2008. These include ceiling, floor, SQRT, rank, dense_rank, rollup, cube, sample and window. Many operations, such as OLAP operations, can be done within the SQL SELECT statement. There were also three new data types: BIGINT, MULTISET and XML. In addition, the merge operation was added.

Diff: 2 Page Ref: 317-319

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Reflective Thinking

99) What can be done with Persistent Stored Modules?

Answer: Persistent Stored Modules allow one to create procedures and functions within SQL, making it possible to input and output parameters and return a value. Additionally, error handling can be built into SQL statements. The DECLARE command creates variables which will stay in scope throughout the procedure or function. Groups of SQL statements can be passed, which improves performance. Despite all of this, Persistent Stored Modules have not been widely implemented. At this time, developers seem to prefer embedding SQL within high-level languages.

Diff: 2 Page Ref: 319, 320

Topic: SQL: 2008 Enhancements and Extensions to SQL

AACSB: Analytic Skills, Reflective Thinking

Subtopic: Persistent Stored Modules

100) What is the difference between a trigger and a routine?

Answer: A trigger, once written and compiled, sits silently on the database server waiting for an event to happen. It is usually tied to one table and some action, such as insert, update or delete. Conversely, a routine has to be called even though it resides on the database server. It may access one, many or no tables in order to produce the desired results.

Diff: 2 Page Ref: 321-322

Topic: Transforming EER Diagrams into Relations

AACSB: Use of Information Technology

+
-
Only 0 units of this product remain

You might also be interested in