Oracle Certified Professional, MySQL 5.6 Developer - 1z1-882 Exam Practice Test
You have two tables:
CREATE TABLE department (
Department_ID int unsigned NOT NULL auto_increment PRIMARY KEY,
Department _Name varchar(12) NOT NULL
) ENGINE=InnoDB
CREATE TABLE employee (
Employee_Number int unsigned NOT NULL PRIMARY KEY,
Employee_Name varchar(10) NOT NULL,
Department_ID int unsigned DEFAULT NULL,
FOREIGN KEY (Department ID) REFERENCES Department (Department_ID)
ON UPDATE SET NULL ON DELETE CASCADE
)ENGINE= InnoDB
The tables have the data:
Department

You execute the statement:
REPLACE INTO department (Department_ID, Department_Name) VALUES (1, 'Admin');
What data is in the employee table after the statement?

CREATE TABLE department (
Department_ID int unsigned NOT NULL auto_increment PRIMARY KEY,
Department _Name varchar(12) NOT NULL
) ENGINE=InnoDB
CREATE TABLE employee (
Employee_Number int unsigned NOT NULL PRIMARY KEY,
Employee_Name varchar(10) NOT NULL,
Department_ID int unsigned DEFAULT NULL,
FOREIGN KEY (Department ID) REFERENCES Department (Department_ID)
ON UPDATE SET NULL ON DELETE CASCADE
)ENGINE= InnoDB
The tables have the data:
Department

You execute the statement:
REPLACE INTO department (Department_ID, Department_Name) VALUES (1, 'Admin');
What data is in the employee table after the statement?

Correct Answer: D
You started a MySQL command -line session with sq1_ mode (empty), and created the person table with the
structure:
Mysql> DESC person;

You issue:
INSERT INTO person VALUES ('casper', 'undefined')
What is the effect?
structure:
Mysql> DESC person;

You issue:
INSERT INTO person VALUES ('casper', 'undefined')
What is the effect?
Correct Answer:
A SELECT statement without an ORDER BY clause return some rows.
Which statement is always true about the order of the returned results?
Which statement is always true about the order of the returned results?
Correct Answer: B
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
Which three connector/J connection strings can be used to connect to the MYSQL server?
Correct Answer: A,B,E
The data from t1 table is:

Assuming You want to see this output:

Which query achieves the preceding result?

Assuming You want to see this output:

Which query achieves the preceding result?
Correct Answer: D
Consider the my_table table with these contents:

You execute:
SELECT 1 FROM my_table;
What is the result?

You execute:
SELECT 1 FROM my_table;
What is the result?
Correct Answer: A
You have a transaction that queries a table at the beginning of the transaction and performs the same query later.
Which two transaction isolation levels guarantee that you get the same results both times?
Which two transaction isolation levels guarantee that you get the same results both times?
Correct Answer: B,C
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
Given the table City:
SELECT Name
FROM City
WHERE CountryCode = 'USA" OR WHERE CountryCode= 'JPN'
What does this statement procedure?
SELECT Name
FROM City
WHERE CountryCode = 'USA" OR WHERE CountryCode= 'JPN'
What does this statement procedure?
Correct Answer: B
You execute this EXPLAIN statement for a SELECT statement on the table named comics.which contains 1183 rows:
Mysql> explain select comic_ title, publisher from comics where comic_title like '& Action&';

row in set (0.00 sec)
You create the following index:
CREATE INDEX cimic_title_idx ON comics (comic_title, publisher);
You run the same EXPLAIN statement again;
Mysql > explain select comic_title ,publisher from comics where comic_title like '& Action&';

1 row in set (0.00 sec)
Why did the second SELECT statement need to read all 1183 rows in the index comic_title_idx?
Mysql> explain select comic_ title, publisher from comics where comic_title like '& Action&';

row in set (0.00 sec)
You create the following index:
CREATE INDEX cimic_title_idx ON comics (comic_title, publisher);
You run the same EXPLAIN statement again;
Mysql > explain select comic_title ,publisher from comics where comic_title like '& Action&';

1 row in set (0.00 sec)
Why did the second SELECT statement need to read all 1183 rows in the index comic_title_idx?
Correct Answer: A
You attempt to create two new tables:
CREATE TABLE 'warehouse' (
'id' int (11) NOT NULL AUTO_INCREMENT,
'name' varchar (20) NOT NULL,
'phone' varchar (20) NOT NULL,
PRIMARY KEY (' id)
) ENGINE=MyISAM
CREATE TABLE 'warehouseitem' (
'warehouse_id' bigint (11) NOT NULL,
'item_id' int (11) NOT NULL,
'count' int(11) NOT NULL DEFAULT '0',
KEY "warehouse_id' ('warehouse-id) ,
FOREIGN KEY (warehouse_id) REFFERENCES warehouse (id)
) ENGINE= InnoDB
You get this error :
ERROR 1215 ( HYooo): cannot add foreign key constraint
Which two changes are required to permit these statements to execute without any error?
CREATE TABLE 'warehouse' (
'id' int (11) NOT NULL AUTO_INCREMENT,
'name' varchar (20) NOT NULL,
'phone' varchar (20) NOT NULL,
PRIMARY KEY (' id)
) ENGINE=MyISAM
CREATE TABLE 'warehouseitem' (
'warehouse_id' bigint (11) NOT NULL,
'item_id' int (11) NOT NULL,
'count' int(11) NOT NULL DEFAULT '0',
KEY "warehouse_id' ('warehouse-id) ,
FOREIGN KEY (warehouse_id) REFFERENCES warehouse (id)
) ENGINE= InnoDB
You get this error :
ERROR 1215 ( HYooo): cannot add foreign key constraint
Which two changes are required to permit these statements to execute without any error?
Correct Answer: D,E