Ch. 4 Flashcards
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 table name
- a column name
- a WHERE clause
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
- It pauses until the user enters a value and presses
RETURN - It displays the text
enter a department ID code:
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
- FETCH NEXT 50 PERCENT ROWS ONLY
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 [ ]
- single quotes ‘ ‘
The % (percent symbol) is used to match ____.
- double character
- single character
- zero or more characters
- a number expressed as a percent
- zero or more characters
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.
False
If a WHERE clause returns no rows, an error message is displayed
False
Which of the following is a syntactically correct use of NOT? Select all that apply.
- NOT BETWEEN
- NOT IS NULL
- NOT IN
- NOT LIKE
- NOT BETWEEN
- NOT IN
- NOT LIKE
Which operator is used to compare a value to a specified list of values?
- ALL
- ANY
- IN
- BETWEEN
- IN
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
- 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
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
- SELECT * FROM EMP WHERE COMMISSION IS NOT NULL;
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
All are true