Ch. 4 Flashcards

1
Q

A substitution variable can be used to replace: (select all that apply)

  • a table name
  • a column name
  • a WHERE clause
  • ORDER BY options
A
  • a table name
  • a column name
  • a WHERE clause
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the following command do? Choose all that apply.

ACCEPT vDept_ID PROMPT ‘Enter a department ID code: ‘

  • It pauses until the user enters a value and presses RETURN
  • It causes an error because there is no ampersand (&) in front of vDept_ID
  • It displays the text Enter a department ID code:
  • It checks to see if the user entered a valid Dept_ID
A
  • It pauses until the user enters a value and presses
    RETURN
  • It displays the text
    enter a department ID code:
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following will complete this SELECT statement to return EXACTLY 50% of the resulting rows?

  • SELECT * FROM ORDERS
  • FETCH NEXT 50 ROWS ONLY
  • FETCH NEXT 50% ROWS ONLY
  • FETCH NEXT 50 PERCENT ROWS ONLY
  • FETCH NEXT 50 PERCENT ROWS WITH TIES
A
  • FETCH NEXT 50 PERCENT ROWS ONLY
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When using a substitution variable where the user will input a character string, such as first name or city, enclose the substitution variable in _____ to prevent errors when the statement is run.

  • parenthesis ( )
  • double quotes “ “
  • single quotes ‘ ‘
  • square brackets [ ]
A
  • single quotes ‘ ‘
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The % (percent symbol) is used to match ____.
- double character
- single character
- zero or more characters
- a number expressed as a percent

A
  • zero or more characters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

THE AND operator connects two conditions, one of which must be satisfied (must be true) in order for the row to be included in the result set.

A

False

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

If a WHERE clause returns no rows, an error message is displayed

A

False

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

Which of the following is a syntactically correct use of NOT? Select all that apply.

  • NOT BETWEEN
  • NOT IS NULL
  • NOT IN
  • NOT LIKE
A
  • NOT BETWEEN
  • NOT IN
  • NOT LIKE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which operator is used to compare a value to a specified list of values?

  • ALL
  • ANY
  • IN
  • BETWEEN
A
  • IN
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Consider the following WHERE clause:

WHERE ship_name LIKE ‘Viking%’

What is function of the percent sign after the word Viking? Select all that apply.

  • It means to find all names that have the word Viking followed by the character ‘%’
  • It is the Oracle wildcard symbol
  • It represents zero of more characters
  • It means to find all words that start with the word Viking followed by any characters
A
  • It is the Oracle wildcard symbol
  • It represents zero of more characters
  • It means to find all words that start with the word Viking followed by any characters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which SQL statement will not generate any error message?

  • SELECT * FROM EMP WHERE EMPNO LIKE (1, 2, 3, 4, 5);
  • SELECT * FROM EMP WHERE SAL BETWEEN 3000 TO 5000;
  • SELECT * FROM EMP WHERE COMMISSION IS NOT NULL;
  • All of the above
A
  • SELECT * FROM EMP WHERE COMMISSION IS NOT NULL;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following are true of the WHERE clause? Select all that apply.

  • The WHERE clause comes after the FROM clause
  • WHERE identifies which rows are to be included in the result set of the SELECT statement
  • WHERE may be used by SELECT, UPDATE, and DELETE statements
  • The WHERE clause is optional
A

All are true

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