0

programming languages Online Quiz - 286

Description: programming languages Online Quiz - 286
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

IN WHICH OF THE FOLLOWING VERSIONS OF COBOL, THE USE OF GO TO STATEMENT HAS BEEN ELIMINATED FROM COBOL STANDARDS?

  1. COBOL-68

  2. COBOL-74

  3. COBOL-85

  4. COBOL-9x


Correct Option: C

The settings in the Data Browser/Table View Maintenance field...

  1. Regulate the transport of the table's data records during installs, upgrades, copies

  2. Regulate the scope that you may use to display and maintain data records

  3. Answers A & B

  4. None of the above


Correct Option: B

What are the two elementary data types provided for character strings in ABAP?

  1. a and b

  2. x and y

  3. p and f

  4. c and n


Correct Option: D

Which data type cannot be used to define parameters

  1. Type N

  2. Type C

  3. Type F

  4. Type P


Correct Option: C

Which statement will cause a syntax check error?

  1. Constants:x(3) type c value '123'.

  2. Data:x(3) type c.

  3. Constants:x(3) type c.

  4. Data:x(3) type c value '123'.


Correct Option: C

What is the effect when a clear statement is used on an internal table without header line?

  1. All the lines of the table are deleted

  2. The work area is initialized

  3. All the lines of the table are initialized

  4. Nothing


Correct Option: C

Examine the following PL/SQL block of code: ... DELETE FROM orders WHERE pay_stat = ‘Overdue’; IF SQL%ROWCOUNT > 5 THEN RAISE out_of_bounds; END IF; ... What value is returned after the statement is run and the DELETE statement returned no rows?

  1. 0

  2. 1

  3. 5

  4. true

  5. false


Correct Option: A

What must be included within a cursor when the WHERE CURRENT OF clause is used in PL/SQL?

  1. DELETE clause

  2. UPDATE clause

  3. ROWID pseudocolumn

  4. FOR UPDATE clause


Correct Option: D

What can be implemented to reuse a cursor definition in PL/SQL?

  1. Cursor FOR loop

  2. FETCH statement

  3. %ISOPEN attribute

  4. Parameters


Correct Option: D

What command can you use to test a named PL/SQL block for compilation?

  1. ANALYZE_SCHEMA

  2. CREATE OR REPLACE

  3. SHOW ERRORS

  4. FORMAT_ERROR_STACK


Correct Option: B

In CPP program if the function is defined in the same program file before it is called, a separate prototype is required.

  1. True

  2. False


Correct Option: B

Which of the following is an error in calling the function? void func( int i = 5, double d = 1.234 );

  1. func( 9, 5.67 )

  2. func( 4 )

  3. func()

  4. func( ,4 )


Correct Option: D

Which of the following can be used to modify the value of a variable?

  1. Pointer

  2. References

  3. Both

  4. None of the above


Correct Option: A

Public inheritance signifies__________ relation ship

  1. for a

  2. is a

  3. with a

  4. has a


Correct Option: B

A const pointer cannot be assigned to an ordinary pointer.

  1. True

  2. False


Correct Option: A

Carl, a database user, creates and executes the following SQL statement: CREATE SYNONYM employee FOR stanley.employee; What statements below are true?

  1. Only Carl can access the EMPLOYEE synonym.

  2. The EMPLOYEE synonym is a public synonym.

  3. The synonym name cannot be the same as the object name.

  4. Stanley can access the EMPLOYEE synonym.

  5. The synonym can be accessed remotely.

  6. The EMPLOYEE synonym is a private synonym.


Correct Option: D,F

Which of the following SQL statements will not execute successfully? (Choose all that apply)

  1. SELECT lname, jobid, sal, sal+500 FROM emp;

  2. SELECT lname, jobid, sal FROM emp (sal + 500);

  3. SELECT lname, jobid, sal, sal + 500 “Bonus” FROM emp;

  4. SELECT lname, jobid, sal, sal + 500 bonus FROM emp

  5. SELECT lname || to_char(sal+500) “Employee Bonus” FROM emp;

  6. SELECT lname, sal + 500 Employee Bonus FROM emp;


Correct Option: B,D,F

AI Explanation

To answer this question, we need to analyze each SQL statement and determine whether it will execute successfully or not.

A. SELECT lname, jobid, sal, sal+500 FROM emp; This statement will execute successfully because it selects the lname, jobid, sal columns from the emp table and performs the addition of sal and 500.

B. SELECT lname, jobid, sal FROM emp (sal + 500); This statement will not execute successfully because there is a syntax error. The correct syntax to perform calculations on columns is to use the SELECT statement and specify the operation directly on the column, as shown in option A.

C. SELECT lname, jobid, sal, sal + 500 "Bonus" FROM emp; This statement will execute successfully because it selects the lname, jobid, sal columns from the emp table and performs the addition of sal and 500. It also assigns the alias "Bonus" to the calculated column.

D. SELECT lname, jobid, sal, sal + 500 bonus FROM emp; This statement will not execute successfully because there is a syntax error. The column name "bonus" is not enclosed in quotes or square brackets. To include special characters or spaces in column names, they should be enclosed in quotes or square brackets.

E. SELECT lname || to_char(sal+500) "Employee Bonus" FROM emp; This statement will execute successfully because it concatenates the lname column with the result of sal+500. The to_char function is used to convert the calculated value to a character data type. It also assigns the alias "Employee Bonus" to the calculated column.

F. SELECT lname, sal + 500 Employee Bonus FROM emp; This statement will not execute successfully because there is a syntax error. The column name "Employee Bonus" should be enclosed in quotes or square brackets.

Therefore, the SQL statements that will not execute successfully are B, D, and F.

You run the following SQL statement: SELECT a.lname, a.location, b.dname, b.hiredate FROM emp a, emp b WHERE a.empid=b.empid; Which options are correct? (Choose all that apply)

  1. This is an equijoin.

  2. This is a self join.

  3. Line 2 will return an error.

  4. Line 3 will return an error.

  5. The statement will execute successfully.


Correct Option: B,E

You create the following PL/SQL block: DECLARE var1 CONSTANT NUMBER := 50; var2 NUMBER := 0; BEGIN SELECT acctno INTO var2 FROM bank_acct WHERE name = 'JORDAN'; var1 :=var2 + 2000; END; Which of the following lines in this block of PL/SQL code will produce an error?

  1. var2 NUMBER := 0;

  2. INTO var2

  3. WHERE name = 'JORDAN';

  4. var1 :=var2 + 2000;

  5. There are no errors in this PL/SQL block


Correct Option: D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) var2 NUMBER := 0; - This line is correct. It declares a variable var2 of type NUMBER and initializes it with a value of 0. There is no error in this line.

Option B) INTO var2 - This line is correct. It is part of the SELECT statement and specifies that the result of the SELECT query should be stored in the variable var2. There is no error in this line.

Option C) WHERE name = 'JORDAN'; - This line is correct. It is part of the SELECT statement and specifies the condition for the WHERE clause. It filters the rows based on the value of the name column equal to 'JORDAN'. There is no error in this line.

Option D) var1 :=var2 + 2000; - This line will produce an error. The variable var1 is declared as a constant using the CONSTANT keyword. Constants cannot be assigned new values once they are declared. Therefore, trying to assign a new value to var1 will result in an error.

Option E) There are no errors in this PL/SQL block - This option is incorrect. As explained above, the line var1 :=var2 + 2000; will produce an error. Therefore, there is an error in this PL/SQL block.

The correct answer is D. This line (var1 :=var2 + 2000;) will produce an error because var1 is declared as a constant and cannot be assigned a new value.

- Hide questions