DB SQL

Ace your homework & exams now with Quizwiz!

In databases, null values are equivalent to zero.

FALSE

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

FALSE

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

OLAP functions.

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:

Persistent Stored Modules.

DDL is typically used during which phase of the development process?

Physical design

Relational databases are heavily based on the mathematical concept of:

Set Theory.

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.

TRUE

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

TRUE

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

TRUE

One of the original purposes of the SQL standard was to provide a vehicle for portability of database definition and application modules between conforming DBMSs.

TRUE

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

TRUE

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

TRUE

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

TRUE

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

TRUE

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

TRUE

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

TRUE

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

TRUE

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

TRUE

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

TRUE

What result will the following SQL statement produce? Select Avg(standard_price) as average from Product_V

The average Standard_Price of all products in Product_V

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

To specify syntax and semantics of SQL data definition and manipulation

Given a table named store with 5 fields: store_id, address, city, state, zipcode, why would the following insert command not work? insert into store values ('234 Park Street')

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

The command for creating a database is:

create schema.

The most commonly used form of join operation is the:

natural join.

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

selection.

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

use a lot of self-joins.

6SQL originated from a project called System-S.

FALSE

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

FALSE

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

FALSE

4Requiring a CustomerID to exist in a Primary table before it can exist in a foreign table is an example of:

Referential Integrity.

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

*

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

The SELECT clause is processed before the ORDER BY clause.

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

A procedure is:

called by name.

SQL-invoked routines can be:

functions or procedures.

A view may not be updated directly if it contains:

the HAVING clause.

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

triggers.

________ differs from array because it can contain duplicates.

MULTISET

A procedure is run by calling it by its name.

TRUE

Explicit commands to manage transactions are needed when:

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

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

routines

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

using the CASE keyword in a statement.

All of the following are new data types added in SQL:2008 EXCEPT:

BIT.

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

DBA_TABLES

The main concept of relational databases was published in 1970 by:

E.F.Codd.

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

EXEC SQL

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

EXISTS

Which of the following can produce scalar and vector aggregates?

GROUP BY

Which of the following questions is answered by the SQL statement? Select Count (Product_Description) from Product_T

How many products have product descriptions in the Product Table?

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

TRUE

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

TRUE

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

TRUE

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

TRUE

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

TRUE

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

TRUE

Combining a table with itself results in a faster query.

FALSE

Subqueries can only be used in the WHERE clause.

FALSE

The natural join is very rarely used.

FALSE

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

FALSE

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

FALSE

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

FALSE

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.

TRUE

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

TRUE

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

TRUE

User-defined data types:

can have defined functions and methods.

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

derived table

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

distinct

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

two

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

undefined

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

FALSE

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

FALSE

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

FALSE

DBA_USERS contains comments on all tables in an Oracle database.

FALSE

DCL is used to update the database with new records.

FALSE

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

FALSE

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

FALSE

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"

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.

TRUE

Adding the DISTINCT keyword to a query eliminates duplicates.

TRUE

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

TRUE

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

TRUE

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

TRUE

Constraints are a special case of triggers.

TRUE

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

TRUE

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

TRUE

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

both A and C.

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

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

A join operation:

causes two tables with a common domain to be combined into a single table or view.

The UNION clause is used to:

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

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

create view

The benefits of a standardized relational language include:

cross-system communication.

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

subquery

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

subquery.

User-defined transactions can improve system performance because:

transactions are processed as sets, reducing system overhead.

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

vector aggregates.

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

Count

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

DBA_USERS

________ is a set of commands used to control a database, including security.

DCL

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

FALSE

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

FALSE

A referential integrity constraint specifies that the existence of an attribute in one table depends upon the existence of a foreign key in the same or another table.

FALSE

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

FALSE

The first part of an SQL query to be read is the ________ statement.

FROM

The last part of an SQL query to be read is the ________ statement.

ORDER BY

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

ORDER BY

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

Select min(standard_price) from Product_V;

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

TRUE

The MERGE command:

allows one to combine the INSERT and UPDATE operations.

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

alter table

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

drop

Indexes are created in most RDBMSs to:

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

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

scalar aggregate.

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

schema

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

security.

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

self-join.

A join in which the joining condition is based on equality between values in the common column is called an equi-join.

TRUE

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

TRUE

Embedded SQL consists of:

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

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

TRUE

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

set autocommit.

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

FALSE

MULTISET is similar to the table datatype.

FALSE

Materialized views are stored on disk and are never refreshed.

FALSE

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

FALSE

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

FALSE

Which of the following finds all groups meeting stated conditions?

Having

Referential Integrity Constraints are generally established between:

Primary and Foreign keys.

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

TRUE

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

UNION

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

Where

A ________ view is materialized when referenced.

dynamic

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

identify each attribute and its characteristics.

One major advantage of the outer join is that:

information is not lost.

Dynamic SQL:

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

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

natural join.

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

outer join.

RANK and DENSE-RANK are examples of:

window functions.

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

FALSE

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

FALSE

The following insert command would work fine: insert into budget values 121,222,111

FALSE

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.

FALSE

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

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

Clustering data

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

Correlated subqueries

INSERT INTO is an example of ________ code.

DML

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

DML

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

FALSE

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

FALSE

Implementation of a standard can never stifle creativity and innovation.

FALSE

Indexes generally slow down access speed in most RDMS.

FALSE

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.

FALSE

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

FALSE

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.

FALSE

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

FALSE

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

FALSE

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

FALSE

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

FALSE

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

FALSE

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

TRUE

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

TRUE

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.

TRUE

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.

TRUE

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

TRUE

An operation to join a table to itself is called a(n):

self-join.


Related study sets

MANA 3335 (9-13) Learn it & Assignment Questions

View Set

psyc108 chapter quizzes review for exam 1 (1,2,3,14)

View Set