APACHE SOLR QUIZ DESCRIPTION Total Questions −30 00 Max Time − 15:00 A developer would like to use referential datatype declaration on a variable. The variable name is EMPLOYEE_LASTNAME, and the corresponding table and column is EMPLOYEE, and LNAME, respectively. How would the developer define this variable using referential datatypes? Use employee.lname%type. Use employee.lname%rowtype. Look up datatype for EMPLOYEE column on LASTNAME table and use that. Declare it to be type LONG. What is the value of customer_id within the nested block in the example below? /* Start main block */ DECLARE customer_id NUMBER(9) := 678; credit_limit NUMBER(10,2) := 10000; BEGIN /* Start nested block */ DECLARE customer_id VARCHAR2(9) := ‘AP56’; current_balance NUMBER(10,2) := 467.87; BEGIN — what is the value of customer_id at this point? NULL; END; END; 678 10000 ‘AP56’ 467.87 All aggregate functions ignore NULLs except for ………… Distinct Count (*) Average() None of above In the context of MS SQL SERVER, with the exception of ………… column(s), any column can participate in the GROUP BY clause. bit text ntext image You want all dates when any employee was hired. Multiple employees were hired on the same date and you want to see the date only once. Query – 1 Select distinct hiredate From hr.employee Order by hiredate; Query – 2 Select hiredate From hr.employees Group by hiredate Order by hiredate; Which of the above query is valid? Query – 1 Query – 2 Both None of the above Select invalid variable types CHAR VARCHAR1 VARCHAR2 INTEGER If you don’t specify a mode for a parameter, what is the default mode? OUT IN COPY DEFAULT What is the correct syntax to create procedure MYPROC that accepts two number parameters X and Y? CREATE PROCEDURE myproc (x NUMBER, y NUMBER) IS … CREATE PROCEDURE (x NUMBER, y NUMBER) myproc IS … CREATE PROCEDURE myproc IS (x NUMBER, y NUMBER) … CREATE PROCEDURE IS myproc (x NUMBER, y NUMBER) … Select invalid variable types CHAR VARCHAR1 VARCHAR2 INTEGER PL/SQL subprograms, unlike anonymous blocks, are compiled each time they are executed. True or False? True False If left out, which of the following would cause an infinite loop to occur in a simple loop? LOOP END LOOP IF-THEN EXIT Below query is run in SQL Server 2012, is this query valid or invalid: Select count(*) as X from Table_Name Group by () Valid Invalid What happens when rows are found using a FETCH statement It causes the cursor to close It causes the cursor to open It loads the current row values into variables It creates the variables to hold the current row values What is the maximum number of handlers processed before the PL/SQL block is exited when an exception occurs? Only one All that apply All referenced None Which of the following is not an Oracle DML function? DECODE TRUNCATE TO_CHAR NVL The command used to open a CURSOR FOR loop is open fetch parse None, cursor for loops handle cursor opening implicitly. Select incorrect variable declarations foo_number varchar2(10); foo_text number(10); foo_char char(1) := ‘Y’; foo_text varchar2(10) := ‘hello world’; If you SELECT attributes and use an aggregate function, you must GROUP BY the non_aggregate attributes. TRUE FAlSE Select the invalid PL/SQL looping construct. A. WHILE LOOP … END LOOP; B. FOR rec IN some_cursor LOOP … END LOOP; C. LOOP … UNTIL ; END LOOP; D. LOOP … EXIT WHEN ; END LOOP; E. None of the above. All are valid. Answers are option A and C Answers are option A and B Answers are option A and D Answers are option C and D Which line in the following statement will produce an error? cursor action_cursor is select name, rate, action into action_record from action_table; For which task is it best to use a character string enclosed by double quotes? Please select the best answer. Referring to a column in the database Using a reserved word to declare an identifier Using a hyphen to concatenate two columns Referring to a number variable by using a logical operator Assuming the date and time is 09/09/2009 09:09:09, what value will the following statement return SELECT TO_CHAR(TRUNC(SYSDATE),’MM/DD/YYYY HH24:MI:SS’) FROM dual; 09/09/2009 09:09:09 09/09/2009 09:09:09AM 09/09/2009 09/09/2009 00:00:00 Where do you declare an explicit cursor in the PL/SQL language? In the PL/SQL working storage section In the PL/SQL declaration section In the PL/SQL body section In the PL/SQL exception section Which of the following is not a valid Oracle PL/SQL exception. NO_DATA_FOUND ORA-01403 TWO_MANY_ROWS ORA-01422 DUP_VAL_ON_INDEX ORA-00001 OTHERS For which trigger timing can you reference the NEW and OLD qualifiers? Statement and Row Statement only Row only Oracle Forms trigger What are the parameters defined to specify window operation Window length, sliding interval State size, window length State size, sliding interval None of the above Which of the following statements is true about implicit cursors? Implicit cursors are used for SQL statements that are not named. Developers should use implicit cursors with great care. Implicit cursors are used in cursor for loops to handle data processing. Implicit cursors are no longer a feature in Oracle. Which kind of parameters cannot have a DEFAULT value? OUT IN CONSTANT R(ead) Using GROUP BY ………… has the effect of removing duplicates from the data. with aggregates with order by without order by without aggregates List the correct sequence of commands to process a set of records when using explicit cursors INITIALIZE, GET, CLOSE CURSOR, GET, FETCH, CLOSE OPEN, FETCH, CLOSE CURSOR, FETCH, CLOSE Previous Next Total Question16 Wrong Answer13 Right Answer13