Oracle 1z0-882 Exam Practice Questions (P. 2)
- Full Access (100 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #6
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?
- AThe procedure completes, and 15 is returned
- BThe procedure’s IF condition is not satisfied, and 0 is returned.
- CThe procedure’s loop is not entered, and 1 is returned.
- DAn infinite loop will be running until the command is killed.
Correct Answer:
D
D
send
light_mode
delete
Question #7
A floating- point column defined as FLOAT(7,5)allows___________
- A7 digits to the left of the decimal point and 5 digits to the right
- B5 digits to the left of the decimal point and 7 digits to the right
- C7 digits in total, of which 5 are to the right of the decimal point
- D7 digits in total, of which 5 are to the left of the decimal point
Correct Answer:
C
C
send
light_mode
delete
Question #8
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?
- ASHOW ERRORS
- BError 1215
- CSHOW ENGINE INNODB STATUS
- DSELECT FROM information_schema.INNODB_SYS_FOREIGN
Correct Answer:
A
Reference:
http://zeering.com/LoadAnswers.aspx?q=Foreign%20Key%20constraint
(see update)
A
Reference:
http://zeering.com/LoadAnswers.aspx?q=Foreign%20Key%20constraint
(see update)
send
light_mode
delete
Question #9
Identity two ways to configure a PHP application to use the UTF8 character set.
- Amysqli: :query (‘’SET NAMES utfs’’);
- Bmysqli : :set_charset (‘utf8’)
- Cspdo = new PDO (‘’mysql:host=localhost;dbname=test;charset=utfs’’, user’’, ‘’pass’’);
- DPDO: :set_charset(‘’utf8’’)
Correct Answer:
B
Reference:
http://stackoverflow.com/questions/5842980/a-permanent-way-of-doing-mysqli-set-charset
B
Reference:
http://stackoverflow.com/questions/5842980/a-permanent-way-of-doing-mysqli-set-charset
send
light_mode
delete
Question #10
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?
- ASELECT name FROM t1 WHERE name LIKE ,_e%
- BSELECT name FROM t1 WHERE name LIKE,e%.;
- CSELECT name FROM t1 GROUP BY name ORDER by name LIMIT 1,1;
- DSELECT name FROM t1 GROUP BY name HAVING sun ( marks)=176 ORDER BY name;
Correct Answer:
C
C
send
light_mode
delete
All Pages