click below
click below
Normal Size Small Size show me how
DBMS S1
| Question | Answer |
|---|---|
| The _____ is an integer value that represents the number of rows affected by the most recent SQL statement. | SQL%ROWCOUNT |
| The DDL and _______ SQL statements cannot be used directly in PL/SQL. | DCL |
| The INTO clause occurs between the _______ and FROM clauses. | SELECT |
| The _________ cursors are defined by the PL/SQL programmer. | EXPLICIT |
| The _____ statement selects rows from one table to update and/or insert into another table. | MERGE |
| The use of INTO clause in PL/SQL select statement is to specify the name of: ____________. | VARIABLE |
| What could be the possible error of the given code below? DECLARE v_sum_sal NUMBER(10,2); v_deptno NUMBER NOT NULL := 60; | No error |
| BEGIN SELECT SUM(salary) INTO v_sum_sal FROM employees WHERE department_id = v_deptno; | No error |
| DBMS_OUTPUT.PUT_LINE('Dep #60 Salary Total: ' || v_sum_sal); END; | No error |
| --What could be the possible error of the given code below? DECLARE v_sal_increase employees.salary%TYPE := 800; BEGIN UPDATE copy_emp | No error |
| SET salary = salary + v_sal_increase WHERE job_id = 'ST_CLERK'; END; | No error |
| ---What could be the possible error of the given code below? DECLARE v_deptno employees.department_id%TYPE := 10; BEGIN | No error |
| DELETE FROM copy_emp WHERE department_id = v_deptno; END; | No error |
| What could be the possible error of the given code below? DECLARE v_sum_sal NUMBER(10,2); v_deptno NUMBER NOT NULL := 60; BEGIN | Missing INTO clause |
| SELECT SUM(salary) FROM employees WHERE department_id = v_deptno; DBMS_OUTPUT.PUT_LINE('Dep #60 Salary Total: ' || v_sum_sal); END; | Missing INTO clause |
| -Is there something missing in the given code? DECLARE v_myage NUMBER := 31; BEGIN IF v_myage < 11 | TRUE |
| DBMS_OUTPUT.PUT_LINE('I am a child'); END IF; Is there something missing in the given code? DECLARE v_myage NUMBER := 31; BEGIN END; | TRUE |
| --Is there something missing in the given code? DECLARE v_myage NUMBER := 31; BEGIN | TRUE |
| IF v_myage < 11 DBMS_OUTPUT.PUT_LINE('I am a child'); END IF; END; | TRUE |
| The use of CASE statement to test conditions such as <, >, >=, <= is know as case expression. | FALSE |
| Consider the given code fragment below. The condition will return a false value. A:=null; B:=null; If A = B then . . . . . | FALSE |
| Applying the logical operator NOT to a null yields NULL. | TRUE |
| Refer to M1S2-code reference#3, the missing in the last case selection is v_aport > 10000. | TRUE |
| Refer to M1S2-code reference#3, what is missing in the last case selection? | > 10000 |
| Refer to M1S2-code reference#3, what is missing in the creation of the implicit cursor? | Airport |
| ----What is missing in the given code? DECLARE v_grade CHAR(1) := 'A'; v_appraisal VARCHAR2(20); BEGIN v_appraisal := CASE WHEN v_grade = 'A' THEN 'Excellent' | ELSE |
| WHEN v_grade IN ('B','C') THEN 'Good' END; DBMS_OUTPUT.PUT_LINE ('Grade: '|| v_grade || ' Appraisal ' || v_appraisal); END; | ELSE |
| Refer to M1S2-code reference#3, what must be displayed in the dbms_output? | VMESG |
| Refer to M1S2-code reference#3, what is missing in the given CASE structure? | () |
| Refer to M1S3-code reference#1, what should be the initial value of vctr? | 51 |
| Refer to M1S3-code reference#1, what is missing in the creation of the implicit cursor inside the loop body? _______ | VCTR |
| What is missing in the given WHILE loop syntax? ________ WHILE condition statement1; statement2; . . . END ; | LOOP |
| Refer to M1S3-code reference#1, what type of looping is used in the code? ________ | COUNTER CONTROLLED LOOP |
| Refer to M1S3-code reference#1, what value must be stored in vctr inside the loop body? ______________ | VCTR+1 |
| Refer to M1S3-code reference#1, the loop body will be performed 5 times. | TRUE |
| In BASIC and WHILE loop, the iteration will terminate when the counter is > than the upper bound. | FALSE |
| In for loop, counter must be explicitly declared. | FALSE |
| Refer to M1S3-code reference #4, the ‘>’ is the missing operator in the EXIT section. | TRUE |
| The lower and upper bound of a for loop must be a numeric literals. | FALSE |
| The ______ are automatically declared variables that allow you to evaluate what happened when a cursor was last used. | CURSOR ATTRIBUTE |
| The ______ is a Boolean attribute that evaluates to TRUE if the most recent SQL statement did not return even one row. | %NOTFOUND |
| The _______cursor are automatically defined by Oracle. | IMPLICIT |
| The _______ statement selects rows from one table to update and/or insert into another table. | MERGE |
| What could be the possible error of the given code below? DECLARE v_salary employees.salary%TYPE; BEGIN SELECT salary INTO v_salary | NO ERROR |
| FROM employees where employee_id = 100; DBMS_OUTPUT.PUT_LINE(' Salary is : ' || v_salary); END; | NO ERROR |
| Boolean attribute that evaluates to TRUE if the most recent SQL statement did not return even one row. A. | SQL%NOTFOUND |
| An integer value that represents the number of rows affected by the most recent SQL. | SQL%ROWCOUNT |
| Refer to M1S2-code reference#3, data type for vmesg variable must be CHAR. | FALSE |
| Control structures are used to change the logical flow of statements within the PL/SQL block. | TRUE |
| Is there something missing in the given code? DECLARE v_myage NUMBER := 31; BEGIN IF v_myage < 11 | TRUE |
| DBMS_OUTPUT.PUT_LINE('I am a child'); END IF; END; | TRUE |
| Refer to M1S2-code reference#3, what is the correct data type for vmesg? | VARCHAR2 |
| The ______ is the symbol used for the assignment operator. | := |
| Refer to M1S2-code reference#1, what is that last missing element? | end if; |
| Use the ______ loop when the statement inside the loop must execute at least once. | LOOP…EXIT WHEN |
| Refer to M1S3-code reference#1, how many time the loop body will be performed? __________ | 55 |
| In BASIC and WHILE loop, the iteration will terminate when the counter is < than the upper bound. | FALSE |
| Use a DO..WHILE loop when the statement inside the loop must execute at least once. | TRUE |
| A loop structure must have an exit clause. | FALSE |