C170 - Practice Test

Beschreibung

C170 - Database Applications
Craig Willey
Quiz von Craig Willey, aktualisiert more than 1 year ago
Craig Willey
Erstellt von Craig Willey vor mehr als 5 Jahre
523
0

Zusammenfassung der Ressource

Frage 1

Frage
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?
Antworten
  • One-to-one
  • One-to-many
  • Many-to-many
  • One-to-one binary

Frage 2

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

Frage 3

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

Frage 4

Frage
How is this portion of the entity-relationship diagram read, from left to right?
Antworten
  • No books are written by an author.
  • At least one book was written by an author.
  • One book was written by more than one author.
  • Only one book was written by one author.

Frage 5

Frage
Which two examples are attributes? Choose 2 answers
Antworten
  • A person attending a meeting
  • An employee number
  • A sales meeting
  • A meeting code

Frage 6

Frage
Which delete rule sets column values in a child table to a missing value when the matching data is deleted from the parent table?
Antworten
  • Restrict
  • Cascade
  • Matching
  • Set-to-Null

Frage 7

Frage
In this entity-relationship diagram, Salesperson 361 is related to two customers. The table follows the restrict delete rule. What happens if someone tries to delete Salesperson 361 from the customer records?
Antworten
  • The delete is prohibited.
  • The delete occurs immediately.
  • A new salesperson is assigned instead.
  • The lack of a salesperson is flagged for later.

Frage 8

Frage
Refer to the given SQL statement. CREATE TABLE member ( 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, email VARCHAR(100) NULL, street VARCHAR(50) NULL, city VARCHAR(50) NULL, state VARCHAR(2) NULL, zip VARCHAR(10) NULL, phone VARCHAR(20) NULL, interests VARCHAR(255) NULL ); Which two columns are created as something other than variable-length strings in this statement? Choose 2 answers
Antworten
  • member_id
  • last name
  • suffix
  • expiration
  • email
  • city

Frage 9

Frage
Employee_ID Employee_Name Office_Address 12342 Jacob 54123 Main Street 12346 Michael 354 Center Avenue 12846 Ethan 54123 Main Street 12887 Joshua 54123 Main Street 12894 Daniel 354 Center Avenue 13097 Alexander 354 Center Avenue 13112 Anthony 54123 Main Street 13411 William 354 Center Avenue 13987 Christopher 354 Center Avenue 13998 Matthew 54123 Main Street 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?
Antworten
  • Move the data from the third column into the first column.
  • Move the data from the third column into its own table.
  • Move the data from the first two columns into separate tables.
  • Move the data from the second column into the third column.

Frage 10

Frage
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?
Antworten
  • First normal form
  • Second normal form
  • Third normal form
  • Fourth normal form

Frage 11

Frage
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?
Antworten
  • Foreign
  • Primary
  • Compound
  • Composite

Frage 12

Frage
In this entity-relationship diagram, many salespersons are shown as working in at least one office. How is the relationship between salespersons and offices represented in the diagram?
Antworten
  • It is undefined.
  • It is linked through the office ID.
  • It is linked through the salesperson ID.
  • It is indicated by the tables’ adjacency.

Frage 13

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

Frage 14

Frage
Refer to the given SQL statement. 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?
Antworten
  • WHERE PRODCOST=20;
  • AND PRODCOST=20;
  • WHERE PRODCOST>=20;
  • AND PRODCOST>=20;

Frage 15

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

Frage 16

Frage
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?
Antworten
  • WHERE EMPNUM = 1000+;
  • WHERE EMPNUM > 1000;
  • WHERE EMPNUM => 1000;
  • WHERE EMPNUM >= 1000;

Frage 17

Frage
Refer to the given SQL statement. 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?
Antworten
  • SUM PRODNUM;
  • COUNT PRODNUM;
  • ORDER BY PRODNUM;
  • GROUP BY PRODNUM;

Frage 18

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

Frage 19

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

Frage 20

Frage
Which condition must be in effect to use the INSERT INTO … VALUES syntax for an INSERT statement?
Antworten
  • 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 row 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.

Frage 21

Frage
Refer to the given SQL statement. 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?
Antworten
  • Decimal
  • Integer
  • String
  • Data

Frage 22

Frage
Which two SQL data types can represent images or sounds? Choose 2 answers
Antworten
  • INT
  • FLOAT
  • BINARY
  • TERNARY
  • TINYBLOB
  • SOUNDBLOB

Frage 23

Frage
Refer to the given SQL statement. 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?
Antworten
  • TABLE CUSTOMER
  • CustomerID
  • CUSTOMER
  • INT

Frage 24

Frage
Which method creates an empty copy of a table and then populates it from the original table?
Antworten
  • INSERT TABLE … SELECT followed by INSERT INTO … LIKE :
  • CREATE TABLE … LIKE followed by INSERT INTO … SELECT :
  • CREATE TABLE … INTO followed by INSERT INTO:
  • INSERT TABLE … LIKE followed by SELECT:

Frage 25

Frage
Refer to the given SQL syntax. ALTER TABLE tbl_name action [, action ] ... ; What does this syntax allow? Choose 2 answers
Antworten
  • Adding rows
  • Dropping indexes
  • Changing storage space
  • Changing column data types

Frage 26

Frage
Which command eliminates a table?
Antworten
  • TRUNCATE TABLE
  • DELETE TABLE
  • REMOVE TABLE
  • DROP TABLE

Frage 27

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

Frage 28

Frage
A database manager plans to create a view of a table and has these two elements: • The CREATE VIEW privilege for the table • A level of privilege for every column selected by the SELECT What else does the manager need to create this view?
Antworten
  • The values created by the syntax INSERT INTO tbl_name VALUES(...),(...),... ;
  • The SELECT privilege for every column referred to elsewhere in the statement
  • A reciprocal level of privilege for every row selected by the SELECT statement
  • The level of privilege for every column that is part of the base table

Frage 29

Frage
Refer to the given SQL statement. SELECT product_name, product_number, mfg_city FROM product; Which statement, when added before this statement, generates a view?
Antworten
  • VIEW viewprod:
  • ALTER viewprod AS
  • WHERE VIEW viewprod IS
  • CREATE VIEW viewprod AS

Frage 30

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

Frage 31

Frage
Refer to the given statement. 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?
Antworten
  • The data is discarded.
  • The view is discarded.
  • The viewing of data is prohibited.
  • Unauthorized access to the view is restricted.

Frage 32

Frage
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?
Antworten
  • Foreign key constraint
  • Referential delete
  • Cascaded delete
  • Dynamic update

Frage 33

Frage
Refer to the given information. 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?
Antworten
  • PRIMARY KEY = event_id);
  • PRIMARY KEY (event_id));
  • (PRIMARY KEY: event_id);
  • PRIMARY (event_id)'

Frage 34

Frage
What does the clause PRIMARY KEY followed by a field name in parentheses mean in a CREATE TABLE statement?
Antworten
  • The primary key value, in parentheses, can be used by a column.
  • The column, in parentheses, is the primary key for the table.
  • The foreign key, in parentheses, is linked to the primary key.
  • The row, in parentheses, can be inserted as the foreign key.

Frage 35

Frage
Which statement should be used so that it assigns a foreign key to the customer name?
Antworten
  • FOREIGN KEY ( customer_name ) REFERENCES table_name ( customer_name )
  • FOREIGN KEY = customer_name REFERENCES table_name ( customer_name )
  • FOREIGN KEY ( customer_name ) ( index_columns )
  • FOREIGN KEY [ table_name ] ( customer_name )

Frage 36

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

Frage 37

Frage
Refer to the diagram of an index table. Salesperson Table Record Address Salesperson Number Salesperson Name City Hire Date Commission Rate 1 119 Taylor, A New York 1/21/01 20% 2 137 Baker, B Detroit 2/3/11 10% 3 186 Adams, A Dallas 8/23/96 5% 4 204 Dickens, S Dallas 8/4/12 5% 5 255 Lincoln, J Atlanta 6/7/13 5% 6 361 Carlyle, L Detroit 11/11/10 7% 7 420 Green, C Tucson 9/25/12 11% 8 452 French, F New York 10/23/09 8% 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?
Antworten
  • ALTER TABLE 'Salesperson' ADD INDEX 'city_index' (`city`)
  • CREATE UNIQUE INDEX city_index ON Salesperson (city);
  • CREATE INDEX city_index USING HASH ON Salesperson (city);
  • ALTER TABLE 'Salesperson' ADD UNIQUE INDEX 'city_index' (`city`)

Frage 38

Frage
What is the name of the special internal database where the query optimizer finds information?
Antworten
  • Join catalog
  • Query catalog
  • Optimizer catalog
  • Relational catalog

Frage 39

Frage
Which clause in a CREATE TABLE statement creates an index on a field?
Antworten
  • INDEX index_rows (index_name)
  • INDEX index_name (index_rows)
  • INDEX index_columns (index_name)
  • INDEX index_name (index_columns)

Frage 40

Frage
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?
Antworten
  • ALTER INDEX IDX_NAME ON CUSTOMER(NAME, TELEPHONE);
  • MODIFY INDEX IDX_NAME BY CUSTOMER(NAME, TELEPHONE);
  • CHANGE INDEX IDX_NAME BY CUSTOMER(NAME, TELEPHONE);
  • REPLACE INDEX IDX_NAME ON CUSTOMER(NAME, TELEPHONE);

Frage 41

Frage
Which syntax is the correct way to use the DROP INDEX command to drop a primary key from a table?
Antworten
  • DROP INDEX PRIMARY KEY tbl_name;
  • DROP INDEX `PRIMARY` ON tbl_name ;
  • DROP INDEX `PRIMARY KEY` ON tbl_name;
  • DROP INDEX WHERE PRIMARY KEY = tbl_name ;

Frage 42

Frage
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?
Antworten
  • The default delete rule
  • The restrict delete rule
  • The cascade delete rule
  • The set-to-null delete rule

Frage 43

Frage
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?
Antworten
  • The default delete rule
  • The restrict delete rule
  • The cascade delete rule
  • The set-to-null delete rule

Frage 44

Frage
Refer to the given SQL statement. INSERT INTO student VALUES('John','S',NULL),('Mary','S',NULL); What do the parentheses denote?
Antworten
  • The data to be duplicated
  • The attributes that are changeable
  • The row values for two individual columns
  • The column values for two individual rows

Frage 45

Frage
What happens in an UPDATE statement if the WHERE clause is omitted?
Antworten
  • Only the first row in the table is updated.
  • Every column in the table is updated.
  • Every row in the table is updated.
  • Returns an error.

Frage 46

Frage
Which action deletes all rows from a table?
Antworten
  • Omitting the WHERE clause from a DELETE statement
  • Adding an ALL statement to a DELETE statement
  • Omitting the table name in a DELETE statement
  • Adding an asterisk to a DELETE statement

Frage 47

Frage
What is the purpose of using a SELECT statement?
Antworten
  • To retrieve data
  • To update data
  • To delete data
  • To index data

Frage 48

Frage
Which SQL statement retrieves all of the columns from the Owners table?
Antworten
  • SELECT * FROM Owners;
  • SELECT ALL FROM Owners;
  • RETRIEVE COMPLETE FROM Owners;
  • RETRIEVE ALL COLUMNS FROM Owners;

Frage 49

Frage
Which SQL statement tallies the number of different cities in which record companies have been founded?
Antworten
  • SELECT COUNT(DISTINCT city) FROM recordcompany;
  • GROUP BY *(DISTINCT city) FROM recordcompany;
  • SELECT DISTINCT city FROM recordcompany;
  • GROUP BY(city) FROM recordcompany;

Frage 50

Frage
Which task does ORDER BY perform by default?
Antworten
  • Sorting rows in ascending order
  • Sorting rows in descending order
  • Sorting columns in ascending order
  • Sorting columns in descending order

Frage 51

Frage
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?
Antworten
  • SELECT MOVIE, YEAR FROM MOVIE BY TITLE;
  • SELECT MOVIE, TOTAL FROM MOVIE BY TITLE;
  • SELECT MOVIE, TITLE FROM MOVIE BY MOVIE YEAR;
  • SELECT YEAR, TITLE FROM MOVIE GROUP BY YEAR;

Frage 52

Frage
How does Table 2 affect the returned results from Table 1 in a left join?
Antworten
  • Records are dropped from the results where a match is found between Table 1 and Table 2.
  • All Table 1 results are returned, regardless of whether a match is found in Table 2.
  • Results are only returned where a match is found between Table 1 and Table 2.
  • Table 1 results are prioritized where a match with Table 2 exists.

Frage 53

Frage
Which command functions as a RIGHT JOIN with the roles of the tables reversed?
Antworten
  • INNER JOIN
  • OUTER JOIN
  • LEFT JOIN
  • FULL JOIN

Frage 54

Frage
Refer to the given SQL statement. SELECT t1.*, t2.* FROM t1 LEFT JOIN t2 ON t1.i1 = t2.i2 What does the LEFT JOIN statement do?
Antworten
  • It selects the rows in Table 1 numbered the same as Table 2.
  • It selects only the rows in Table 1 that are the same as Table 2.
  • It selects all of the rows in Table 1 and the matching rows in Table 2.
  • It selects the rows in both Tables that have numerical data that is left-aligned.

Frage 55

Frage
What is the difference between COUNT(*) and COUNT( col_name) for specified column names?
Antworten
  • COUNT(*) counts every column selected, and COUNT(col_name) counts only columns with alphabetical names.
  • COUNT(*) counts every column selected, and COUNT(col_name) counts only non-null values.
  • COUNT(*) counts every row selected, and COUNT(col_name) counts only non-null values.
  • COUNT(*) counts every row selected, and COUNT(col_name) counts every column selected.

Frage 56

Frage
Which function determines the total value for a column?
Antworten
  • ALL()
  • SUM()
  • TOTAL()
  • SUMMARY()

Frage 57

Frage
How does a row subquery differ from a table subquery?
Antworten
  • A row subquery returns a table with two rows in two columns.
  • A row subquery returns multiple rows of one or more values.
  • A row subquery returns a table with one row in one column.
  • A row subquery returns a single row of one or more values.

Frage 58

Frage
Refer to the given SQL statement. 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?
Antworten
  • (SPNUM
  • (FIND SPNUM
  • (SELECT SPNUM
  • (SUBQUERY SPNUM
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

FLAT FILE VS RELATIONAL DATABASE
rosiejones
OCR gcse computer science
Jodie Awthinre
GCSE AQA Computer Science - Definitions
James Jolliffe
Managing Digital Data Review
Shannon Anderson-Rush
Midterm 2 (Chapter 5 - 13)
Yorria Raine
SQL Quiz
Chris Cronin
GCSE AQA Computer Science - Definitions
moffat00
Database Final Exam
dbm
Data, Information and Databases
maryamxjay
AS Levels ICT -Form Controls
lukejones
Yacht Owner Database
Ryder Fernandis