Ch 7 Quiz - Copied
The basic SQL aggregate function that gives the arithmetic mean for the specific column is ________.
AVG
The ________ operator is used to check whether an attribute value is within a range.
BETWEEN
Which of the following is a SQL character data type(s)?
CHAR8
The ________ command validates data in an attribute.
CHECK
Some RDBMSs (like Oracle) will automatically ________ data changes when issuing data definition commands.
COMMIT
The SQL command that permanently saves data changes is ________.
COMMIT
The basic SQL aggregate function that gives the number of rows containing non-null values for the given column is ________.
COUNT
________ is an example of an aggregate function.
COUNT
Before using a new RDBMS which of the following tasks should be completed?
Creating the database structure and the tables that will hold end-user data
Which command would be used to delete a table row whose (P_CODE) is 'BRT-345'?
DELETE FROM PRODUCT WHERE P_CODE = 'BRT-345';
The SQL command that limits values to unique values is ________.
DISTINCT
A column can be deleted from a table by using the ________ command.
DROP
Referential constraint actions
Default actions that the DBMS should take when a DML command would result in a referential integrity constraint violation. Allows the DML Command to successfully complete while making the designated changes to the related records to maintain referential integrity.
The ________ operator is used to check whether a subquery returns any rows.
EXISTS
In Oracle the ________ command is used to place a dollar symbol ($) in front of a numeric value.
FORMAT
To join tables it is enough to list the tables in the ________ clause of the SELECT statement.
FROM
The ________ clause is valid only when used in conjunction with one of the SQL aggregate functions such as COUNT, MIN, MAX, AVG, and SUM.
GROUP BY
The ________ clause is applied to the output of a GROUP BY operation.
HAVING
Many queries that would require the use of the logical OR can be more easily handled with the help of the special operator ________.
IN
The SQL command that lets you fits data into a table is ________.
INSERT
The ________ operator is used to check whether an attribute value exists or not.
IS NULL
The ________ operator is used to find whether an attribute matches a given string pattern.
LIKE
The ________ function is used to find the highest value in a table column.
MAX
________ is an example of a logical operator.
NOT
The ________ clause is especially useful when the listing sequence is important.
ORDER BY
The ________ command is not supported by MS Access.
ROLLBACK
The ________ command is used to restore the database when the COMMIT has not yet been used to store the changes permanently.
ROLLBACK;
The SQL command that chooses attributes from rows in one or more tables or views is ________.
SELECT
The command used to see all the contents of the PRODUCT table is ________.
SELECT * FROM PRODUCT;
What command is used to produce a list of only those unique values for the column Vendor Code (V_CODE), those are different from one another?
SELECT DISTINCT V_CODE FROM PRODUCT;
Which of the following is an example of a recursive query?
SELECT E.EMP_MGR, M.EMP_LNAME, E.EMP_NUM, E.EMP_LNAME FROM EMP E, EMP M WHERE E.EMP_MGR=M.EMP_NUM ORDER BY E.EMP_MGR;
What is the SQL command that lists the contents of the EMPLOYEE table sorted by last name first name, and initial?
SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE ORDER BY EMP_LNAME, EMP_FNAME, EMP_INITIAL;
What is the command used to list the P_CODE P_DESCRIPT, P_INDATE, and P_PRICE fields from the PRODUCT table in ascending order by P_PRICE?
SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT ORDER BY P_PRICE;
Which of the following syntax would yield a list of all rows in which the value of the entities in the column P_CODE is alphabetically less than 1558-QW1?
SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P-CODE < '1558-QW1';
In MS Access, which query command will list all of the rows in which the inventory stock dates occur on or after January 20, 2014?
SELECT P_DESCRIPT, P_HAND, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDATE >= #20-JAN-14#;
What is the SQL syntax to list the table contents in the column V_CODE for either V_CODE = 21344 or V_CODE = 24288?
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE = 24288;
Which of the following query would list all of the rows for which the vendor code is not equal to 21344?
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344;
Which of the following query will return an output that will list all of the rows for which the vendor code is less than or equal to 21344?
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <= 21344;
Which of the following syntax will return the description date, and price of products with a vendor code of 21344?
SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344;
Which of the following commands is used to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME V_AREACODE, V_PHONE and V_CONTACT fields from the VENDOR table where the values of V_CODE match?
SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE;
Which command is used to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME V_AREACODE, V_PHONE, and V_CONTACT fields from the VENDOR table where the values of V_CODE match and the output is ordered by P_PRICE?
SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE; ORDER BY P_PRICE;
Which command uses a column alias TOTVALUE to display the result of the total value of each of the products currently held in inventory?
SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE AS TOTVALUE FROM PRODUCT;
Which command is used to choose partial table contents?
SELECT columnlist FROM tablelist [WHERE conditionlist];
The basic SQL aggregate function that gives the total of all values for a selected attribute in a given column is ________.
SUM
The ________ command ensures that a column will not have duplicate values
UNIQUE
The SQL command that modifies an attribute's values in one or more table's rows is ________.
UPDATE
Which of the following command should be used to change the P_INDATE in the second row of a PRODUCT table?
UPDATE PRODUCT SET P_INDATE = '18-JAN-2014' WHERE P_CODE = '13-Q2/P2';
Integrity constraint
a condition or rule specified on the table which restricts the kind of data that can be stored in the table.
A(n) ________ is an alternate name given to a column or table in any SQL statement.
alias
The DELETE FROM tablename command without a specific WHERE condition will delete ________.
all rows
Referential integrity
allows only the consistent values for certain fields across the related tables. Foreign keys are used to enforce referential integrity
A multilevel ordered sequence is known as a ________ order sequence.
cascading
When a new database is created the RDBMS automatically creates the ________.
data dictionary tables to store the metadata
A(n) ________ is a logical group of database objects that are related to each other.
schema
ON UPDATE CASCADE (referential action)
specifies that if the primary key of a parent table is changed, then the change must be reflected in the foreign key of all the child tables.
ON DELETE CASCADE (referential action)
specifies that the row must be deleted in the child table when corresponding rows are deleted from the parent table