Topic 6 Flashcards
The SQL data manipulation command HAVING:
a. restricts the selection of rows based on a conditional expression.
b. restricts the selection of grouped rows based on a condition.
c. modifies an attribute’s values in one or more table’s rows.
d. groups the selected rows based on one or more attributes.
restricts the selection of grouped rows based on a condition
The SQL command that allows a user to permanently save data changes is _____
a. INSERT
b. SELECT
c. COMMIT
d. UPDATE
COMMIT
The _____ command defines a default value for a column when no value is given
a. CHECK
b. UNIQUE
c. NOT NULL
d. DEFAULT
DEFAULT
The _____ command restricts the selection of grouped rows based on a condition
a. DISPLAY
b. HAVING
c. FROM
d. CONVERT
HAVING
A (n) _____ query specifies which data should be retrieved and how it should be filtered, aggregated, and displayed
a. INSERT
b. SELECT
c. COMMIT
d. UPDATE
SELECT
A (n) _____ is an alternate name given to a column or table in any SQL statement
a. alias
b. data type
c. stored function
d. trigger
alias
According to the rules of precedence, which of the following computations should be completed first?
a. Additions and subtractions
b. Multiplications and divisions
c. Operations within parentheses
d. Power operations
Operations within parentheses
Which query is used to list a unique value for V_CODE, where the list will produce only a list of those values that are different from one another?
a. SELECT ONLY V_CODE FROM PRODUCT; b. SELECT UNIQUE V_CODE FROM PRODUCT; c. SELECT DIFFERENT V_CODE FROM PRODUCT; d. SELECT DISTINCT V_CODE FROM PRODUCT;
SELECT ONLY V_CODE
FROM PRODUCT;
When using a (n) _____ join, only rows from the tables that match on a common value are returned.
a. full
b. outer
c. inner
d. set
inner
A (n) _____ join will select only the rows with matching values in the common attribute(s)
a. natural
b. outer
c. full
d. cross
natural
If a designer wishes to create an inner join, but the two tables do not have a commonly named attribute, he can use a (n) _____ clause
a. OF
b. USING
c. HAS
d. JOIN ON
JOIN ON
A (n) _____ join returns not only the rows matching the join condition (that is, rows with matching values in the common columns) but also the rows with unmatched values
a. outer
b. inner
c. equi-
d. cross
outer
The syntax for a left outer join is _____
a. SELECT column-list FROM table1 OUTER JOIN table2 LEFT WHERE join-condition b. SELECT column-list FROM table1 LEFT [OUTER] JOIN table2 ON join-condition c. SELECT column-list WHERE LEFT table1 = table d. SELECT column-list FROM table1 LEFT table2 [JOIN] WHERE join-condition
SELECT column-list
FROM table1 LEFT [OUTER] JOIN table2
ON join-condition
A (n) _____ join performs a relational product (also known as the Cartesian product) of two tables
a. full
b. cross
c. natural
d. equi-
cross
How many rows would be returned from a cross join of tables A and B, if A contains 8 rows and B contains 18?
a. 8
b. 18
c. 26
d. 144
144