Database Analysis Chapters 5-7

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which of the following is the wildcard operator in SQL statements? < > * = &

*

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 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 the number of deliveries greater than 2 A listing of all drivers who made more than 2 deliveries

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

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

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

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 results would the following SQL statement produce? select owner, table_name from dba_tables where table_name = 'CUSTOMER' A listing of all customers in the customer table A listing of the owner of the customer table A listing of the owner of the customer table as well as customers An error message

A listing of the owner of the customer table

In which of the following situations would one have to use an outer join in order to obtain the desired results? A report is desired that lists all customers who placed an order. A report is desired that lists all customers and the total of their orders. 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). There is never a situation that requires only an outer join.

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

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

Adds a new record to the Customer_T

SQL-invoked routines can be: A) procedures. B) functions. C) All of the above. D) None of the above.

All of the above.

The benefits of a standardized relational language include: application longevity. reduced training costs. cross-system communication. All of these.

All of these

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

All of these

A factor to consider when choosing a file organization is: fast data retrieval. security. efficient storage. All of these.

All of these.

A method for handling missing data is to: substitute and estimate for the missing data. track missing data with special reports. perform sensitivity testing. All of these.

All of these.

A procedure is: stored within the database. given a unique name. called by name. All of these.

All of these.

A requirement to begin designing physical files and databases is: normalized relations. definitions of each attribute. technology descriptions. All of these.

All of these.

A rule of thumb for choosing indexes is to: be careful indexing attributes that may be null. index each primary key of each table. use an index when there is variety in attribute values. All of these.

All of these.

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

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

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

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? Avoiding indexes on secondary keys Clustering data Not reporting statistics to save machine resources Using random index organizations

Clustering data

________ use the result of the outer query to determine the processing of the inner query. Correlated subqueries Outer subqueries Inner subqueries Subqueries

Correlated subqueries

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

Count

The ________ DBA view shows information about all users of the database in Oracle. DBA_USERS USERS DBA_VIEWS DBA_INDEXES

DBA_USERS

________ is a set of commands used to control a database, which includes security. DML DDL DCL DPL

DCL

________ is a set of commands used to update and query a database. DML DDL DCL DPL

DML

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

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

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

EXEC SQL

________ takes a value of true if a subquery returns an intermediate results table which contains one or more rows. IN HAVING EXISTS EXTENTS

EXISTS

Which of the following can produce scalar and vector aggregates? Order By Group By Having Sort

Group By

In which type of file is multiple key retrieval not possible? Sequential Hashed Indexed Clustered

Hashed

Which type of file is easiest to update? Sequential Hashed Indexed Clustered

Hashed

Which of the following finds all groups meeting stated conditions? Select Where Having Find

Having

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

How many products have product descriptions in the Product Table?

Which of the following is an objective of selecting a data type? Represent a small number of possible values Maximize storage space Limit security Improve data integrity

Improve data integrity

To get all the customers from Hawaii sorted together, which of the following would be used? Order By Group By Having Sort

Order By

In which data model would a code table appear? Conceptual Logical Physical Data layout

Physical

DDL is typically used during which phases of the development process? Implementation Physical design Analysis All of these

Physical design

________ ensures that a value of a field exists in another database table. Null value control Referential integrity Domain integrity Index integrity

Referential integrity

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

Select min(standard_price) from Product_V;

What does the following SQL statement do? Select * From Customer Where Cust_Type = "Best" Selects all the fields from the Customer table for each row with a customer labeled "Best" Selects the "*" field from the Customer table for each row with a customer labeled "Best" Selects fields with a "*" in them from the Customer table Selects all the fields from the Customer table for each row with a customer labeled "*"

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

Which type of file is most efficient with storage space? Sequential Hashed Indexed Clustered

Sequential

EXISTS will take a value of ________ if the subquery returns an intermediate results table which contains one or more rows. FALSE 1 TRUE undefined

TRUE

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

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

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

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

The Item_No of all orders that had more than 10 items

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

The SELECT clause is processed before the ORDER BY clause.

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

The average Standard_Price of all products in Product_V

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

The first product description alphabetically in Product_V will be shown.

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

The total price of all products that are of type wood

The ________ clause is used to combine the output from multiple queries into a single result table. INTERSECT DIVIDE COLLATE UNION

UNION

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

Where

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') It would work just fine. You must specify the fields to insert if you are only inserting some of the fields. There is no table keyword. None of these.

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

All of the following are common denormalization opportunities EXCEPT: two entities with a one-to-one relationship. a one-to-many relationship. a many-to-many relationship with nonkey attributes. reference data.

a one-to-many relationship.

The SQL command ________ adds one or more new columns to a table. create table alter table create view create relationship

alter table

All of the following are valid datatypes in Oracle 11g EXCEPT: varchar2. boolean. blob. number.

boolean.

A join in which the joining condition is based on equality between values in the common columns is called a(n): equi-join. unilateral join. natural join. both equi-join and natural join.

both equi-join and natural join.

In order for two queries to be UNION-compatible, they must: both have the same number of lines in their SQL statements. both output compatible data types for each column and return the same number of rows. both return at least one row. All of these.

both output compatible data types for each column and return the same number of rows.

A join operation: brings together data from two different fields. causes two tables with a common domain to be combined into a single table or view. causes two disparate tables to be combined into a single table or view. is used to combine indexing operations.

causes two disparate tables to be combined into a single table or view.

Sensitivity testing involves: checking to see if your teeth hurt when you brush. seeing how accurate data are. checking to see if missing data will greatly impact results. None of these.

checking to see if missing data will greatly impact results.

The UNION clause is used to combine the output from multiple queries into a single result table. join two tables together to form one table. find all rows that do not match in two tables. None of these.

combine the output from multiple queries into a single result table.

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

correlated

The command for creating a database is: create table. create view. create schema. create authorization.

create schema

The SQL command ________ defines a logical table from one or more tables or views. create table alter table create view create relationship

create view

The storage format for each attribute from the logical data model is chosen to maximize ________ and minimize storage space. query design programmer productivity data integrity data integration

data integrity

A detailed coding scheme recognized by system software for representing organizational data is called a(n): DBMS code. data type. SQL. DB layout.

data type.

If the DBA wishes to describe all tables in the database, which data dictionary view should be accessed in Oracle? dba_tab_privs dba_tab_comments dba_table_label dba_tables

dba_tables

The value a field will assume unless the user enters an explicit value for an instance of that field is called a: default value. null value. range control. gurand.

default value.

A ________ is a temporary table used in the FROM clause of an SQL query. correlated subquery derived table view table None of these

derived table

Designing physical files requires ________ of where and when data are used in various ways. maps descriptions keys hints

descriptions

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

distinct

Any create command may be reversed by using a ________ command. truncate drop delete unpack

drop

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

dynamic

In most cases the goal of ________ dominates the design process. efficient data processing security quick pointer updates shorter design times

efficient data processing

A contiguous section of disk storage space is called a(n): track. sector. extent. tablespace.

extent.

The smallest unit of application data recognized by system software is a: field. row. data type. column.

field.

A(n) ________ is a technique for physically arranging the records of a file on secondary storage devices. physical pointer retrieval program file organization update program

file organization

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

hard-coded SQL statements included in a program written in another language.

A file organization that uses hashing to map a key into a location in an index where there is a pointer to the actual data record matching the hash key is called a: hashed file organization. hash key. multi-indexed file organization. hash index table.

hash index table.

A(n) ________ is a routine that converts a primary key value into a relative record number. record index calculator index pointer program hashing algorithm pointing algorithm

hashing algorithm

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

identify each attribute and its characteristics.

One major advantage of the outer join is that: information is easily accessible. information is not lost. the query is easier to write. All of these.

information is not lost.

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

is used to generate appropriate SQL code on the fly, as an application is processing.

An index on columns from two or more tables that come from the same domain of values is called a: bitmap index. multivalued index. join index. transaction index.

join index.

Explicit commands to manage transactions are needed when: a transaction consists of just one SQL command. multiple SQL commands must be run as part of a transaction. autocommit is set to off. None of these.

multiple SQL commands must be run as part of a transaction.

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): equi-join. natural join. multivariate join. inner join.

natural join.

The most commonly used form of join operation is the: outer join. union join. equi-join. natural join.

natural join.

While Oracle has responsibility for managing data inside a tablespace, the tablespace as a whole is managed by the: user. database administrator. application developer. operating system.

operating system.

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): natural join. equi-join. outer join. union join.

outer join.

A(n) ________ is a field of data used to locate a related field or record. key index lock pointer

pointer

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

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

A ________ limits the set of permissible values a field may assume. range control null value control primary key candidate key

range control

An integrity control supported by a DBMS is: substitute estimates. security. range control. GUI guards.

range control.

While triggers run automatically, ________ do not and have to be called. trapdoors routines selects updates

routines

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

scalar aggregate.

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

schema

One field or combination of fields for which more than one record may have the same combination of values is called a(n): secondary key. index. composite key. linked key.

secondary key.

All of the following are advantages of SQL-invoked routines EXCEPT: flexibility. efficiency. sharability. security.

security.

A key decision in the physical design process is: knowing the user base. selecting structures. deciding on the monitor. All of these.

selecting structures.

All of the following are part of the coding structure for triggers EXCEPT: event. condition. selection. action.

selection.

A type of join where a table is joined to itself is called a(n): unary join. self-join. unnatural join. pinned join.

self-join.

An operation to join a table to itself is called a(n): sufficient-join. inner join. outer join. self-join.

self-join.

An interactive command that can be used to dynamically control a user session for appropriate integrity measures is: rollback. rollforward. set autocommit. expunge.

set autocommit.

SQL provides the ________ technique, which involves placing an inner query within the WHERE or HAVING clause of an outer query. grouping joining subquery union

subquery

A type of query that is placed within a WHERE or HAVING clause of another query is called a: master query. subquery. superquery. multi-query.

subquery.

Within Oracle, the named set of storage elements in which physical files for database tables may be stored is called a(n): extent. table. tablespace. partition.

tablespace.

User-defined transactions can improve system performance because: transactions are processed as sets, reducing system overhead. transactions are mapped to SQL statements. speed is improved due to query optimization. All of these.

transactions are processed as sets, reducing system overhead.

A named set of SQL statements that are considered when a data modification occurs are called: stored procedures. treatments. triggers. trapdoors.

triggers.

All of the following are guidelines for better query design EXCEPT: understand how indexes are used in query processing. use a lot of self-joins. write simple queries. retrieve on the data that you need.

use a lot of self-joins.

All of the following are objectives when selecting a data type EXCEPT: represent all possible values. improve data integrity. support all data manipulations. use a lot of storage space.

use a lot of storage space.

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

vector aggregates.


Conjuntos de estudio relacionados

Personal Psychology 2 - Unit 7 Text Questions

View Set

PSYC 2301 General Psychology Quiz 6

View Set

****QUESTIONS THAT NEED REVIEW BEFORE EXAM *****

View Set