Topic 6 Flashcards

1
Q

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.

A

restricts the selection of grouped rows based on a condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The SQL command that allows a user to permanently save data changes is _____

a. INSERT
b. SELECT
c. COMMIT
d. UPDATE

A

COMMIT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The _____ command defines a default value for a column when no value is given

a. CHECK
b. UNIQUE
c. NOT NULL
d. DEFAULT

A

DEFAULT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The _____ command restricts the selection of grouped rows based on a condition

a. DISPLAY
b. HAVING
c. FROM
d. CONVERT

A

HAVING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

SELECT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

alias

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A

Operations within parentheses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

SELECT ONLY V_CODE

FROM PRODUCT;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

inner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A (n) _____ join will select only the rows with matching values in the common attribute(s)

a. natural
b. outer
c. full
d. cross

A

natural

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

JOIN ON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

A

outer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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
A

SELECT column-list
FROM table1 LEFT [OUTER] JOIN table2
ON join-condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A (n) _____ join performs a relational product (also known as the Cartesian product) of two tables

a. full
b. cross
c. natural
d. equi-

A

cross

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

144

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which comparison operator indicates a value is not equal?

a. <
b. <=
c. >=
d. <>

A

<>

17
Q

What type of command does this SQL statement use?

SELECT P_CODE, P_DESCRIPT, P_PRICE_V_NAME
FROM PRODUCT, VENDOR
WHERE PRODUCT.V_CODE=VENDOR. V_CODE

a. set operator
b. natural join
c. “old-style” join
d. procedural statement

A

“old-style” join

18
Q

The special operator used to check whether an attribute value is within a range of values is _____

a. BETWEEN
b. NULL
c. LIKE
d. IN

A

BETWEEN

19
Q

The special operator used to check whether an attribute value matches a given string pattern is _____

a. BETWEEN
b. IS NULL
c. LIKE
d. IN

A

LIKE

20
Q

The SQL aggregate function that gives the number of rows containing non-null values for a given column is _____

a. COUNT
b. MIN
c. MAX
d. SUM

A

COUNT

21
Q

A (n) _____ is a query that is embedded (or nested) inside another query

a. alias
b. operator
c. subquery
d. view

A

subquery

22
Q

In subquery terminology, the first query in the SQL statement is known as the _____ query

a. outer
b. left
c. inner
d. base

A

outer

23
Q

The special operator used to check whether a subquery returns any rows is _____

a. BETWEEN
b. EXISTS
c. LIKE
d. IN

A

EXISTS

24
Q

Which is a feature of a correlated subquery?

a. The inner subquery executes first.
b. The outer subquery initiates the process of execution in a subquery.
c. The inner subquery initiates the process of execution in a subquery.
d. The outer subquery executes independent of the inner subquery.

A

The outer subquery initiates the process of execution in a subquery

25
Q

The _____ function returns the current system date in MS Access

a. TO_DATE()
b. SYSDATE()
c. DATE()
d. TODAY()

A

DATE()

26
Q

When using the Oracle TO_DATE function, the code _____ represents a three-letter month name

a. MON
b. MM3
c. MONTH
d. MM

A

MON

27
Q

_____ is a string function that returns the number of characters in a string value

a. LENGTH
b. SUBSTRING
c. CONCAT
d. UCASE

A

LENGTH

28
Q

The Oracle _____ function compares an attribute or expression with a series of values and returns an associated value or a default value if no match is found

a. NVL
b. TO_CHAR
c. DECODE
d. CONVERT

A

DECODE

29
Q

In Oracle, the _____ function converts a date to a character string

a. CONVERT()
b. TO_DATE
c. TO_CHAR()
d. TO_STRING()

A

TO_CHAR()

30
Q

_____ is a relational set operator

a. EXCEPT
b. PLUS
c. ALL
d. EXISTS

A

EXCEPT