Database midterm
Which of the following types of SQL statements is not a DML statement? INSERT UPDATE SELECT CREATE TABLE
CREATE TABLE
Which of the following would return a maximum of 7 rows, starting with the 4th row? LIMIT 7, 4 LIMIT 4, 7 LIMIT 4 LIMIT 4, 6
LIMIT 4, 7
The order of precedence for the logical operators in a WHERE clause is Not, And, Or And, Or, Not Or, And, Not Not, Or, And
Not, And, Or
Which of the following types of statements does not modify the data in a table? SELECT INSERT UPDATE DELETE
SELECT
When you code a SELECT statement, you must code the four main clauses in the following order SELECT, FROM, ORDER BY, WHERE SELECT, ORDER BY, FROM, WHERE SELECT, WHERE, ORDER BY, FROM SELECT, FROM, WHERE, ORDER BY
SELECT, FROM, WHERE, ORDER BY
When a column in a table is defined, it is given a data ________________ that determines what kind of data it can store.
Type
Which of the following recommendations won't improve the readability of your SQL statements? Break long clauses into multiple lines. Use comments to describe what each statement does. Start each clause on a new line. Indent continued lines.
Use comments to describe what each statement does.
Which of the following WHERE clauses will return vendor names from A to C? WHERE vendor_name = D WHERE vendor_name < 'D' WHERE vendor_name = 'D' WHERE vendor_name < 'C'
WHERE vendor_name < 'D'
The result of a SELECT statement is a result set a calculated value a stored procedure
a result set
The processing that's done by the DBMS is typically referred to as front-end processing back-end processing the file server the user interface
back-end processing
When you code an ORDER BY clause, you can specify a column name or alias only column name or expression only column name, alias, or expression only column name, alias, expression, or column number
column name, alias, expression, or column number
The interface between an application program and the DBMS is usually provided by the back end front end data access API programmer
data access API
A database driver is software that lets the data access model communicate with the application program data access model communicate with the database application program communicate with the data access model application program communicate with the database
data access model communicate with the database
To relate one table to another, a/an _______________________ in one table is used to point to the primary key in another table.
foreign key
Which of the following expressions does not compute 10% of the balance due if balance due is the invoice total minus the credit total minus the payment total? invoice_total - credit_total - payment_total / 10 (invoice_total - payment_total - credit_total) / 10 (invoice_total - (payment_total + credit_total)) * 0.10 ((invoice_total - payment_total) - credit_total) / 10
invoice_total - credit_total - payment_total / 10
When coded in a WHERE clause, which of the following search conditions will not return a result set that includes all invoices with an invoice_total value of $1000 or less? invoice_total <= 1000 NOT (invoice_total > 1000) invoice_total IN (0, 1000) invoice_total BETWEEN 0 AND 1000
invoice_total IN (0, 1000)
When coded in a WHERE clause, which search condition will return invoices when payment_date isn't null and invoice_total is greater than or equal to $500? payment_date IS NULL AND invoice_total > 500 payment_date IS NOT NULL OR invoice_total >= 500 NOT (payment_date IS NULL AND invoice_total <= 500) payment_date IS NOT NULL AND invoice_total >= 50
payment_date IS NOT NULL AND invoice_total >= 500
If you define a column with a default value, that value is used whenever a row is added to the table in the table is updated that doesn't include a value for that column is added to the table with a zero value for that column is added to the table
that doesn't include a value for that column is added to the table
Which of the following isn't a valid column alias? total total sales total_sales "Total Sales"
total sales
When coded in a WHERE clause, which of the following would not return rows for vendors in the cities of San Diego and Santa Ana? vendor_city LIKE 'SAN%' vendor_city REGEXP 'NA$' vendor_city REGEXP '^SA'
vendor_city REGEXP 'NA$