CS331 3B

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What does the following SQL statement do? Alter Table Customer_T Add (Type Varchar (2)); A) Alters the Customer_T table to accept Type 2 Varchars B) Alters the Customer_T table to be a Type 2 Varchar C) Alters the Customer_T table, and adds a field called "Type" D) Alters the Customer_T table by adding a 2-byte field called "Varchar"

C) Alters the Customer_T table, and adds a field called "Type"

________ is a set of commands used to control a database, which includes security. A) DML B) DDL C) DCL D) DPL

C) DCL

Which of the following finds all groups meeting stated conditions? A) Select B) Where C) Having D) Find

C) Having

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 less than 100 B) The Item_No for all items weighing between 101 and 199 C) The Item_No and description for all items weighing between 101 and 199 D) The Item_No for all items weighing more than 200

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

Which of the following is true of the order in which SQL statements are evaluated? A) The SELECT clause is always processed first. B) The SELECT clause is always processed last. C) The SELECT clause is processed before the ORDER BY clause. D) The GROUP BY clause is processed before the WHERE clause.

C) The SELECT clause is processed before the ORDER BY clause

What will result from the following SQL Select statement? Select min(Product_Description) from Product_V; A) The minimum value of Product_Description will be displayed. B) An error message will be generated. C) The first product description alphabetically in Product_V will be shown. D) None of the above.

C) The first product description alphabetically in Product_V will be shown.

In an SQL statement, which of the following parts states the conditions for row selection? A) Select B) From C) Where D) Group By

C) Where

The command for creating a database is: A) create table. B) create view. C) create schema. D) create authorization.

C) create schema.

The SQL command ________ defines a logical table from one or more tables or views. A) create table B) alter table C) create view D) create relationship

C) create view

Indexes are created in most RDBMSs to: A) provide a quicker way to store data. B) decrease the amount of disk space utilized. C) provide rapid random and sequential access to base-table data. D) increase the cost of implementation.

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

Which of the following is a purpose of the SQL standard? A) To specify syntax and semantics of SQL data definition and manipulation B) To specify minimal and complete standards, which permit different degrees of adoption in products C) To define the data structures and basic operations for SQL databases D) All of the above

D) All of the above

A view may not be updated directly if it contains: A) the DISTINCT keyword. B) derived columns and expressions in the SELECT clause. C) uses the GROUP BY or HAVING clause. D) all of the above.

D) all of the above.

The benefits of a standardized relational language include: A) application longevity. B) reduced training costs. C) cross-system communication. D) all of the above.

D) all of the above.

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

F

Implementation of a standard can never stifle creativity and innovation. T/F

F

SQL has been implemented only in the mainframe and midrange environments. T/F

F

SQL originated from a project called System-S. T/F

F

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) A listing of all drivers who made more than 2 deliveries as well as a count of the number of deliveries B) A listing of all drivers C) A listing of the number of deliveries greater than 2 D) A listing of all drivers who made more than 2 deliveries

A) A listing of all drivers who made more than 2 deliveries as well as a count of the number of deliveries

What does the following SQL command do? insert into Customer_T values (001,'John Smith','231 West St','Boston','MA','02115'); A) Adds a new record to the Customer_T B) Creates the Customer_T table C) Deletes the Customer_T table D) Updates the Customer_T table

A) Adds a new record to the Customer_T

________ is a set of commands used to update and query a database. A) DML B) DDL C) DCL D) DPL

A) DML

What does the following SQL statement do? Delete from Customer_T where state = 'HI'; A) Deletes all records from customer_t where the state is equal to HI B) Removes the Customer_T table from the database C) Deletes all records from the Customer_T table D) None of the above

A) Deletes all records from customer_t where the state is equal to HI

To get all the customers from Hawaii sorted together, which of the following would be used? A) ORDER BY B) GROUP BY C) HAVING D) SORT

A) ORDER BY

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" B) Selects the "*" field from the Customer table for each row with a customer labeled "Best" C) Selects fields with a "*" in them from the Customer table D) Selects all the fields from the Customer table for each row with a customer labeled "*"

A) Selects all the fields from the Customer table for each row with a customer labeled "Best"

What result set will the following query return? Select Item_No from Order_V where quantity > 10; A) The Item_No of all orders that had more than 10 items B) The Order_Id of all orders that had more than one item C) The Order_Id of all orders that had more than 10 items D) The Item_No of all orders that had 10 or more items

A) The Item_No of all orders that had more than 10 items

What results will be produced by the following SQL query? Select sum(standard_price) as Total_Price from Product_V where Product_Type = 'WOOD'; A) The total price of all products that are of type wood B) The total price of all products C) The Standard_Price of the first wood product in the table D) The Standard_Price of any wood product in the table

A) The total price of all products that are of type wood

Multiple values returned from an SQL query that includes an aggregate function are called: A) vector aggregates. B) scalar aggregates. C) agates. D) summations.

A) vector aggregates.

Which of the following is the wildcard operator in SQL statements? A) < > B) * C) = D) &

B) *

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 all drivers, sorted by driver number B) A listing of each driver as well as the number of deliveries that he or she has made C) A count of all of the deliveries made by all drivers D) None of the above

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

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; A) A listing of all drivers who made deliveries to state = 'MA', sorted by driver number 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 C) A count of all of the deliveries made to state = 'MA' by all drivers D) None of the above

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

What does the following SQL statement do? Update Product_T Set Unit_Price = 775 Where Product_ID = 7 A) Changes the price of a unit called Product_T to 7 B) Changes the unit price of Product 7 to 775 C) Changes the length of the Unit_Price field to 775 D) Updates the Product_T table to have a unit price of 775

B) Changes the unit price of Product 7 to 775

Which of the following is a technique for optimizing the internal performance of the relational data model? A) Avoiding indexes on secondary keys B) Clustering data C) Not reporting statistics to save machine resources D) Using random index organizations

B) Clustering data

Which of the following counts ONLY rows that contain a value? A) Count B) Count(*) C) Tally(*) D) Checknum

B) Count(*)

35) Which of the following can produce scalar and vector aggregates? A) ORDER BY B) GROUP BY C) HAVING D) SORT

B) GROUP BY

Which of the following questions is answered by the SQL statement? Select Count (Product_Description) from Product_T; A) How many products are in the table Product_T? B) How many products have product descriptions in the Product Table? C) How many characters are in the field name "Product_Description"? D) How many different columns named "Product_Description" are there in table Product_T?

B) How many products have product descriptions in the Product Table?

DDL is typically used during which phases of the development process? A) Implementation B) Physical design C) Analysis D) All of the above

B) Physical design

Which of the following will produce the minimum of all standard prices? A) Select standard_price from Product_V where Standard_Price = min; B) Select min(standard_price) from Product_V; C) Select Standard_Price from min(Product_V); D) Select min(Standard_Price) from Product_V where Standard_Price = min(Standard_Price);

B) Select min(standard_price) from Product_V;

A major benefit of SQL as a standard is reduced training costs. T/F

T

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

T

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. T/F

T

SQL is both an American and international standard for database access. T/F

T

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 B) The Customer_Name and telephone of all customers living in either Boston, New York or Denver C) The Customer_Name and telephone of all customers living in Boston and New York and Denver D) The Customer_Name of all customers living in Boston, New York or Denver

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

What result will the following SQL statement produce? Select Avg(standard_price) as average from Product_V; A) The average of all products in Product_V B) The average Standard_Price of all products in Product_V C) The average price of all products D) None of the above

B) The average Standard_Price of all products in Product_V

Given a table named store with 5 fields: store_id, address, city, state, zip code, why Would the following insert command not work? insert into store values ('234 Park Street') A) It would work just fine. B) You must specify the fields to insert if you are only inserting some of the fields. C) There is no table keyword. D) None of the above.

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

The SQL command ________ adds one or more new columns to a table. A) create table B) alter table C) create view D) create relationship

B) alter table

To eliminate duplicate rows in a query, the ________ qualifier is used in the SQL Select command. A) alter B) distinct C) check D) specific

B) distinct

Any create command may be reversed by using a ________ command. A) truncate B) drop C) delete D) unpack

B) drop

A ________ view is materialized when referenced. A) virtual B) dynamic C) materialized D) base

B) dynamic

The first in a series of steps to follow when creating a table is to: A) identify columns that must be unique. B) identify each attribute and its characteristics. C) create an index. D) identify columns that must be null.

B) identify each attribute and its characteristics.

A single value returned from an SQL query that includes an aggregate function is called a(n): A) agate. B) scalar aggregate. C) vector aggregate. D) summation.

B) scalar aggregate.

The ________ is the structure that contains descriptions of objects such as tables and views created by users. A) SQL B) schema C) catalog D) master view

B) schema


Kaugnay na mga set ng pag-aaral

Care of Patients with Problems of the CNS: Brain

View Set

Saunders questions Mr. Keene exam 2 "med emergency"

View Set

Unit 4 | Fraction ↔ Decimal ↔ Percent (with Models)

View Set

Net260.30 Linux Administration Chapter 9

View Set

Chapter 2: The Chemical Context of Life (Multiple-Choice Questions), A.P. Biology Water Quiz, TEST PREP: Chapter 5; The Structure and Function of Large Biological Molecules, Campbell Biology; Tenth Edition, AP Biology Chapter 6 Multiple Choice

View Set