Oracle Certified Professional, MySQL 5.6 Developer (1z0-882) Free Practice Test
Question 1
Consider a table my_table , with contents shown:

You execute:
SELECT a b, b a
FROM my_table
WHERE a < s
ORDER BY b;
What does this statement return?


You execute:
SELECT a b, b a
FROM my_table
WHERE a < s
ORDER BY b;
What does this statement return?

Correct Answer: A
Question 2
Which two PHP modules provide APIs for developing MYSQL applications?
Correct Answer: B,C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
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: D
Question 4
A floating- point column defined as FLOAT(7,5)allows___________
Correct Answer: C
Question 5
Assume that none of the databases exist.
Which statement results in an error?
Which statement results in an error?
Correct Answer: B
Question 6
The tab-delimited file"/tmp/people,txt contains:
1636 Carsten Pederson Denmark
4672 Kai Voigt Germany
4628 Max Mether France
This is the structure of the people table:
Mysq1> DESCRIBE people;

Which statement will load the first and last names into the Names column and the country into the country column?
1636 Carsten Pederson Denmark
4672 Kai Voigt Germany
4628 Max Mether France
This is the structure of the people table:
Mysq1> DESCRIBE people;

Which statement will load the first and last names into the Names column and the country into the country column?
Correct Answer: B
Question 7
Inspect the SELECT query:
Mysql> EXPLAIN SELECT employees. Emp_no, first_name, last_name FROM employees JOIN title WHERE to_date >
'2008-10-11';

2 rows in set (0.00 sec)
Which action will optimize the query?
Mysql> EXPLAIN SELECT employees. Emp_no, first_name, last_name FROM employees JOIN title WHERE to_date >
'2008-10-11';

2 rows in set (0.00 sec)
Which action will optimize the query?
Correct Answer: D
Question 8
You attempt to create a temporary table by using the following statement:
CREATE TEMPORARY TABLE employeesMAIN
SELECT * FROM employees1
UNION ALL
SELECT * FROM employees2;
What is the result?
CREATE TEMPORARY TABLE employeesMAIN
SELECT * FROM employees1
UNION ALL
SELECT * FROM employees2;
What is the result?
Correct Answer: D
Question 9
You create a table and a stored procedure:
CREATE TABLE t1 (f1 int);
INSERT INTO t1 VALUES (1), (2) , (3), (4), (5);
CREATE PROCEDURE sum_t1()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE va1 INT;
DECLARE result CURSOR FOR SELECT f1 FROM t1;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=1;
OPEN cur;
REPEAT
FETCH cur INTO va1;
IF NOT done THEN
SET result = result +va1;
END IF:
UNTIL done END REPEAT;
SELECT result;
END
CALL sum_t1();
What is the result of the CALL statement?
CREATE TABLE t1 (f1 int);
INSERT INTO t1 VALUES (1), (2) , (3), (4), (5);
CREATE PROCEDURE sum_t1()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE va1 INT;
DECLARE result CURSOR FOR SELECT f1 FROM t1;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=1;
OPEN cur;
REPEAT
FETCH cur INTO va1;
IF NOT done THEN
SET result = result +va1;
END IF:
UNTIL done END REPEAT;
SELECT result;
END
CALL sum_t1();
What is the result of the CALL statement?
Correct Answer: D
Question 10
You try to add a foreign key to the InnoDB table employees:
Mysq1> ALTER TABLE employees ADD FOREIGN KEY (Department_ID) REFERENCES departments (Department_ID);
ERROR 1215 (HY000): cannot add foreign key constraint
Which command will provide additional information about the error?
Mysq1> ALTER TABLE employees ADD FOREIGN KEY (Department_ID) REFERENCES departments (Department_ID);
ERROR 1215 (HY000): cannot add foreign key constraint
Which command will provide additional information about the error?
Correct Answer: D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).