C170 Alternate Test

Description

Alternate practice test for C170 WGU
Craig Willey
Quiz by Craig Willey, updated more than 1 year ago
Craig Willey
Created by Craig Willey over 5 years ago
88
1

Resource summary

Question 1

Question
A customer can purchase many products and a product can be purchased by many customers. Which kind of binary relationship does this scenario describe?
Answer
  • Many-to-many
  • One-to-many
  • One-to-one binary
  • One-to-one

Question 2

Question
Which kind of relationship is displayed in this entity-relationship diagram?
Answer
  • Binary one-to-one
  • Unary many-to-many
  • Ternary one-to-one
  • Binary many-to-many
  • Unary one-to-one
  • Ternary many-to-many

Question 3

Question
Which kind of relationship is displayed in this entity-relationship diagram?
Answer
  • One-to-one binary
  • One-to-one unary
  • Many-to-many binary
  • Many-to-many unary

Question 4

Question
How is this portion of the entity-relationship diagram read, from left to right?
Answer
  • Only one appointment was scheduled by one patient.
  • One appointment was scheduled by more than one patient.
  • No appointments were scheduled by a patient.
  • At least one appointment is scheduled by a patient.

Question 5

Question
Which two examples are attributes?
Answer
  • A patient ID
  • An appointment number
  • A patient being seen at an appointment
  • An appointment

Question 6

Question
Which delete rule sets column values in a child table to NULL when the matching data is deleted from the parent table?
Answer
  • Restrict
  • Set-to-Null
  • Cascade
  • Matching

Question 7

Question
A patient is related to two exam records. The table follows the restrict delete rule. What happens if someone tried to delete the patient?
Answer
  • The lack of a patient connected to the exam records is flagged for later.
  • The delete occurs immediately.
  • The delete is not allowed.
  • Another patient is linked with the exam records.

Question 8

Question
Which two columns are created as something other than variable-length strings in the statement above? Choose 2 answers
Answer
  • activity_id
  • activity_name
  • activity_date
  • time
  • location
  • coordinator_id

Question 9

Question
The 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?
Answer
  • Move the data from the second column into the third column
  • Move the data from the third column into its own table.
  • Move the data from the third column into the first column.
  • Move the data from the first two columns into separate tables.

Question 10

Question
A 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:
Answer
  • First Normal Form
  • Second Normal Form
  • Third Normal Form
  • Unnormalized

Question 11

Question
Two 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?
Answer
  • Foreign
  • Composite
  • Primary
  • Compound

Question 12

Question
In 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?
Answer
  • It is undefined.
  • It is linked through the instructor_id
  • It is indicated by the tables’ adjacency.
  • It is linked through the campus_id.

Question 13

Question
In which two ways can data redundancy affect managing disk storage space and calculation speed? Choose 2 answers:
Answer
  • Additional processing time is needed to update redundant data.
  • Additional processing time is needed to find intersection data for each redundant piece of data
  • Redundant data must be processed as unary, binary, and ternary information.
  • Redundant data takes up additional disk space.
  • Every copy of redundant data must be copied to a third record in the database

Question 14

Question
With which command can a database administrator allow a user named Mary to query the Patient table by executing SELECT commands on it?
Answer
  • GRANT Patient TO ‘mary’@ ‘localhost’;
  • GRANT SELECT ON PATIENT TO ‘mary’@ ‘localhost’;
  • GRANT SELECT PATIENT TO ‘mary’@ ‘localhost’;
  • GRANT PATIENT ON SELECT TO ‘mary’@ ‘localhost’;

Question 15

Question
Why does MySQL’s architecture use concurrency control?
Answer
  • To prevent two users from viewing the same record during potential updates.
  • To ensure that users are logged in on a local machine.
  • To let multiple clients easily find and negotiate with each other.
  • To prevent two users from modifying the same record at the same time.

Question 16

Question
Which command creates a database only if it does not already exist?
Answer
  • CREATE DATABASE IF NOT EXISTS db_name;
  • IF NOT EXISTS CREATE DATABASE db_name;
  • IF NOT EXISTS db_name;
  • CREATE DATABASE IF NEW db_name;

Question 17

Question
Refer 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?
Answer
  • AND item_price = 20;
  • AND item_price >= 20;
  • WHERE item_price = 20;
  • WHERE item_price >= 20;

Question 18

Question
What does WHERE identify in a basic SQL SELECT statement?
Answer
  • The associative entity
  • A table’s intersection data
  • The rows to be included in the result set
  • A range of included columns

Question 19

Question
Refer 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?
Answer
  • WHERE patient_id >=1000;
  • WHERE patient_id => 1000;
  • WHERE patient_id = 1000+;
  • WHERE patient_id > 1000;

Question 20

Question
Refer 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?
Answer
  • SUM item_id;
  • GROUP BY item_id;
  • COUNT item_id;
  • ORDER BY item_id;

Question 21

Question
Which data definition language statement affects databases or objects in them?
Answer
  • NULL
  • INSERT
  • SELECT
  • ALTER

Question 22

Question
What does the DELETE statement do?
Answer
  • It removes rows from a table.
  • It removes columns not named in the column list.
  • It removes views.
  • It removes columns from a table.

Question 23

Question
Which condition must be in effect to use the INSERT INTO … VALUES syntax for an INSERT statement?
Answer
  • The VALUES list must contain a value for each non-null valued column in the table.
  • The VALUES list must contain a value for each attribute/column in the table.
  • The INSERT INTO portion of the statement must generate a LOAD DATA statement.
  • THE INSERT INTO portion of the statement must refer to a sampdb database table.

Question 24

Question
Which kind of data type is FLOAT in the statement?
Answer
  • Decimal
  • Integer
  • Data
  • String

Question 25

Question
Which two MySQL data types can represent images or sounds? Choose two
Answer
  • TINYBLOB
  • FLOAT
  • BINARY
  • TERNARY
  • INT
  • SOUNDBLOB

Question 26

Question
Refer 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?
Answer
  • customer_id INT NOT NULL,
  • PRIMARY KEY (invoice_id),
  • CREATE TABLE Invoice (
  • FOREIGN KEY (customer_id) REFERENCES Customer (customer_id)

Question 27

Question
Which method creates an empty copy of a table and then populates it from the original table?
Answer
  • CREATE TABLE new_tbl_name INTO tbl_name; INSERT INTO new_tbl_name;
  • INSERT TABLE new_tbl_name SELECT tbl_name; INSERT INTO new_tbl_name LIKE tbl_name;
  • CREATE TABLE new_tbl_name LIKE tbl_name; INSERT INTO new_tbl_name SELECT * FROM tbl_name;
  • INSERT TABLE new_tbl_name LIKE tbl_name; SELECT tbl_name;

Question 28

Question
Refer to the given MySQL syntax. ALTER TABLE tbl_name action [, action ] … ; What does this syntax allow? Choose two answers:
Answer
  • Changing storage space
  • Changing column data types
  • Dropping indexes
  • Adding rows

Question 29

Question
Which command eliminates a table?
Answer
  • TRUNCATE TABLE
  • DELETE TABLE
  • REMOVE TABLE
  • DROP TABLE

Question 30

Question
Why is a view used to give controlled access to data?
Answer
  • To limit many-to-many relationship between various entities and attributes
  • To restrict access to persons retrieving and modifying sensitive information
  • To move complicated security routines to subqueries
  • To add complexity to encryption techniques

Question 31

Question
Which data definition language statement affects databases or objects in them?
Answer
  • SELECT
  • INSERT
  • ALTER
  • NULL

Question 32

Question
Refer 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?
Answer
  • ALTER custview AS
  • WHERE VIEW custview IS
  • CREATE VIEW custview AS
  • VIEW custview

Question 33

Question
What is the proper command to change a view?
Answer
  • ALTER VIEW
  • CHANGE VIEW
  • MODIFY VIEW
  • UPDATE VIEW

Question 34

Question
DROP VIEW patient_view; What happens as a result of the execution of this statement to the patient table on which patient_view is based?
Answer
  • Unauthorized access to the view is restricted
  • The view is discarded
  • The data is discarded
  • The patient table data is discarded

Question 35

Question
Which optional clause added to a GRANT statement enables the account to give its own privileges to other uses?
Answer
  • TO
  • WITH GRANT OPTION
  • REQUIRE
  • FOR

Question 36

Question
When 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?
Answer
  • Cascaded delete
  • Foreign key constraint
  • Referential delete
  • Dynamic update

Question 37

Question
Which clause should be added to the end to make the invoice_id attribute the primary key within a CREATE TABLE statement?
Answer
  • PRIMARY KEY (invoice_id));
  • PRIMARY KEY = (invoice_id));
  • (PRIMARY KEY): invoice_id;
  • (PRIMARY KEY) = (invoice_id));

Question 38

Question
Which statement should be used to establish a foreign key on customer_id?
Answer
  • FOREIGN KEY (customer_id) (index_columns)
  • FOREIGN KEY (customer_id) REFERENCES customer (customer_id)
  • FOREIGN KEY [table_name](customer_id)
  • FOREIGN KEY = (customer_id) REFERENCES customer (customer_id)

Question 39

Question
Which ALTER TABLE statement adds a foreign key constraint to a child table?
Answer
  • ALTER TABLE child ADD FOREIGN KEY (parent_id) ON DELETE CASCADE;
  • ALTER TABLE child ADD FOREIGN KEY WHERE parent (parent_id) ON DELETE CASCADE;
  • ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent (parent_id) ON DELETE CASCADE;
  • ALTER TABLE child ADD FOREIGN KEY (parent_id) WHERE parent (parent_id) ON DELETE CASCADE;

Question 40

Question
The 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?
Answer
  • ALTER TABLE ‘Vendor’ ADD UNIQUE INDEX ‘state_index (‘V_STATE’);
  • ALTER TABLE Vendor ADD INDEX ‘state_index’ (‘V_STATE’);
  • CREATE UNIQUE INDEX state_index ON Vendo (V_STATE) USING HASH;
  • CREATE INDEX state_index USING HASH ON Vendor (V_STATE);

Question 41

Question
Which clause when added to the end of the statement creates and index on the customer_id field?
Answer
  • INDEX custid_index (customer_id));
  • INDEX = (customer_id);
  • INDEX = (customer_id));
  • SET INDEX custid_index (customer_id));

Question 42

Question
Which syntax is the correct way to use the DROP INDEX command to drop a primary key from a table?
Answer
  • DROP INDEX ‘PRIMARY’ ON tbl_name;
  • DROP INDEX WHERE PRIMARY KEY = ON tbl_name;
  • DROP INDEX ‘PRIMARY KEY’ ON tbl_name;
  • DROP INDEX PRIMARY KEY tbl_name;

Question 43

Question
A 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?
Answer
  • The set-to-null delete rule
  • The restrict rule
  • The default delete rule
  • The cascade delete rule

Question 44

Question
Refer to the given MySQL statement. INSERT INTO Invoice VALUES (10217, ‘2018-08-01’, 55527), (10218, ‘2018-08-01’, 44436); Describe what the parentheses denote.
Answer
  • The row values for two individual columns
  • The attributes that are changeable
  • The column values for two individual rows
  • The data to be duplicated.

Question 45

Question
Which statement deletes all rows from the invoice table?
Answer
  • DELETE FROM Invoice WHERE invoice_id = *;
  • DELETE FROM Invoice;
  • DELETE FROM Invoice WHERE invoice_id == *;
  • DELETE ALL FROM Invoice;

Question 46

Question
Refer to the given SQL statement. SELECT table1.*, table2.* FROM table1 LEFT JOIN table2 ON table1.column_name = table2.column_name;
Answer
  • It selects only the rows in Table 1 that are the same as Table 2
  • It selects the rows in both Tables that have numerical data that is left-aligned.
  • It selects the rows in Table 1 numbered the same as Table 2.
  • It 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.

Question 47

Question
Refer 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?
Answer
  • (SUBQUERY = customer_id
  • (FIND customer_id
  • (SELECT customer_id
  • (SUBQUERY customer_id
Show full summary Hide full summary

Similar

C6 Flash cards
Anna Hollywood
Plano de Revisão Geral
miminoma
Sociology- Key Concepts
Becky Walker
AQA Biology B2 Questions
Bella Statham
Maths GCSE - What to revise!
livvy_hurrell
AQA GCSE Physics Unit 2
Gabi Germain
MAPA MENTAL
blanca beatriz m
Principios de Vuelo
Adriana Forero
The Skeleton and Muscles
james liew
2PR101 1.test - 6. část
Nikola Truong
Blood MCQs Physiology PMU 2nd Year
Med Student