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 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

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

Which of the following is an important consideration when tuning an SQL statement?

  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
  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
  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
  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
  1. UPDATE, DELETE, INSERT and SELECT statements.

  2. UPDATE statements only.

  3. DELETE statements only.

  4. INSERT statements only.


Correct Option: A

What output will the follwing statement produce? Select NVL2(NULL,'NOT NULL', NULL) from dual;

  1. NOT NULL

  2. NULL

  3. Function NVL2 is not defined

  4. None of the above


Correct Option: B

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

  1. TRUE

  2. FALSE

  3. UNDEFINED

  4. NULL


Correct Option: D

Which three definitions are associated with implicit cursors?

  1. %rowtype, %toomanyrows, %found

  2. %found, %notfound, %rowcount

  3. %rowtype, %rowcount, %notfound

  4. None of the above


Correct Option: B
  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