Database Fundamentals and SQL Programming
Comprehensive quiz covering SQL queries, PL/SQL programming, database design, indexes, joins, and performance optimization concepts.
Questions
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
- 2GB of spool space
- 5GB of spool space
- 2GB of permanent space
- 3GB of spool space
When the 'SELECT' clause of the SQL has the aggregate function, it is must to have this clause to prevent error
- WHERE
- ORDER BY
- GROUP BY
- Aggregate Function
Identify the OLAP function from the given options
- MSUM
- SUM
- AVG
- All of the above
Statistics cannot be collected on this table
- Permanent Table
- Set Table
- Multiset Table
- Volatile Table
What best describes the relationship between indexes and SQL performance?
- Indexes are only used in special cases
- Indexes are used to make table storage more efficient
- Indexes rarely make a difference in SQL performance
- Indexes exist solely to improve query speed
Which of the following is an important consideration when tuning an SQL statement?
- The number of CPUs on the server
- The degree of parallelism on the tables
- The quality of the SQL optimization
- The use of bitmap indexes
We refer to a join as a self-join when…
- We are joining two tables only
- we are using left and right join together
- we are joining table to itself
- we are joining more than 2 tables
Which SQL statement selects all rows from table called Contest, with column ContestDate having values greater or equal to May 25, 2006?
- SELECT * FROM Contest WHERE ContestDate >= '05/25/2006'
- SELECT * FROM Contest GROUPBY ContestDate >= '05/25/2006'
- SELECT * FROM Contest WHERE ContestDate < '05/25/2006'
- SELECT * FROM Contest HAVING ContestDate >= '05/25/2006'
The INNER JOIN clause…
- returns all the matching rows from 2 tables.
- 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.
- returns all rows from 2 tables.
- returns all rows that have matching value in the field on which the 2 tables are joined.
What is an index?
- An index is the same as alias.
- An index is a special way to join 2 or more tables.
- An index is a database table attribute, which speeds-up data search within a table.
- An index is a database row attribute, which speeds-up data search within a table.
If you don't specify ASC or DESC after a SQL ORDER BY clause, the following is used by default:
- There is no default value.
- DESC
- Random
- ASC
Which of the following SQL statements is correct?
- TRUNCATE Sales TABLE
- TRUNCATE * FROM TABLE Sales
- TRUNCATE TABLE Sales
- TRUNCATE * FROM COLUMN Sales
Which of the following database design features is most important to SQL performance?
- Removal of data redundancy
- The introduction of data redundancy
- The introduction of non-first normal form relations
- The introduction of SQL*Plus
What does ACID stand for?
- Access. Constant. Information. Data.
- Atomicity. Consistency. Isolation. Durability.
- Access. Constraint. Index. Data.
- Access. Consistency. Isolation. Data.
Sub-queries can be nested in…
- UPDATE, DELETE, INSERT and SELECT statements.
- UPDATE statements only.
- DELETE statements only.
- INSERT statements only.
What output will the follwing statement produce? Select NVL2(NULL,'NOT NULL', NULL) from dual;
- NOT NULL
- NULL
- Function NVL2 is not defined
- None of the above
What is the result if two NULL values are compared to each other?
- TRUE
- FALSE
- UNDEFINED
- NULL
Which three definitions are associated with implicit cursors?
- %rowtype, %toomanyrows, %found
- %found, %notfound, %rowcount
- %rowtype, %rowcount, %notfound
- None of the above
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?
- 0
- NULL
- Results in a compilation error
- An exception will be raised
Functions for error trapping are contained in which section of a PL/SQL block?
- Header
- Declarative
- Exception
- Executable