Data Management-Applications
Questions and Correct Answers
Latest Update, Graded A+
Which command creates a database only if it does not already exist?
o :## CREATE DATABASE IF NOT EXISTS db_name;
SELECT PRODNUM, SUM(QUANTITY)FROM SALESPERSONWhich line, when added to
the end of the statement, returns the total number of each kind of product by
product number?
o :## GROUP BY PRODNUM;
Which data definition language statement affects databases or objects in them?
o :## ALTER
Which two SQL data types can represent images or sounds?
o :## Binary, Tinyblob
Which method creates an empty copy of a table and then populates it from the
original table?
o :## CREATE TABLE ... LIKE followed by INSERT INTO ... SELECT :
ALTER TABLE tbl_name action [, action ] ... ;What does this syntax allow?
Master01: DO NOT COPY AND PASTE!! August 22, 2024 Latest Update
, 2|Page : 2024 | Grade A+
o :## Dropping indexes, Changing column data
What is the correct syntax to create an index to be built on the city field based on
the database information?
o :## ALTER TABLE 'Salesperson' ADD INDEX 'city_index' (citycity)
Which clause in a CREATE TABLE statement creates an index on a field?
o :## INDEX index_name (index_columns)
A database administrator needs to modify an index on the CUSTOMER table called
IDX_NAME because there are multiple customers with the same name. It has been
determined that it would be desirable to modify the index to also include the
telephone number.Which command line will modify the IDX_NAME index on the
CUSTOMER table to include both NAME and TELEPHONE as part of the index?
o :## ALTER INDEX IDX_NAME ON CUSTOMER(NAME, TELEPHONE);
Which syntax is the correct way to use the DROP INDEX command to drop a primary
key from a table?
o :## DROP INDEX PRIMARYPRIMARY ON tbl_name ;
When a product is deleted from the product table, all corresponding rows for the
product in the pricing table are deleted automatically as well.What is this
referential integrity technique called?
o :## Cascaded delete
Master01: DO NOT COPY AND PASTE!! August 22, 2024 Latest Update