AIT 524 - WK 7 (SQL Queries)
Which of the following keywords can be used to indicate that a column alias should be included in the results? a. FROM b. ALIAS c. SELECT d. AS
AS
Which of the following statements is correct? a. The columns will be listed in the results in the same order they are stored in the database table. b. Character columns are listed first in the output, followed by numeric columns. c. The columns will be listed in the results in the same order they are listed in the SELECT clause of the SELECT statement. d. Numeric columns are listed first in the output, followed by character columns.
C. The columns will be listed in the results in the same order they are listed in the SELECT clause of the SELECT statement.
Which of the following symbols represents all the columns contained in a table?
*
What is the correct answer for the arithmetic expression 9+2*3-2 using the order of operations employed by Oracle 12c when solving equations?
13
What is the correct solution for the arithmetic expression 2+8/2*9/3 using the order of operations employed by Oracle 12c when solving equations?
14
What is the correct solution for the arithmetic expression (2+8)/2*9/3 using the order of operations employed by Oracle 12c when solving equations?
15
A query can be executed in the SQL*Plus tool. True False
True
In a(n) SELECT statement, keywords, table names, and column names are not case sensitive.
True
Parentheses can be used to override the order of operations in an arithmetic expression.
True
The majority of operations performed on a typical database table utilize the SELECT statement.
True
When a user asks the database a question, the user is issuing a query.
True
The ____________________ keyword can be included in a SELECT statement to suppress the display of duplicate data.
UNIQUE or DISTINCT
Which of the following types of columns will automatically left-align the column heading when it is displayed? a. both a and c b. date c. numeric d. character
both a and c
A(n) ____________________ is an alternative column heading displayed in the output of a query.
column alias
Combining the contents of two or more columns is known as ____________________.
concatenation
If you do not want a column alias to appear in all upper case characters, the column alias must be enclosed in ____________________ marks.
double quotation
A double backslash (\\) is used to indicate concatenation in a SELECT statement. True False
false
A string literal must be enclosed in double quotation marks. _________________________ True False
false
By default, the data for character fields are displayed ____________________ aligned when they are displayed.
left
Which of the following is a valid SELECT statement? a. SELECT order# || ' was shipped on ' || shipdate; b. SELECT order# || " was shipped on " || shipdate; c. SELECT order#, || ' was shipped on ' || shipdate; d. none of the above
none of the above
The entire column heading for a column will be displayed, regardless of the assigned width of the column, if the column is defined as a(n) ____ column. a. numeric b. alphanumeric c. date d. character
numeric
Which of the following types of columns will automatically right-align the data when it is displayed? a. character b. date c. numeric d. alphanumeric
numeric
Based upon the structure of the ORDERS table, the column heading for which column will be truncated in the results?
shipzip
A string literal must be enclosed in ____________________ marks.
single quotation
Which of the following symbols can be used to combine data from different columns into one column of output?
||
Each clause of a SELECT statement must be entered on a new line in SQL*Plus.
False
If a column name is entered in lower case in the SELECT statement, the data for the column will be displayed in lower case in the results. True False
False
If you assign a column alias to a column, it must be enclosed in double quotation marks (" "). True False
False
If you assign a column alias to a column, it must be enclosed in double quotation marks (" "). True False
False
The ALL option can be used in the SELECT clause to indicate that all columns should be retrieved. _________________________ True False
False
The SELECT command can be used to display the structure of a database table. _________________________ True False
False
The following arithmetic operations can be performed in the SELECT clause of a SELECT statement: addition (+), subtraction (-), multiplication (*), division (/), and exponential (^).
False
When listing more than one column name in the SELECT clause of a SELECT statement, the column names must be separated by semicolons .
False
When solving arithmetic expressions, Oracle 12c always resolves addition and subtraction operations first from left to right in the expression. True False
False
Combining the contents of two or more columns is known as projection.
False - Concatenation
Choosing specific columns to be displayed by a SELECT statement is known as selection.
False - Projection
Which of the following commands is used to issue a query?
SELECT
Based upon the contents of the BOOKS table, which of the following SQL statements will display five rows in its results?
SELECT DISTINCT pubid FROM books;
Based upon the contents of the PUBLISHER table, which of the following SQL statements will display only two columns in the results?
SELECT contact person, name FROM publisher;
Based upon the contents of the PUBLISHER table, which of the following is a valid SQL statement? a. SELECT contact Contact's Name FROM publisher; b. SELECT contact, name FROM publisher; c. SELECT name FROM publishers; d. SELECT publisherID FROM publisher;
SELECT contact, name FROM publisher;
Based upon the contents of the PUBLISHER table, which of the following is not a valid SQL statement?
SELECT name, contact FROM publisher/
Based upon the structure of the ORDERS table, which of the following is a valid SQL statement?
SELECT order#, orderdate DateOrdered FROM orders;
Based upon the contents of the BOOKS table, which of the following SQL statements will display the retail price for two copies of each book currently in inventory?
SELECT title, retail+retail FROM books;
Which of the following SQL statements will display the profit generated by each book currently stored in the BOOKS table? a. SELECT title, retail, cost profit FROM books; b. SELECT title, retail-cost FROM books; c. SELECT * FROM books; d. all of the above
SELECT title, retail-cost FROM books;
The ____________________ keyword can be included in a SELECT statement to suppress the display of duplicate data.
DISTINCT or UNIQUE
What is the correct answer for the arithmetic expression 9+2*(3-4) using the order of operations employed by Oracle 12c when solving equations?
7
What is used to indicate the end of an SQL statement? a. ; b. : c. / d. *
;
Which of the following commands can be used to view the structure of a table?
DESCRIBE
The ____________________ command can be used to display the structure of a table.
DESCRIBE
A(n) ____ has a predefined meaning in Oracle 12c.
Statement