Quiz
C170 Alternate Test
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (47)
1A customer can purchase many products and a product can be purchased by many customers.
Which kind of binary relationship does this scenario describe?- AMany-to-many
- BOne-to-many
- COne-to-one binary
- DOne-to-one
2Which kind of relationship is displayed in this entity-relationship diagram?

- ABinary one-to-one
- BUnary many-to-many
- CTernary one-to-one
- DBinary many-to-many
- EUnary one-to-one
- FTernary many-to-many
3Which kind of relationship is displayed in this entity-relationship diagram?

- AOne-to-one binary
- BOne-to-one unary
- CMany-to-many binary
- DMany-to-many unary
4How is this portion of the entity-relationship diagram read, from left to right?

- AOnly one appointment was scheduled by one patient.
- BOne appointment was scheduled by more than one patient.
- CNo appointments were scheduled by a patient.
- DAt least one appointment is scheduled by a patient.
5Which two examples are attributes?
- AA patient ID
- BAn appointment number
- CA patient being seen at an appointment
- DAn appointment
6Which delete rule sets column values in a child table to NULL when the matching data is deleted from the parent table?
- ARestrict
- BSet-to-Null
- CCascade
- DMatching
7A patient is related to two exam records. The table follows the restrict delete rule. What happens if someone tried to delete the patient?

- AThe lack of a patient connected to the exam records is flagged for later.
- BThe delete occurs immediately.
- CThe delete is not allowed.
- DAnother patient is linked with the exam records.
8Which two columns are created as something other than variable-length strings in the statement above?
Choose 2 answers
- Aactivity_id
- Bactivity_name
- Cactivity_date
- Dtime
- Elocation
- Fcoordinator_id
9The database table above has 7 different physician IDs in the first column and physician_id is the primary key of the table. There are 7 different physician names in the second column. The third column indicates which site a physician is located at. There are 3 different sites. Two of the site names are repeated 3 times.
Which action should be used to translate this data into third normal form?
- AMove the data from the second column into the third column
- BMove the data from the third column into its own table.
- CMove the data from the third column into the first column.
- DMove the data from the first two columns into separate tables.
10A database designer is working through the normalization process. A simple primary key has been established. All of the repeating groups and multi-valued fields have been removed
In which form is this table:
- AFirst Normal Form
- BSecond Normal Form
- CThird Normal Form
- DUnnormalized
11Two attributes in two related tables have the exact same domain of values. The attribute is a primary key (PK) in one table.
Which kind of key is the attribute in the other table?
- AForeign
- BComposite
- CPrimary
- DCompound
12In this entity-relationship diagram, many instructors are shown as working at a minimum of one campus.
How is the relationship between instructors and campuses represented in the diagram?
- AIt is undefined.
- BIt is linked through the instructor_id
- CIt is indicated by the tables’ adjacency.
- DIt is linked through the campus_id.
13In which two ways can data redundancy affect managing disk storage space and calculation speed?
Choose 2 answers:- AAdditional processing time is needed to update redundant data.
- BAdditional processing time is needed to find intersection data for each redundant piece of data
- CRedundant data must be processed as unary, binary, and ternary information.
- DRedundant data takes up additional disk space.
- EEvery copy of redundant data must be copied to a third record in the database
14With which command can a database administrator allow a user named Mary to query the Patient table by executing SELECT commands on it?
- AGRANT Patient TO ‘mary’@ ‘localhost’;
- BGRANT SELECT ON PATIENT TO ‘mary’@ ‘localhost’;
- CGRANT SELECT PATIENT TO ‘mary’@ ‘localhost’;
- DGRANT PATIENT ON SELECT TO ‘mary’@ ‘localhost’;
15Why does MySQL’s architecture use concurrency control?
- ATo prevent two users from viewing the same record during potential updates.
- BTo ensure that users are logged in on a local machine.
- CTo let multiple clients easily find and negotiate with each other.
- DTo prevent two users from modifying the same record at the same time.
16Which command creates a database only if it does not already exist?
- ACREATE DATABASE IF NOT EXISTS db_name;
- BIF NOT EXISTS CREATE DATABASE db_name;
- CIF NOT EXISTS db_name;
- DCREATE DATABASE IF NEW db_name;
17Refer to the given SQL statement:
SELECT item_number, item_name
FROM item
Which line should be added to the end of the statement to return the item numbers and item names for items that have an item_price of 10 dollars?- AAND item_price = 20;
- BAND item_price >= 20;
- CWHERE item_price = 20;
- DWHERE item_price >= 20;
18What does WHERE identify in a basic SQL SELECT statement?
- AThe associative entity
- BA table’s intersection data
- CThe rows to be included in the result set
- DA range of included columns
19Refer to the given SQL statement.
SELECT patient_id
FROM patient
Which line added to the end of the statement returns patient ids of at least 1000?- AWHERE patient_id >=1000;
- BWHERE patient_id => 1000;
- CWHERE patient_id = 1000+;
- DWHERE patient_id > 1000;
20Refer to the given SQL statement:
SELECT item_id, SUM(quantity)
FROM invoice
Which line, when added to the end of the statement, returns the total number of each kind of item by item_id?- ASUM item_id;
- BGROUP BY item_id;
- CCOUNT item_id;
- DORDER BY item_id;
21Which data definition language statement affects databases or objects in them?
- ANULL
- BINSERT
- CSELECT
- DALTER
22What does the DELETE statement do?
- AIt removes rows from a table.
- BIt removes columns not named in the column list.
- CIt removes views.
- DIt removes columns from a table.
23Which condition must be in effect to use the INSERT INTO … VALUES syntax for an INSERT statement?
- AThe VALUES list must contain a value for each non-null valued column in the table.
- BThe VALUES list must contain a value for each attribute/column in the table.
- CThe INSERT INTO portion of the statement must generate a LOAD DATA statement.
- DTHE INSERT INTO portion of the statement must refer to a sampdb database table.
24Which kind of data type is FLOAT in the statement?

- ADecimal
- BInteger
- CData
- DString
25Which two MySQL data types can represent images or sounds?
Choose two- ATINYBLOB
- BFLOAT
- CBINARY
- DTERNARY
- EINT
- FSOUNDBLOB
26Refer to the given SQL statement.
CREATE TABLE Invoice (
invoice_id INT NOT NULL ,
date DATE NOT NULL,
customer_id INT NOT NULL,
PRIMARY KEY (invoice_id),
FOREIGN KEY (customer_id) REFERENCES Customer (customer_id)
);
In which line of the statement is the table given its name?- Acustomer_id INT NOT NULL,
- BPRIMARY KEY (invoice_id),
- CCREATE TABLE Invoice (
- DFOREIGN KEY (customer_id) REFERENCES Customer (customer_id)
27Which method creates an empty copy of a table and then populates it from the original table?
- ACREATE TABLE new_tbl_name INTO tbl_name;
INSERT INTO new_tbl_name; - BINSERT TABLE new_tbl_name SELECT tbl_name;
INSERT INTO new_tbl_name LIKE tbl_name; - CCREATE TABLE new_tbl_name LIKE tbl_name;
INSERT INTO new_tbl_name SELECT * FROM tbl_name; - DINSERT TABLE new_tbl_name LIKE tbl_name;
SELECT tbl_name;
- ACREATE TABLE new_tbl_name INTO tbl_name;
28Refer to the given MySQL syntax.
ALTER TABLE tbl_name action [, action ] … ;
What does this syntax allow?
Choose two answers:- AChanging storage space
- BChanging column data types
- CDropping indexes
- DAdding rows
29Which command eliminates a table?
- ATRUNCATE TABLE
- BDELETE TABLE
- CREMOVE TABLE
- DDROP TABLE
30Why is a view used to give controlled access to data?
- ATo limit many-to-many relationship between various entities and attributes
- BTo restrict access to persons retrieving and modifying sensitive information
- CTo move complicated security routines to subqueries
- DTo add complexity to encryption techniques
31Which data definition language statement affects databases or objects in them?
- ASELECT
- BINSERT
- CALTER
- DNULL
32Refer to the given SQL statement.
SELECT customer_id, customer_last_name, customer_first_name
FROM customer;
Which statement, when added before this statement, generates a view?- AALTER custview AS
- BWHERE VIEW custview IS
- CCREATE VIEW custview AS
- DVIEW custview
33What is the proper command to change a view?
- AALTER VIEW
- BCHANGE VIEW
- CMODIFY VIEW
- DUPDATE VIEW
34DROP VIEW patient_view;
What happens as a result of the execution of this statement to the patient table on which patient_view is based?- AUnauthorized access to the view is restricted
- BThe view is discarded
- CThe data is discarded
- DThe patient table data is discarded
35Which optional clause added to a GRANT statement enables the account to give its own privileges to other uses?
- ATO
- BWITH GRANT OPTION
- CREQUIRE
- DFOR
36When a patient is deleted from the patient table, all corresponding rows from the patient in the exam table are automatically deleted as well.
What is this referential integrity technique called?- ACascaded delete
- BForeign key constraint
- CReferential delete
- DDynamic update
37Which clause should be added to the end to make the invoice_id attribute the primary key within a CREATE TABLE statement?

- APRIMARY KEY (invoice_id));
- BPRIMARY KEY = (invoice_id));
- C(PRIMARY KEY): invoice_id;
- D(PRIMARY KEY) = (invoice_id));
38Which statement should be used to establish a foreign key on customer_id?
- AFOREIGN KEY (customer_id) (index_columns)
- BFOREIGN KEY (customer_id) REFERENCES customer (customer_id)
- CFOREIGN KEY [table_name](customer_id)
- DFOREIGN KEY = (customer_id) REFERENCES customer (customer_id)
39Which ALTER TABLE statement adds a foreign key constraint to a child table?
- AALTER TABLE child
ADD FOREIGN KEY (parent_id) ON DELETE CASCADE; - BALTER TABLE child
ADD FOREIGN KEY WHERE parent (parent_id) ON DELETE CASCADE; - CALTER TABLE child
ADD FOREIGN KEY (parent_id) REFERENCES parent (parent_id) ON DELETE CASCADE; - DALTER TABLE child
ADD FOREIGN KEY (parent_id) WHERE parent (parent_id) ON DELETE CASCADE;
- AALTER TABLE child
40The database administrator has been tasked with implementing an index to speed up the retrieval of data based on the V_STATE values. The database is using the InnoDB engine.
What is the correct syntax to create an index to be built on the V_STATE field based on the database information?
- AALTER TABLE ‘Vendor’ ADD UNIQUE INDEX ‘state_index (‘V_STATE’);
- BALTER TABLE Vendor ADD INDEX ‘state_index’ (‘V_STATE’);
- CCREATE UNIQUE INDEX state_index ON Vendo (V_STATE) USING HASH;
- DCREATE INDEX state_index USING HASH ON Vendor (V_STATE);
41Which clause when added to the end of the statement creates and index on the customer_id field?

- AINDEX custid_index (customer_id));
- BINDEX = (customer_id);
- CINDEX = (customer_id));
- DSET INDEX custid_index (customer_id));
42Which syntax is the correct way to use the DROP INDEX command to drop a primary key from a table?
- ADROP INDEX ‘PRIMARY’ ON tbl_name;
- BDROP INDEX WHERE PRIMARY KEY = ON tbl_name;
- CDROP INDEX ‘PRIMARY KEY’ ON tbl_name;
- DDROP INDEX PRIMARY KEY tbl_name;
43A database administrator tried 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?- AThe set-to-null delete rule
- BThe restrict rule
- CThe default delete rule
- DThe cascade delete rule
44Refer to the given MySQL statement.
INSERT INTO Invoice VALUES (10217, ‘2018-08-01’, 55527), (10218, ‘2018-08-01’, 44436);
Describe what the parentheses denote.- AThe row values for two individual columns
- BThe attributes that are changeable
- CThe column values for two individual rows
- DThe data to be duplicated.
45Which statement deletes all rows from the invoice table?
- ADELETE FROM Invoice WHERE invoice_id = *;
- BDELETE FROM Invoice;
- CDELETE FROM Invoice WHERE invoice_id == *;
- DDELETE ALL FROM Invoice;
46Refer to the given SQL statement.
SELECT table1.*, table2.* FROM table1 LEFT JOIN table2 ON table1.column_name = table2.column_name;- AIt selects only the rows in Table 1 that are the same as Table 2
- BIt selects the rows in both Tables that have numerical data that is left-aligned.
- CIt selects the rows in Table 1 numbered the same as Table 2.
- DIt selects all of the rows in Table 1 (regardless of if there is a match in Table 2) and the matching rows in Table 2.
47Refer to the given SQL Statement.
1. SELECT invoice_id
2. FROM Invoice
3. WHERE customer_id =
4. FROM customer
5. WHERE customer_id = 55547);
What is missing from the subquery at the beginning of Line 4?- A(SUBQUERY = customer_id
- B(FIND customer_id
- C(SELECT customer_id
- D(SUBQUERY customer_id
Information
- Description
- Alternate practice test for C170 WGU
- Author
- Craig Willey
- Language
- English
- Views
- 100
- Tags
- Rating
- No ratings yet Rate this quiz