DB SQL

25 July 2022
4.7 (114 reviews)
165 test answers

Unlock all answers in this set

Unlock answers (161)
question
The ________ is the structure that contains descriptions of objects such as tables and views created by users.
answer
schema
question
________ is a set of commands used to control a database, including security.
answer
DCL
question
________ is a set of commands used to update and query a database.
answer
DML
question
DDL is typically used during which phase of the development process?
answer
Physical design
question
The main concept of relational databases was published in 1970 by:
answer
E.F.Codd.
question
Relational databases are heavily based on the mathematical concept of:
answer
Set Theory.
question
The command for creating a database is:
answer
create schema.
question
The SQL command ________ defines a logical table from one or more tables or views.
answer
create view
question
Any create command may be reversed by using a(n) ________ command.
answer
drop
question
The first in a series of steps to follow when creating a table is to:
answer
identify each attribute and its characteristics.
question
The SQL command ________ adds one or more new columns to a table.
answer
alter table
question
INSERT INTO is an example of ________ code.
answer
DML
question
What does the following SQL command do? insert into Customer_T values (001,'John Smith','231 West St','Boston','MA','02115')
answer
Adds a new record to the Customer_T
question
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')
answer
You must specify the fields to insert if you are only inserting some of the fields.
question
Which of the following is a technique for optimizing the internal performance of the relational data model?
answer
Clustering data
question
Indexes are created in most RDBMSs to:
answer
provide rapid random and sequential access to base-table data.
question
In an SQL statement, which of the following parts states the conditions for row selection?
answer
Where
question
The first part of an SQL query to be read is the ________ statement.
answer
FROM
question
The last part of an SQL query to be read is the ________ statement.
answer
ORDER BY
question
What does the following SQL statement do? Select * From Customer Where Cust_Type = "Best"
answer
Selects all the fields from the Customer table for each row with a customer labeled "Best"
question
What result will the following SQL statement produce? Select Avg(standard_price) as average from Product_V
answer
The average Standard_Price of all products in Product_V
question
Which of the following questions is answered by the SQL statement? Select Count (Product_Description) from Product_T
answer
How many products have product descriptions in the Product Table?
question
Which of the following counts ONLY rows that contain a value?
answer
Count
question
Which of the following will produce the minimum of all standard prices?
answer
Select min(standard_price) from Product_V;
question
Which of the following is the wildcard operator in SQL statements?
answer
*
question
To eliminate duplicate rows in a query, the ________ qualifier is used in the SQL Select command.
answer
distinct
question
To get all the customers from Hawaii sorted together, which of the following would be used?
answer
ORDER BY
question
A single value returned from an SQL query that includes an aggregate function is called a(n):
answer
scalar aggregate.
question
Multiple values returned from an SQL query that includes an aggregate function are called:
answer
vector aggregates.
question
Which of the following can produce scalar and vector aggregates?
answer
GROUP BY
question
Which of the following finds all groups meeting stated conditions?
answer
Having
question
Which of the following is true of the order in which SQL statements are evaluated?
answer
The SELECT clause is processed before the ORDER BY clause.
question
A ________ view is materialized when referenced.
answer
dynamic
question
A view may not be updated directly if it contains:
answer
the HAVING clause.
question
4Requiring a CustomerID to exist in a Primary table before it can exist in a foreign table is an example of:
answer
Referential Integrity.
question
Referential Integrity Constraints are generally established between:
answer
Primary and Foreign keys.
question
Which of the following is a purpose of the SQL standard?
answer
To specify syntax and semantics of SQL data definition and manipulation
question
The benefits of a standardized relational language include:
answer
cross-system communication.
question
A catalog is the structure that contains object descriptions created by a user.
answer
FALSE
question
DCL is used to update the database with new records.
answer
FALSE
question
A database table is defined using the data definition language (DDL).
answer
TRUE
question
A database is maintained and queried using the data mapping language (DML).
answer
FALSE
question
The content of dynamic views is generated when they are referenced.
answer
TRUE
question
Materialized views are stored on disk and are never refreshed.
answer
FALSE
question
The views are created by executing a CREATE VIEW SQL command.
answer
TRUE
question
When the SELECT clause in the create view statement contains the keyword DISTINCT, the view can be used to update data.
answer
FALSE
question
The CREATE SCHEMA DDL command is used to create a table.
answer
FALSE
question
SQL is both an American and international standard for database access.
answer
TRUE
question
SQL has been implemented only in the mainframe and midrange environments.
answer
FALSE
question
6SQL originated from a project called System-S.
answer
FALSE
question
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
question
A major benefit of SQL as a standard is reduced training costs.
answer
TRUE
question
Implementation of a standard can never stifle creativity and innovation.
answer
FALSE
question
Applications can be moved from one machine to another when each machine uses SQL.
answer
TRUE
question
Some DBMS can handle graphic data types as well as text and numbers.
answer
TRUE
question
When creating tables, it's important to decide which columns will allow null values before the table is created.
answer
TRUE
question
In databases, null values are equivalent to zero.
answer
FALSE
question
The DELETE TABLE DDL command is used to remove a table from the database.
answer
FALSE
question
The ALTER TABLE command is used to change a table definition.
answer
TRUE
question
The SQL command used to populate tables is the INSERT command.
answer
TRUE
question
An insert command does not need to have the fields listed.
answer
TRUE
question
The following insert command would work fine: insert into budget values 121,222,111
answer
FALSE
question
The DROP command deletes rows from a table individually or in groups.
answer
FALSE
question
In order to update data in SQL, one must inform the DBMS which relation, columns, and rows are involved.
answer
TRUE
question
Indexes generally slow down access speed in most RDMS.
answer
FALSE
question
Expressions are mathematical manipulations of data in a table that may be included as part of the SELECT statement.
answer
TRUE
question
Count(*) tallies only those rows that contain a value, while Count counts all rows.
answer
FALSE
question
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
question
The comparison operators = and != are used to establish a range of values.
answer
FALSE
question
If multiple Boolean operators are used in an SQL statement, NOT is evaluated first, then AND, then OR.
answer
TRUE
question
Adding the DISTINCT keyword to a query eliminates duplicates.
answer
TRUE
question
The ORDER BY clause sorts the final results rows in ascending or descending order.
answer
TRUE
question
A single value returned from an SQL query that includes an aggregate function is called a vector aggregate.
answer
FALSE
question
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
question
The HAVING clause and the WHERE clause perform the same operation.
answer
FALSE
question
The ORDER BY clause is the first statement processed in an SQL command.
answer
FALSE
question
The WHERE clause is always processed before the GROUP BY clause when both occur in a SELECT statement.
answer
FALSE
question
The FROM clause is the first statement processed in an SQL command.
answer
TRUE
question
When creating a table, it is not important to consider foreign key—primary key mates.
answer
FALSE
question
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
question
Embedded SQL consists of:
answer
hard-coded SQL statements included in a program written in another language.
question
In order to embed SQL inside of another language, the ________ statement must be placed before the SQL in the host language.
answer
EXEC SQL
question
Dynamic SQL:
answer
is used to generate appropriate SQL code on the fly as an application is processing.
question
The ________ operator is used to combine the output from multiple queries into a single result table.
answer
UNION
question
A ________ is a temporary table used in the FROM clause of an SQL query.
answer
derived table
question
In order for two queries to be UNION-compatible, they must:
answer
both output compatible data types for each column and return the same number of rows.
question
The UNION clause is used to:
answer
combine the output from multiple queries into a single result table.
question
Establishing IF-THEN-ELSE logical processing within an SQL statement can be accomplished by:
answer
using the CASE keyword in a statement.
question
All of the following are guidelines for better query design EXCEPT:
answer
use a lot of self-joins.
question
Explicit commands to manage transactions are needed when:
answer
multiple SQL commands must be run as part of a transaction.
question
User-defined transactions can improve system performance because:
answer
transactions are processed as sets, reducing system overhead.
question
An interactive command that can be used to dynamically control a user session for appropriate integrity measures is:
answer
set autocommit.
question
A join operation:
answer
causes two tables with a common domain to be combined into a single table or view.
question
A join in which the joining condition is based on equality between values in the common columns is called a(n):
answer
both A and C.
question
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):
answer
natural join.
question
The most commonly used form of join operation is the:
answer
natural join.
question
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):
answer
outer join.
question
The outer join syntax does not apply easily to a join condition of more than ________ tables.
answer
two
question
In which of the following situations would one have to use an outer join in order to obtain the desired results?
answer
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).
question
One major advantage of the outer join is that:
answer
information is not lost.
question
An operation to join a table to itself is called a(n):
answer
self-join.
question
A type of join where a table is joined to itself is called a(n):
answer
self-join.
question
A type of query that is placed within a WHERE or HAVING clause of another query is called a:
answer
subquery.
question
SQL provides the ________ technique, which involves placing an inner query within the WHERE or HAVING clause of an outer query.
answer
subquery
question
________ takes a value of TRUE if a subquery returns an intermediate results table which contains one or more rows.
answer
EXISTS
question
EXISTS will take a value of ________ if the subquery returns an intermediate results table which contains one or more rows.
answer
undefined
question
In SQL, a(n) ________ subquery is a type of subquery in which processing the inner query depends on data from the outer query.
answer
correlated
question
________ use the result of the outer query to determine the processing of the inner query.
answer
Correlated subqueries
question
The ________ DBA view shows information about all users of the database in Oracle.
answer
DBA_USERS
question
If the DBA wishes to describe all tables in the database, which data dictionary view should be accessed in Oracle?
answer
DBA_TABLES
question
A named set of SQL statements that are considered when a data modification occurs are called:
answer
triggers.
question
All of the following are part of the coding structure for triggers EXCEPT:
answer
selection.
question
While triggers run automatically, ________ do not and have to be called.
answer
routines
question
SQL-invoked routines can be:
answer
functions or procedures.
question
All of the following are advantages of SQL-invoked routines EXCEPT:
answer
security.
question
A procedure is:
answer
called by name.
question
User-defined data types:
answer
can have defined functions and methods.
question
A new set of analytical functions added in SQL:2008 is referred to as:
answer
OLAP functions.
question
RANK and DENSE-RANK are examples of:
answer
window functions.
question
All of the following are new data types added in SQL:2008 EXCEPT:
answer
BIT.
question
________ differs from array because it can contain duplicates.
answer
MULTISET
question
The MERGE command:
answer
allows one to combine the INSERT and UPDATE operations.
question
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:
answer
Persistent Stored Modules.
question
The UNION clause is used to combine the output from multiple queries into a single result table.
answer
TRUE
question
IF-THEN-ELSE logical processing cannot be accomplished within an SQL statement.
answer
FALSE
question
Figuring out what attributes you want in your query before you write the query will help with query writing.
answer
TRUE
question
It is better not to have a result set identified before writing GROUP BY and HAVING clauses for a query.
answer
FALSE
question
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
question
Combining a table with itself results in a faster query.
answer
FALSE
question
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
question
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
question
An equi-join is a join in which one of the duplicate columns is eliminated in the result table.
answer
FALSE
question
A join in which the joining condition is based on equality between values in the common column is called an equi-join.
answer
TRUE
question
The joining condition of an equi-join is based upon an equality.
answer
TRUE
question
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
question
The natural join is very rarely used.
answer
FALSE
question
An SQL query that implements an outer join will return rows that do not have matching values in common columns.
answer
TRUE
question
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
question
One major disadvantage of the outer join is that information is easily lost.
answer
FALSE
question
There is a special operation in SQL to join a table to itself.
answer
FALSE
question
Joining tables or using a subquery may produce the same result.
answer
TRUE
question
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
question
EXISTS takes a value of false if the subquery returns an intermediate result set.
answer
FALSE
question
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
question
A subquery in which processing the inner query depends on data from the outer query is called a codependent query.
answer
FALSE
question
A correlated subquery is executed once for each iteration through the outer loop.
answer
TRUE
question
Subqueries can only be used in the WHERE clause.
answer
FALSE
question
Correlated subqueries are less efficient than queries that do not use nesting.
answer
TRUE
question
When a subquery is used in the FROM clause, it is called a denied table.
answer
FALSE
question
RDBMSs store database definition information in system-created tables which can be considered a data dictionary.
answer
TRUE
question
DBA_USERS contains comments on all tables in an Oracle database.
answer
FALSE
question
SQL statements can be included in another language, such as C or Java.
answer
TRUE
question
A routine is a named set of SQL statements that are considered when a data modification occurs.
answer
FALSE
question
Constraints are a special case of triggers.
answer
TRUE
question
Triggers can be used to ensure referential integrity, enforce business rules, create audit trails and replicate tables, but cannot call other triggers.
answer
FALSE
question
A function has only input parameters but can return multiple values.
answer
FALSE
question
The advantages of SQL-invoked routines are flexibility, efficiency, shareability and applicability.
answer
TRUE
question
A procedure is run by calling it by its name.
answer
TRUE
question
A trigger is a named set of SQL statements that are considered when a data modification occurs.
answer
TRUE
question
SQL:2008 allows one to calculate linear regressions, moving averages and correlations without moving the data outside of the database.
answer
TRUE
question
MULTISET is similar to the table datatype.
answer
FALSE
question
Persistent Stored Modules are extensions defined in SQL:1999 that include the capability to add and drop modules of code.
answer
TRUE
question
Establishing IF-THEN-ELSE logical processing within an SQL statement can now be accomplished by using the CASE keyword in a statement.
answer
TRUE
question
User-defined functions can improve system performance because they will be processed as sets rather than individually, thus reducing system overhead.
answer
FALSE
question
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