Chapter 7 Flashcards
A database language enables the user to create database and table structures to perform basic data management chores.
true
The ANSI prescribes a standard SQL–the current fully approved version is known as SQL-07.
false
SQL is considered difficult to learn; its command set has a vocabulary of more than 300 words.
false
The SQL command that lets you insert rows into a table is ____.
INSERT
The SQL command that lets you select attributes from rows in one or more tables is ____.
SELECT
Only numeric data types can be added and subtracted in SQL.
false
The CHECK constraint is used to define a condition for the values that the attribute domain cannot have.
false
You cannot insert a row containing a null attribute value using SQL.
false
Any changes made to the contents of a table are not physically saved on disk until you use the SAVE command.
false
If you have not yet used the COMMIT command to store the changes permanently in the database, you can restore the database to its previous condition with the ROLLBACK command.
true
Although SQL commands can be grouped together on a single line, complex command sequences are best shown on separate lines, with space between the SQL command and the command’s components.
true
String comparisons are made from left to right.
true
SQL allows the use of logical restrictions on its inquiries such as OR, AND, and NOT.
true
The conditional LIKE must be used in conjunction with wildcard characters.
true
Which query will output the table contents when the value of V_CODE is not equal to 21344?
-SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE
FROM PRODUCT
WHERE V_CODE <> 21344;
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE
FROM PRODUCT
WHERE V_CODE <= 21344;
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE
FROM PRODUCT
WHERE V_CODE = 21344;
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE
FROM PRODUCT
WHERE V_CODE => 21344;
Which query will output the table contents when the value of the character field P_CODE is alphabetically less than 1558-QW1?
-SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE
FROM PRODUCT
WHERE P_CODE
Which query will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand?
SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICE
FROM PRODUCT;
SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICE
FROM PRODUCT;
-SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE
FROM PRODUCT;
SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICE
FROM PRODUCT;
Which query will use the given columns and column aliases from the PRODUCT table to determine the total value of inventory held on hand and display the results in a column labeled TOTVALUE?
SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE AS TOTVALUE
FROM PRODUCT;
SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICE AS TOTVALUE
FROM PRODUCT;
SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICE AS TOTVALUE
FROM PRODUCT;
-SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICE AS TOTVALUE
FROM PRODUCT;
The special operator used to check whether an attribute value is within a range of values is ____.
BETWEEN
The special operator used to check for similar character strings is ____.
LIKE
The ____ command is used with the ALTER TABLE command to modify the table by deleting a column.
DROP
UPDATE tablename
*****
[WHERE conditionlist];
The ____ command replaces the ***** in the syntax of the UPDATE command, shown above.
-SET columnname = expression
columnname = expression
expression = columnname
LET columnname = expression
The ____ command is used to restore the table’s contents to their previous values.
COMMIT; RESTORE;
COMMIT; BACKUP;
COMMIT; ROLLBACK;
-ROLLBACK;
To join tables, simply enumerate the tables in the FROM clause of the SELECT statement. The DBMS will create a Cartesian product of every table in the FROM clause. To get the correct results, you need to select the rows in which the common attribute values do not match.
FALSE