0

databases Online Quiz - 40

Description: databases Online Quiz - 40
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0

How many columns are presented after executing this query: SELECT address1||','||address2||','||address2 "Adress" FROM employee;

  1. 3

  2. 4

  3. 1

  4. None


Correct Option: C

Which of the following can be a valid column name?

  1. Column

  2. 1966_Invoices

  3. #Invoices

  4. Catch_#22


Correct Option: D

AI Explanation

To answer this question, we need to understand the rules for valid column names in databases.

In most databases, including SQL, column names must adhere to the following rules:

  1. Column names can contain letters (A-Z, a-z), numbers (0-9), and underscores (_).
  2. Column names cannot start with a number.
  3. Column names cannot contain special characters like spaces, symbols, or punctuation marks except for underscores (_).
  4. Column names are case-insensitive, meaning "Column" and "column" are considered the same.

Let's go through each option to determine if it is a valid column name:

A. Column - This option is valid because it only contains letters and does not violate any of the rules mentioned above.

B. 1966_Invoices - This option is valid because it contains letters, numbers, and underscores. However, it starts with a number, which violates the second rule. Therefore, this option is not a valid column name.

C. #Invoices - This option is not valid because it contains a special character (#) that is not allowed in column names.

D. Catch_#22 - This option is valid because it contains letters, numbers, and underscores. It does not violate any of the rules mentioned above. Therefore, this option is a valid column name.

Based on the above analysis, the correct answer is D. Catch_#22, as it follows all the rules for a valid column name.

When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?

  1. Default tablespace for the user

  2. Oracle will give an error

  3. System tablespace

  4. Users tablespace


Correct Option: A

AI Explanation

To answer this question, you need to understand how Oracle manages storage for database objects.

When a user creates an object (such as a table or index) without specifying a TABLESPACE clause, Oracle will store the segment in the user's default tablespace.

Option A) Default tablespace for the user - This option is correct. When a user does not specify a TABLESPACE clause while creating an object, Oracle will store the segment in the user's default tablespace.

Option B) Oracle will give an error - This option is incorrect. Oracle does not give an error when a user does not specify a TABLESPACE clause. Instead, it uses the default tablespace for the user.

Option C) System tablespace - This option is incorrect. The system tablespace is used for storing system-related objects and metadata, not user-created objects.

Option D) Users tablespace - This option is incorrect. The "USERS" tablespace is a commonly used tablespace for storing user-created objects, but it is not the default tablespace for every user.

The correct answer is A) Default tablespace for the user. This option is correct because Oracle will store the segment in the user's default tablespace if the TABLESPACE clause is not specified during object creation.

In this PL/SQL statement, which of the following lines will produce an error?

  1. cursor CAPITALS is

  2. select CITY, STATE

  3. into my_city, my_state

  4. from CITIES where CAPITAL = 'Y';


Correct Option: C

PL/SQL raises an exception, in which TWO of the following cases:

  1. When the datatypes of SELECT clause and INTO clause do not match

  2. When a SELECT statement returns more than one row

  3. When a SELECT statement returns no rows

  4. When INTO statement is missing in the SELECT statement


Correct Option: B,C

What is the result if two NULL values are compared to each other?

  1. True

  2. False

  3. NULL

  4. Undefined


Correct Option: C

Which section of a PL/SQL block would most likely contain a RAISE statement?

  1. Header

  2. Declarative

  3. Executable

  4. Exception


Correct Option: C,D

Assuming today is Monday, 10 July 2000, what is returned by this statement: SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;

  1. 10-JUL-00

  2. 17-JUL-00

  3. 12-JUL-00

  4. 11-JUL-00


Correct Option: B

SQL statement with “High Selectivity” means

  1. No. of rows returned by SQL statement are HIGH

  2. No. of rows returned by SQL statement are FEW

  3. No. of rows returned by SQL statement are > 10000

  4. No. of rows returned by SQL statement are > 50000


Correct Option: B

Why one should not use “select * from table;” Choose all that apply

  1. Avoid full table scan

  2. Avoid index scan

  3. Avoid network traffic

  4. Avoid cartesian join


Correct Option: A,C

What is skewed data column?

  1. Columns that contains values with less variation in the number of duplicates

  2. Columns that contains values with large variation in the number of duplicates

  3. Columns that contains values with no variation in the number of duplicates

  4. Columns that contains values with ZERO variation in the number of duplicates


Correct Option: B

Which tool is used to analyze access path of SQL statement?

  1. Exp

  2. Imp

  3. Explain Plan

  4. vi Editor


Correct Option: C

What is true about the explain plan? Choose all that apply

  1. The more heavily indented an access path is, the earlier it is executed

  2. The more heavily indented an access path is, the later it is executed

  3. If two steps are indented at the same level, the uppermost statement is executed first

  4. If two steps are indented at the same level, the uppermost statement is executed last


Correct Option: A,C

What is true about ordering in the SQL statement? Choose all that apply

  1. Right to Left processing of Source (Tables, views etc.) by Parser

  2. Left to Right processing of Source (Tables, views etc.) by Parser

  3. Bottom to Up processing of WHERE condition clauses

  4. Up to Bottom processing of WHERE condition clauses


Correct Option: A,C

Why one should not use NULL / NOT NULL operator on indexed columns?

  1. Using NULL / NOT NULL on indexed columns won’t use INDEX

  2. Using NULL / NOT NULL on indexed columns gives ERROR

  3. Using NULL / NOT NULL on indexed columns disables INDEX

  4. Using NULL / NOT NULL on indexed columns makes the INDEX unusable


Correct Option: A

Using frequent COMMIT statements in the code frees up resources like undo segments, locks acquired etc.

  1. True

  2. False


Correct Option: A

What is the expansion of ADDM?

  1. Automated Database Deployment Monitor

  2. Automated Database Development Monitor

  3. Automated Database Diagnostic Monitor

  4. Automated Database Distributed Monitor


Correct Option: C

Which view helps in identifying resource utilization of queries?

  1. V$SQL

  2. V$SQL_STAT

  3. V$SQLSTATS

  4. V$SQL_STATISTICS


Correct Option: C

Which of the following degrades the performance of database?

  1. Equi Join

  2. Outer Join

  3. Non-Equi Join

  4. Cartesian Join


Correct Option: D

Do you need to recycle Views for better performance?

  1. True

  2. False


Correct Option: B
- Hide questions