Database Fundamentals and SQL Programming

Comprehensive quiz covering SQL queries, PL/SQL programming, database design, indexes, joins, and performance optimization concepts.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

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
Question 2 Multiple Choice (Single Answer)

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
Question 3 Multiple Choice (Single Answer)

Identify the OLAP function from the given options

  1. MSUM
  2. SUM
  3. AVG
  4. All of the above
Question 4 Multiple Choice (Single Answer)

Statistics cannot be collected on this table

  1. Permanent Table
  2. Set Table
  3. Multiset Table
  4. Volatile Table
Question 5 Multiple Choice (Single Answer)

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
Question 6 Multiple Choice (Single Answer)

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
Question 7 Multiple Choice (Single Answer)

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
Question 8 Multiple Choice (Single Answer)

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'
Question 9 Multiple Choice (Single Answer)

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.
Question 10 Multiple Choice (Single Answer)

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.
Question 11 Multiple Choice (Single Answer)

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
Question 12 Multiple Choice (Single Answer)

Which of the following SQL statements is correct?

  1. TRUNCATE Sales TABLE
  2. TRUNCATE * FROM TABLE Sales
  3. TRUNCATE TABLE Sales
  4. TRUNCATE * FROM COLUMN Sales
Question 13 Multiple Choice (Single Answer)

Which of the following database design features is most important to SQL performance?

  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
Question 14 Multiple Choice (Single Answer)

What does ACID stand for?

  1. Access. Constant. Information. Data.
  2. Atomicity. Consistency. Isolation. Durability.
  3. Access. Constraint. Index. Data.
  4. Access. Consistency. Isolation. Data.
Question 15 Multiple Choice (Single Answer)

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.
Question 16 Multiple Choice (Single Answer)

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
Question 17 Multiple Choice (Single Answer)

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

  1. TRUE
  2. FALSE
  3. UNDEFINED
  4. NULL
Question 18 Multiple Choice (Single Answer)

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
Question 19 Multiple Choice (Single Answer)

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
Question 20 Multiple Choice (Single Answer)

Functions for error trapping are contained in which section of a PL/SQL block?

  1. Header
  2. Declarative
  3. Exception
  4. Executable