0

databases Online Quiz - 101

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

When Database A has 5GB of spool space, Database B is created as child of Database A with 3GB of spool space, then Database A will have

  1. 2GB of spool space

  2. 5GB of spool space

  3. 2GB of permanent space

  4. 3GB of spool space


Correct Option: B

When the 'SELECT' clause of the SQL has the aggregate function, it is must to have this clause to prevent error

  1. WHERE

  2. ORDER BY

  3. GROUP BY

  4. Aggregate Function


Correct Option: C

Identify the OLAP function from the given options

  1. MSUM

  2. SUM

  3. AVG

  4. All of the above


Correct Option: A

Statistics cannot be collected on this table

  1. Permanent Table

  2. Set Table

  3. Multiset Table

  4. Volatile Table


Correct Option: D

What best describes the relationship between indexes and SQL performance?

  1. Indexes are only used in special cases

  2. Indexes are used to make table storage more efficient

  3. Indexes rarely make a difference in SQL performance

  4. Indexes exist solely to improve query speed


Correct Option: D
  1. The number of CPUs on the server

  2. The degree of parallelism on the tables

  3. The quality of the SQL optimization

  4. The use of bitmap indexes


Correct Option: C

We refer to a join as a self-join when…

  1. We are joining two tables only

  2. we are using left and right join together

  3. we are joining table to itself

  4. we are joining more than 2 tables


Correct Option: C

AI Explanation

To answer this question, we need to understand what a self-join is.

A self-join occurs when we join a table to itself. This means that we treat the same table as two separate entities and perform a join operation on them.

Option A) We are joining two tables only - This option is incorrect because a self-join involves joining a table to itself, not two separate tables.

Option B) We are using left and right join together - This option is incorrect because a self-join can be performed using any type of join, not just a combination of left and right join.

Option C) We are joining table to itself - This option is correct because a self-join is defined as joining a table to itself.

Option D) We are joining more than 2 tables - This option is incorrect because a self-join involves joining a table to itself, not multiple tables.

Therefore, the correct answer is option C) We are joining table to itself.

Which SQL statement selects all rows from table called Contest, with column ContestDate having values greater or equal to May 25, 2006?

  1. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'

  2. SELECT * FROM Contest GROUPBY ContestDate >= '05/25/2006'

  3. SELECT * FROM Contest WHERE ContestDate < '05/25/2006'

  4. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'


Correct Option: A
Explanation:

To solve this question, the user needs to know the syntax of SQL SELECT statements, how to select all rows from a table, how to specify column names, and how to use the WHERE clause to filter rows based on a certain condition.

Now, let's go through each option and explain why it is right or wrong:

A. SELECT * FROM Contest WHERE ContestDate >= '05/25/2006': This option is correct. This statement selects all columns and rows from the Contest table where the ContestDate column has a value greater than or equal to May 25, 2006. The date is specified in the format MM/DD/YYYY, which is a valid format for SQL.

B. SELECT * FROM Contest GROUPBY ContestDate >= '05/25/2006': This option is incorrect because it contains a syntax error. The GROUP BY clause is used to group rows based on a certain criteria, not to filter them. Also, the condition is not valid in the GROUP BY clause.

C. SELECT * FROM Contest WHERE ContestDate < '05/25/2006': This option is incorrect because it selects all rows from the Contest table where the ContestDate column has a value less than May 25, 2006. The question asks for values greater than or equal to that date.

D. SELECT * FROM Contest HAVING ContestDate >= '05/25/2006': This option is incorrect because the HAVING clause is used to filter rows based on a condition that involves an aggregate function. It cannot be used to filter rows based on a simple comparison like the one specified in this question.

The Answer is: A

The INNER JOIN clause…

  1. returns all the matching rows from 2 tables.

  2. returns only the rows from the first table, which have non-matching values with the second table in the field on which the 2 tables are joined.

  3. returns all rows from 2 tables.

  4. returns all rows that have matching value in the field on which the 2 tables are joined.


Correct Option: D

What is an index?

  1. An index is the same as alias.

  2. An index is a special way to join 2 or more tables.

  3. An index is a database table attribute, which speeds-up data search within a table.

  4. An index is a database row attribute, which speeds-up data search within a table.


Correct Option: C

If you don't specify ASC or DESC after a SQL ORDER BY clause, the following is used by default:

  1. There is no default value.

  2. DESC

  3. Random

  4. ASC


Correct Option: D
  1. TRUNCATE Sales TABLE

  2. TRUNCATE * FROM TABLE Sales

  3. TRUNCATE TABLE Sales

  4. TRUNCATE * FROM COLUMN Sales


Correct Option: C
  1. Removal of data redundancy

  2. The introduction of data redundancy

  3. The introduction of non-first normal form relations

  4. The introduction of SQL*Plus


Correct Option: B
  1. Access. Constant. Information. Data.

  2. Atomicity. Consistency. Isolation. Durability.

  3. Access. Constraint. Index. Data.

  4. Access. Consistency. Isolation. Data.


Correct Option: B

Sub-queries can be nested in…

  1. UPDATE, DELETE, INSERT and SELECT statements.

  2. UPDATE statements only.

  3. DELETE statements only.

  4. INSERT statements only.


Correct Option: A

AI Explanation

To answer this question, you need to understand where sub-queries can be nested.

Option A) UPDATE, DELETE, INSERT and SELECT statements - This option is correct because sub-queries can be nested in all of these statements. Sub-queries are used to retrieve data from one table and use it in another table or perform operations on it.

Option B) UPDATE statements only - This option is incorrect. Sub-queries can be nested in UPDATE statements, but they can also be used in other types of statements.

Option C) DELETE statements only - This option is incorrect. Sub-queries can be nested in DELETE statements, but they can also be used in other types of statements.

Option D) INSERT statements only - This option is incorrect. Sub-queries can be nested in INSERT statements, but they can also be used in other types of statements.

The correct answer is A) UPDATE, DELETE, INSERT and SELECT statements. This option is correct because sub-queries can be nested in all of these statements.

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

  1. TRUE

  2. FALSE

  3. UNDEFINED

  4. NULL


Correct Option: D
  1. %rowtype, %toomanyrows, %found

  2. %found, %notfound, %rowcount

  3. %rowtype, %rowcount, %notfound

  4. None of the above


Correct Option: B

In a PL/SQL block, a variable is declared as NUMBER without an initial value. What will its value be when it is first used in the executable section of the PL/SQL block?

  1. 0

  2. NULL

  3. Results in a compilation error

  4. An exception will be raised


Correct Option: B
Explanation:

To solve this question, the user needs to know what happens when a variable is declared in PL/SQL without an initial value.

The answer is:

B. NULL

If a variable is declared in PL/SQL without an initial value, its value will be NULL when it is first used in the executable section of the PL/SQL block. This means that the variable does not have a value assigned to it yet. If the variable is used in an expression or operation, it will result in a NULL value, which can cause unexpected behavior in your code.

Option A is incorrect because the variable will not have a value of 0 by default.

Option C is incorrect because declaring a variable without an initial value is legal and will not result in a compilation error.

Option D is incorrect because an exception will not be raised when a variable is declared without an initial value. It will simply have a value of NULL.

- Hide questions