0

programming languages Online Quiz - 174

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

Which function below can best be categorized as similar in function to an IF-THEN-ELSE statement?

  1. SQRT

  2. DECODE

  3. NEW_TIME

  4. ROWIDTOCHAR


Correct Option: B

AI Explanation

To answer this question, we need to understand the concept of an IF-THEN-ELSE statement and compare it to the given functions.

An IF-THEN-ELSE statement is a control structure used in programming to make decisions based on certain conditions. It allows the program to execute different blocks of code depending on whether a specified condition is true or false.

Let's go through each option to determine which one is most similar in function to an IF-THEN-ELSE statement:

Option A) SQRT - This function calculates the square root of a given number. It does not involve any decision-making or conditional branching, so it is not similar to an IF-THEN-ELSE statement.

Option B) DECODE - This function is used to perform conditional branching within a SQL statement. It allows you to specify multiple conditions and their corresponding values. If the condition is true, it returns the specified value; otherwise, it returns a default value. This function closely resembles the functionality of an IF-THEN-ELSE statement, making it the correct answer.

Option C) NEW_TIME - This function is used to convert the time in one time zone to the time in another time zone. It does not involve any decision-making or conditional branching, so it is not similar to an IF-THEN-ELSE statement.

Option D) ROWIDTOCHAR - This function converts a ROWID value to a character string. It does not involve any decision-making or conditional branching, so it is not similar to an IF-THEN-ELSE statement.

Therefore, the correct answer is Option B) DECODE. This function can best be categorized as similar in function to an IF-THEN-ELSE statement because it allows for conditional branching within a SQL statement.

  1. Place the alias at the beginning of the statement to describe the table.

  2. Place the alias after each column, separated by white space, to describe the column.

  3. Place the alias after each column, separated by a comma, to describe the column

  4. Place the alias at the end of the statement to describe the table.


Correct Option: C
  1. The emacs editor will become the SQL*Plus default text editor.

  2. The emacs editor will start running immediately.

  3. The emacs editor will no longer be used by SQL*Plus as the default text editor.

  4. The emacs editor will be deleted from the system.


Correct Option: A
  1. Until the database is shut down

  2. Until the instance is shut down

  3. Until the statement completes

  4. Until the session completes


Correct Option: C

Which of the following options will allow you to drop the user david and all objects in the schema that are associated with that user?

  1. DROP USER david all

  2. DROP USER david schema

  3. DROP USER david cascade

  4. DROP USER david cascade schema


Correct Option: C

identify the meaning of the following SQL statement CREATE USER PETRIE IDENTIFIED EXTERNALLY DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMPS QUOTA 12M ON forms

  1. The user is being validated by the enterprise directory service

  2. The user has unlimited quota on the USERS tablespace.

  3. The user’s quota will never exceed the size of the temporary tablespace.

  4. All options are correct.


Correct Option: B

You are setting up two multiplexed online redo log file groups with three members in each group, how many disks are necessary at minimum?

  1. 3

  2. 0

  3. 1

  4. no disk required


Correct Option: A

What can be said of the following SQL statement? CREATE GLOBAL TEMPORARY TABLE extra_area (startdate DATE, enddate DATE, class CHAR(15)) ON COMMIT DELETE ROWS

  1. It is a session specific table.

  2. It is an invalid SQL statement.

  3. It is only available in Oracle 7

  4. It is a transaction specific table.


Correct Option: D

The database administrator is taking the cbgb tablespace offline, due to erroneous datafiles in the tablespace. Which offline tablespace option should be chosen?

  1. NORMAL

  2. TEMPORARY

  3. IMMEDIATE

  4. FOR RECOVER


Correct Option: B
  1. DBA

  2. RESOURCE

  3. CONNECT

  4. EXP_FULL_DATABASE

  5. IMP_FULL_DATABASE

  6. All the above


Correct Option: F

Which of the following role properties would be beneficial if you want to grant privileges to a group of specified users to a certain role?

  1. Reduced privilege administration

  2. Selective availability of privileges

  3. Application awareness

  4. Application-specific security


Correct Option: A
  1. By default, tables within the tablespace will not have all its changes written to redo.

  2. It is a locally managed tablespace.

  3. A temporary tablespace has been created.

  4. An error will be produced; the AUTOALLOCATE parameter should be removed


Correct Option: D

Provide a declaration for i that turns this loop into an infinite loop: while( i != i){ }

  1. String i = "abc"

  2. double i = 0.0/0.0

  3. int i = 3/7

  4. int i = 0


Correct Option: B

Provide a declaration for i that turns this loop into infinite loop: while( i != i + 0){ }

  1. Char i = 9

  2. int i = 3/7

  3. String i = "abc"

  4. int i = 0


Correct Option: C

Is this a legal Java Program? If so, what does it print? \u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020\u0020 \u0063\u006c\u0061\u0073\u0073\u0020\u0055\u0067\u006c\u0079 \u007b\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020 \u0020\u0020\u0020\u0020\u0073\u0074\u0061\u0074\u0069\u0063 \u0076\u006f\u0069\u0064\u0020\u006d\u0061\u0069\u006e\u0028 \u0053\u0074\u0072\u0069\u006e\u0067\u005b\u005d\u0020\u0020 \u0020\u0020\u0020\u0020\u0061\u0072\u0067\u0073\u0029\u007b \u0053\u0079\u0073\u0074\u0065\u006d\u002e\u006f\u0075\u0074 \u002e\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0020 \u0022\u0048\u0065\u006c\u006c\u006f\u0020\u0077\u0022\u002b \u0022\u006f\u0072\u006c\u0064\u0022\u0029\u003b\u007d\u007d

  1. Its not possible

  2. print some garbage value

  3. compilation error

  4. Hello world


Correct Option: D

What does it print? public class Elementary { public static void main(String[] args) { System.out.println(12345 + 5432l); } }

  1. Compilation error

  2. Runtime error

  3. 17777

  4. 66666


Correct Option: C

What happens when the following code is compiled and run. Select the one correct answer. for(int i = 2; i < 4; i++) for(int j = 2; j < 4; j++) if(i < j) assert i!=j : i;

  1. The class compiles and runs, but does not print anything.

  2. The number 2 gets printed with AssertionError

  3. compile error

  4. The number 3 gets printed with AssertionError


Correct Option: A
- Hide questions