C170, WGU Full Study Pack, Questions
with accurate answers, 100% Accurate,
rated A+
A salesperson is authorized to sell many products and a product can be sold by many salespersons.
Which kind of binary relationshi
...
C170, WGU Full Study Pack, Questions
with accurate answers, 100% Accurate,
rated A+
A salesperson is authorized to sell many products and a product can be sold by many salespersons.
Which kind of binary relationship does this scenario describe? - ✔✔-Many-to-many
Which two examples are attributes? - ✔✔-An employee number
A meeting code
Which delete rule sets column values in a child table to a missing value when the matching data is
deleted from the parent table? - ✔✔-Set-to-Null
member_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY (member_id),
last_name VARCHAR(20) NOT NULL,
first_name VARCHAR(20) NOT NULL,
suffix VARCHAR(5) NULL,
expiration DATE NULL,
Which two columns are created as something other than variable-length strings in this statement? -
✔✔-member_id
expiration
This database table has ten different employee numbers in the first column. Employee_ID is the primary
key. In addition, it has ten different names in the second column and two office addresses repeated five
times each in the third column.
Which action should be used to translate this data into third normal form? - ✔✔-Move the data from
the third column into its own table.
A database manager starts to convert data that has been normalized into a form that conforms to the
relational model. A simple primary key has been established and all the repeating groups have been
deleted.
In which form is this data? - ✔✔-Second normal form
Two attributes in two related tables have the exact same domain of values. The attribute is a primary
key in one table.
Which kind of key is the attribute in the other table? - ✔✔-Foreign
SELECT PRODNUM, PRODNAME
FROM PRODUCT
Which line should be added to the end of the statement to return the product numbers and product
names for products that cost 20 dollars? - ✔✔-WHERE PRODCOST=20;
What does WHERE identify in a basic SQL SELECT statement? - ✔✔-The rows to be included
Refer to the given SQL statement.
SELECT EMPNUM
FROM EMPLOYEE
Which line added to the end of the statement returns employee numbers of at least 1000? - ✔✔-
WHERE EMPNUM >= 1000;
SELECT PRODNUM, SUM(QUANTITY)
FROM SALESPERSON
Which line, when added to the end of the statement, returns the total number of each kind of product
by product number? - ✔✔-GROUP BY PRODNUM;
Which data definition language statement affects databases or objects in them? - ✔✔-ALTER
What does the DELETE statement do? - ✔✔-It removes rows from a table.
Which condition must be in effect to use the INSERT INTO ... VALUES syntax for an INSERT statement? -
✔✔-The VALUES list must contain a value for each non-null valued column in the
table.
CREATE TABLE mytbl
(
f FLOAT(10,4),
c CHAR(15) NOT NULL DEFAULT 'none',
i TINYINT UNSIGNED NULL
);
Which kind of data type is FLOAT in this statement? - ✔✔-Decimal
Which two SQL data types can represent images or sounds? - ✔✔-TINYBLOB
BINARY
CREATE TABLE CUSTOMER
(CustomerID INT NOT NULL AUTO_INCREMENT,
LastName VARCHAR(100) NOT NULL,
FirstName VARCHAR(100) NOT NULL,
PRIMARY KEY ( CustomerID ));
Which component of the command indicates the table's name? - ✔✔-CUSTOMER
Which method creates an empty copy of a table and then populates it from the original table? - ✔✔-
CREATE TABLE ... LIKE followed by INSERT INTO ... SELECT :
ALTER TABLE tbl_name action [, action ] ... ;
What does this syntax allow?
Choose 2 answers - ✔✔-Dropping indexes
Changing column data types
Which command eliminates a table? - ✔✔-DROP TABLE
Why is a view used to give controlled access to data? - ✔✔-To restrict access to persons retrieving and
modifying sensitive information
A database manager plans to create a view of a table and has these two elements: - ✔✔-The SELECT
privilege for every column referred to elsewhere in the statement
SELECT product_name, product_number, mfg_city FROM product;
Which statement, when added before this statement, generates a view? - ✔✔-CREATE VIEW viewprod
AS
What is the proper command to change a view? - ✔✔-ALTER VIEW
DROP VIEW EMPLOYEE;
What happens as a result of the execution of this statement to the HRDB table on which the
EMPLOYEE view is based? - ✔✔-The view is discarded.
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? - ✔✔-Cascaded delete
CREATE TABLE 'test1' (
contact_id INT(10),
name VARCHAR(10),
event_id INT(5),
Which command should be added to the end to make the event_id attribute the primary key within a
CREATE TABLE statement? - ✔✔-PRIMARY KEY (event_id));
What does the clause PRIMARY KEY followed by a field name in parentheses mean in a CREATE TABLE
statement? - ✔✔-The column, in parentheses, is the primary key for the table.
Which statement should be used so that it assigns a foreign key to the customer name? - ✔✔-FOREIGN
KEY ( customer_name ) REFERENCES table_name ( customer_name
)
Which ALTER TABLE statement adds a foreign key constraint to a child table? - ✔✔-ALTER TABLE child
ADD FOREIGN KEY (par_id) REFERENCES parent (par_id) ON DELETE
CASCADE;
The database administrator has been tasked with implementing an index to speed up the retrieval of
data based on the city values. The database is using the InnoDB engine.
What is the correct syntax to create an index to be built on the city field based on the database
information? - ✔✔-ALTER TABLE `Salesperson` ADD INDEX 'city_index' (`city`)
What is the name of the special internal database where the query optimizer finds information? - ✔✔-
Relational catalog
Which clause in a CREATE TABLE statement creates an index on a field? - ✔✔-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? - ✔✔-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? -
✔✔-DROP INDEX `PRIMARY` ON tbl_name ;
A database administrator tries to delete a row in a parent table, but the delete fails because a row in
another table depends on that row.
Which referential-integrity rule is in effect? - ✔✔-The restrict delete rule
A manager deletes the BUILDING_MANAGEMENT row in a DEPARTMENT table. Deleting the row also
deletes the GARDENING_TEAM and CLEANING_TEAM rows from the referenced
PERSONNEL_TEAMS table.
Which referential-integrity rule is in effect? - ✔✔-The cascade delete rule
INSERT INTO student VALUES('John','S',NULL),('Mary','S',NULL);
What do the parentheses denote? - ✔✔-The column values for two individual rows
What happens in an UPDATE statement if the WHERE clause is omitted? - ✔✔-Every row in the table is
updated.
Which action deletes all rows from a table? - ✔✔-Omitting the WHERE clause from a DELETE statement
What is the purpose of using a SELECT statement? - ✔✔-To retrieve data
Which SQL statement retrieves all of the columns from the Owners table? - ✔✔-SELECT * FROM
Owners;
Which SQL statement tallies the number of different cities in which record companies have been
founded? - ✔✔-SELECT COUNT(DISTINCT city) FROM recordcompany;
Which task does ORDER BY perform by default? - ✔✔-Sorting rows in ascending order
A database administrator of a movie rental company needs to compile a list of movies released each
year for a marketing campaign.
Which SQL command will accomplish this? - ✔✔-SELECT YEAR, TITLE FROM MOVIE GROUP BY YEAR;
How does Table 2 affect the returned results from Table 1 in a left join? - ✔✔-All Table 1 results are
returned, regardless of whether a match is found in Table 2.
Which command functions as a RIGHT JOIN with the roles of the tables reversed? - ✔✔-LEFT JOIN
SELECT t1.*, t2.* FROM t1 LEFT JOIN t2 ON t1.i1 = t2.i2
What does the LEFT JOIN statement do? - ✔✔-It selects all of the rows in Table 1 and the matching rows
in Table 2.
What is the difference between COUNT(*) and COUNT(col_name) for specified column names? - ✔✔-
COUNT(*) counts every row selected, and COUNT(col_name) counts only
non-null values.
Which function determines the total value for a column? - ✔✔-SUM()
How does a row subquery differ from a table subquery? - ✔✔-A row subquery returns a single row of
one or more values.
1. SELECT SPNAME
2. FROM SALESPERSON
3. WHERE SPNUM=
4. FROM CUSTOMER
5. WHERE CUSTNUM=20900);
What is missing from the subquery at the beginning of line 4? - ✔✔-(SELECT SPNUM
An alias is especially useful when a table must be joined to itself in a(n) ___________________ query. -
✔✔-recursive
The ___________ condition is generally composed of an equality comparison between the foreign key
and the primary key of related tables. - ✔✔-join
A database language enables the user to create database and table structures to perform basic data
management chores. - ✔✔-TRUE
______________________ is the process the DBMS uses to verify that only registered users access the
database. - ✔✔-Authentication
Only numeric data types can be added and subtracted in SQL. - ✔✔-FALSE
A table can be deleted from the database by using the _______________________ command. - ✔✔-
DROP TABLE
To list all the contents of the PRODUCT table, a user would use ________________________________ -
✔✔-SELECT * FROM PRODUCT
All SQL commands must be issued on a single line. - ✔✔-FALSE
Mathematical operators cannot be used to place restrictions on character-based attributes. - ✔✔-FALSE
A(n) _____________________ is a query that is embedded (or nested) inside another query. - ✔✔-
subquery
"The query 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 is ________________________________________________ - ✔✔-"SELECT P_DESCRIPT,
P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE
PRODUCT.V_CODE = VENDOR.V_CODE;"
In the SQL environment, the word ___________ covers both questions and actions. - ✔✔-query
The SQL aggregate function that gives the total of all values for a selected attribute in a given column is
_______ - ✔✔-SUM
String comparisons are made from left to right. - ✔✔-TRUE
Date procedures are often more software-specific than other SQL procedures. - ✔✔-TRUE
To make the output more readable, the SQL standard permits the use of aliases for any column in a
_____________ statement. - ✔✔-SELECT
A(n) _________________ order sequence is a multilevel ordered sequence that can be created easily by
listing several attributes, separated by commas, after the ORDER BY clause. - ✔✔-cascading
Data type selection is usually dictated by the nature of the data and by the intended use. - ✔✔-TRUE
The ANSI prescribes a standard SQL-the current fully approved version is known as SQL 07. - ✔✔-FALSE
The COUNT function is designed to tally the number of non-null "values" of an attribute, and is often
used in conjunction with the DISTINCT clause. - ✔✔-TRUE
Which of the following queries 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;"
A database language enables the user to perform complex queries designed to transform the raw data
into useful information. - ✔✔-TRUE
DATE() and SYSDATE are special functions that return today's date in MS Access and
__________________, respectively. - ✔✔-Oracle
Which of the following queries 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 <'1558-QW1';"
The ____________________ command is used to restore the database to its previous condition. - ✔✔-
ROLLBACK;
According to the rules of precedence, which of the following computations should be completed first? -
✔✔-Performing operations within parentheses
Which of the following queries will output the table contents when the value of V_CODE is equal to
21344? - ✔✔-"SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE =
21344;"
Using the _____________________________ command, SQL indexes can be created on the basis of any
selected attribute. - ✔✔-CREATE INDEX
A specialty field in mathematics, known as ________________ algebra, is dedicated to the use of logical
operators. - ✔✔-Boolean
"The query used to list the P_CODE, P_DESCRIPT, P_INDATE, and P_PRICE fields from the PRODUCT table
in ascending order by P_PRICE is ___________________________________________________" - ✔✔-
"SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT ORDER BY P_PRICE;"
Most SQL implementations yield case-insensitive searches. - ✔✔-FALSE
The _____________ constraint assigns a value to an attribute when a new row is added to a table. - ✔✔-
DEFAULT
The SQL data manipulation command HAVING:
______________________________________________________. - ✔✔-restricts the selection of
grouped rows based on a condition.
ANSI-standard SQL allows the use of special operators in conjunction with the WHERE clause. - ✔✔-
TRUE
The basic SQL vocabulary has fewer than ______ words. - ✔✔-100
The special operator used to check whether an attribute value is within a range of values is
____________ - ✔✔-BETWEEN
"The SQL query to output the contents of the EMPLOYEE table sorted by last name, first name, and
initial is __________________________________________________ - ✔✔-"SELECT EMP_LNAME,
EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE ORDER BY EMP_LNAME,
EMP_FNAME, EMP_INITIAL;"
In a 1:M relationship, a user must always create the table for the ___ side first. - ✔✔-1
A table can be deleted from the database by using the ___________________________ command. -
✔✔-DROP TABLE
Which of the following queries will list all the rows in which the inventory stock dates occur on or after
January 20, 2010? - ✔✔-"SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT
WHERE P_INDATE >= '20-JAN-2010';"
To remove a row from the PRODUCT table, one must use the ___________________ command. - ✔✔-
DELETE
When a user issues the DELETE FROM tablename command without specifying a WHERE condition,
__________________________. - ✔✔-all rows will be deleted
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
When joining three or more tables, you need to specify a join condition for one pair of tables. - ✔✔-
FALSE
An alias cannot be used when a table is required to be joined to itself in a recursive query. - ✔✔-FALSE
The SQL command that allows a user to list the contents of a table is _____________. - ✔✔-SELECT
The SQL aggregate function that gives the number of rows containing non-null values for a given column
is ______________. - ✔✔-COUNT
You cannot insert a row containing a null attribute value using SQL. - ✔✔-FALSE
All changes in a table structure are made using the ____________________ command, followed by a
keyword that produces the specific changes a user wants to make. - ✔✔-ALTER TABLE
SQL is considered difficult to learn; its command set has a vocabulary of more than 300 words. - ✔✔-
FALSE
Some RDBMSs, such as Oracle, automatically _______________ data changes when issuing data
definition commands. - ✔✔-COMMIT
The special operator used to check whether an attribute value matches a given string pattern is
_________ - ✔✔-LIKE
The COMMIT command does not permanently save all changes. In order to do that, you must use SAVE.
- ✔✔-FALS
[Show More]