Ch 6 use for mergin
The joining condition of an equi-join is based upon an equality. T/F
T
One major advantage of the outer join is that: A) information is easily accessible. B) information is not lost. C) the query is easier to write. D) information's data type changes.
b
The ________ operator is used to combine the output from multiple queries into a single result table. DIVIDE UNION COLLATE INTERSECT
b
All of the following are part of the coding structure for triggers EXCEPT: A) event. B) condition. C) selection. D) action
c
A join in which the joining condition is based on equality between values in the common columns is called a(n): A) equi-join. B) unilateral join. C) natural join. D) both A and C.
d
An operation to join a table to itself is called a(n): A) sufficient-join. B) inner join. C) outer join. D) self-join.
d
In order for two queries to be UNION-compatible, they must: both return at least one row. both have the same number of lines in their SQL statements. both return exactly one row. both output compatible data types for each column and return the same number of rows.
d
The most commonly used form of join operation is the: A) outer join. B) union join. C) equi-join. D) natural join.
d
A procedure is: A) stored outside the database. B) given a reserved SQL name. C) called by name. D) unable to be modified.
C
A function has only input parameters but can return multiple values. T/F
F
A routine is a named set of SQL statements that are considered when a data modification occurs. T/F
F
A subquery in which processing the inner query depends on data from the outer query is called a codependent query. T/F
F
IF-THEN-ELSE logical processing cannot be accomplished within an SQL statement. T/F
F
The following code is an example of a correlated subquery. SELECT CustomerName, CustomerAddress, CustomerCity, CustomerState, CustomerPostalCode FROM Customer_T WHERE Customer_T.CustomerID = (SELECT Order_T.CustomerID FROM Order_T WHERE OrderID = 1008); T/F
F
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'); T/F
F
The natural join is very rarely used. T/F
F
There is a special operation in SQL to join a table to itself. T/F
F
Triggers can be used to ensure referential integrity, enforce business rules, create audit trails, and replicate tables, but cannot call other triggers. T/F
F
User-defined functions can improve system performance because they will be processed as sets rather than individually, thus reducing system overhead. T/F
F
Using an outer join produces this information: rows that do not have matching values in common columns are not included in the result table. T/F
F
When a subquery is used in the FROM clause, it is called a denied table. T/F
F
A dynamic query is created by the user. T/F
T
A join in which the joining condition is based on equality between values in the common column is called an equi-join. T/F
T
A materialized view is not persistent. T/F
T
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. T/F
T
A procedure is run by calling it by its name. T/F
T
A trigger is a named set of SQL statements that are considered when a data modification occurs. T/F
T
An SQL query that implements an outer join will return rows that do not have matching values in common columns. T/F
T
Constraints are a special case of triggers. T/F
T
Correlated subqueries are less efficient than queries that do not use nesting. T/F
T
Establishing IF-THEN-ELSE logical processing within an SQL statement can now be accomplished by using the CASE keyword in a statement. T/F
T
Figuring out what attributes you want in your query before you write the query will help with query writing. T/F
T
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. T/F
T
Joining tables or using a subquery may produce the same result. T/F
T
SQL allows one to calculate linear regressions, moving averages, and correlations without moving the data outside of the database. T/F
T
The advantages of SQL-invoked routines are flexibility, efficiency, sharability, and applicability. T/F
T
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); T/F
T
The following queries produce the same results. SELECT DISTINCT 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'); t/F
T
Triggers have three parts: the event, the condition, and the action. T/F
T
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. T/F
T
A type of join between three tables is called a(n): A) ternary join. B) self-join. C) unnatural join. D) pinned join.
a
In SQL, a(n) ________ subquery is a type of subquery in which processing the inner query depends on data from the outer query. A) correlated B) paired C) natural D) inner
a
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 are in one table, but not the other. find all rows that do not match in two tables.
a
The ________ DBA view shows information about all users of the database in Oracle. A) DBA_USERS B) USERS C) DBA_VIEWS D) DBA_INDEXES
a
The ________ operator is used to combine the output from multiple queries into a single result table. UNION DIVIDE COLLATE INTERSECT
a
The following code would include: SELECT Customer_T.CustomerID,CustomerName, OrderID FROM Customer_T RIGHT OUTER JOIN Order_T ON Customer_T.CustomerID = Order_T.CustomerID; all rows of the Order_T Table regardless of matches with the Customer_T Table. all rows of the Customer_T Table regardless of matches with the Order_T Table. only rows that match both Customer_T and Order_T Tables. only rows that don't match both Customer_T and Order_T Tables.
a
The following code would include: SELECT Customer_T.CustomerID,CustomerName, OrderID FROM Customer_T RIGHT OUTER JOIN Order_T ON Customer_T.CustomerID = Order_T.CustomerID; A) all rows of the Order_T Table regardless of matches with the Customer_T Table. B) all rows of the Customer_T Table regardless of matches with the Order_T Table. C) only rows that match both Customer_T and Order_T Tables. D) only rows that don't match both Customer_T and Order_T Tables.
a
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): A) equi-join. B) natural join. C) multivariate join. D) inner join.
b
A named set of SQL statements that are considered when a data modification occurs are called: trapdoors. triggers. treatments. stored procedures.
b
A type of query that is placed within a WHERE or HAVING clause of another query is called a: A) master query. B) subquery. C) superquery. D) multi-query.
b
All of the following are guidelines for better query design EXCEPT: write simple queries. use a lot of self-joins. understand how indexes are used in query processing. retrieve only the data that you need.
b
Establishing IF-THEN-ELSE logical processing within an SQL statement can be accomplished by: using the immediate if statement. using the CASE key word in a statement. using a subquery. using the if-then-else construct.
b
SQL-invoked routines can be: A) part of a DDL statement. B) functions or procedures. C) part of a DCL statement. D) contained within a CREATE statement.
b
The MERGE command: A) allows one to combine the INSERT and UPDATE operations. B) allows one to combine the INSERT and DELETE operations. C) joins 2 tables together. D) is always a single table operation.
b
The following code would include: SELECT Customer_T.CustomerID,CustomerName, OrderID FROM Customer_T LEFT OUTER JOIN Order_T ON Customer_T.CustomerID = Order_T.CustomerID; A) all rows of the Order_T Table regardless of matches with the Customer_T Table. B) all rows of the Customer_T Table regardless of matches with the Order_T Table. C) only rows that match both Customer_T and Order_T Tables. D) only rows that don't match both Customer_T and Order_T Tables.
b
The following statement is an example of: CREATE TABLE Customer_t ( CustNmbr number(11,0), CreditLimit number(6,2), CustStart date, CustEnd date, PERIOD for Custperiod(CustStart,CustEnd)); A) a materialized view. B) an application time period table. C) a system-versioned table. D) a dynamic view.
b
What would the following view contain for values? Create view CustomerOrders as Select CustID, Count(*) as TotOrders, Sum(ordertotal) as Value From customer inner join sale on customer.customer_id = sale.customer_id; A) A listing of all customers in the customer table B) A listing of the customer ID as well as the total number of orders and the total amount spent by the customer C) A listing of the customer ID as well as the total orders D) An error message
b
While triggers run automatically, ________ do not and have to be called. A) trapdoors B) routines C) selects D) updates
b
A ________ is a temporary table used in the FROM clause of an SQL query. trigger view table derived table correlated subquery
c
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): equi-join. natural join. outer join. union join.
c
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): A) natural join. B) equi-join. C) outer join. D) union join.
c
A join operation: brings together data from two different fields. is used to combine indexing operations. 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.
c
A materialized view is/are: A) a virtual table created dynamically on request by a user. B) an in-line query. C) copies or replica of data based on queries. D) always an exact copy of the source table.
c
EXISTS will take a value of ________ if the subquery returns an intermediate results table which contains one or more rows. A) false B) 1 C) true D) undefined
c
In which of the following situations would one have to use an outer join in order to obtain the desired results? A) A report is desired that lists all customers who placed an order. B) A report is desired that lists all customers and the total of their orders. C) 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). D) There is never a situation that requires only an outer join
c
SQL provides the ________ technique, which involves placing an inner query within the WHERE or HAVING clause of an outer query. A) grouping B) joining C) subquery D) union
c
User-defined data types: A) are not allowed in any DBMS. B) are only allowed in Oracle. C) can have defined functions and methods. D) can be used once in a system.
c
________ takes a value of TRUE if a subquery returns an intermediate results table which contains one or more rows. A) IN B) HAVING C) EXISTS D) EXTENTS
c
A new set of analytical functions added in SQL:2008 is referred to as: A) OLAF functions. B) MOLAP functions. C) average functions. D) OLAP functions
d
All of the following are advantages of SQL-invoked routines EXCEPT: flexibility. efficiency. sharability. security.
d
The following code is an example of a(n): SELECT Customer_T.CustomerID, Order_T.CustomerID, CustomerName, OrderID FROM Customer_T, Order_T WHERE Customer_T.CustomerID = Order_T. CustomerID; subquery. Full Outer JOIN. Right Outer JOIN. Equi-join
d
When a user creates a virtual table it is called a(n): A) materialized view. B) virtual table. C) inline view. D) dynamic view.
d
________ use the result of the inner query to determine the processing of the outer query. A) Correlated subqueries B) Outer subqueries C) Inner subqueries D) Subqueries
d
MULTISET is similar to the table datatype. T/F
F
One major disadvantage of the outer join is that information is easily lost T/F
F
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. T/F
F
Subqueries can only be used in the WHERE clause. T/F
F
The UNION clause is used to combine the output from multiple queries into a single result table. T/F
t
A base table is the underlying table that is used to create views. T/F
T
A correlated subquery is executed once for each iteration through the outer loop. T/F
T