SQL Query Fundamentals and Database Performance

Covers SQL datatypes, operators, functions, joins, aggregate functions, query performance optimization, and database design concepts.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

You are defining the operational process of your RDBMS. Referring to the scenario above, which one of the following is a valid ongoing "operational process?"

  1. OS requirement
  2. User analysis
  3. Performance monitoring
  4. Data dictionary specification
  5. System requirement
Question 2 Multiple Choice (Single Answer)

You have been asked to construct a query in the company's RDBMS. You have deployed a Right Outer Join operation. Referring to the scenario above, what will happen to the final results when there is NO match between the tables?

  1. The right table will return ALL rows.
  2. The right table will return NULL.
  3. Both tables will return NULL.
  4. The left table will return ALL rows.
  5. The left table will return NULL.
Question 3 Multiple Choice (Single Answer)

Which phase of the data modeling process contains security review?

  1. Structure
  2. Design issue
  3. Data source
  4. Storage issue
  5. Operational process
Question 4 Multiple Choice (Single Answer)

Which one of the following is NOT a characteristic of metadata?

  1. Data about data
  2. Describes a data dictionary
  3. Self-describing
  4. Includes user data
  5. Supports its own structure
Question 5 Multiple Choice (Single Answer)

Which one of the following capabilities do you expect to see in a majority of RDBMS extensions to ANSI SQL-92?

  1. Encryption key management
  2. Graphical User Interface Widgets
  3. Thread creation, execution, & coordination
  4. Network socket creation/operation
  5. If/Then, for, do/while statements
Question 6 Multiple Choice (Single Answer)

What can a mandatory one to one relationship indicate?

  1. More entities are needed.
  2. The model should be denormalized.
  3. The tables are not properly indexed.
  4. The model cannot be implemented physically.
  5. More attributes are needed.
Question 7 Multiple Choice (Single Answer)

For performance, you denormalize your database design and create some redundant columns. Referring to the scenario above, what RDBMS construct can you use to automatically prevent the repeated columns from getting out of sync?

  1. Cursors
  2. Constraints
  3. Views
  4. Stored procedures
  5. Trigger
Question 8 Multiple Choice (Single Answer)

You are running a query against a relational database. Referring to the scenario above, what clause or command do you use in the query to help avoid a costly tablescan?

  1. GROUP BY clause
  2. INDEX command
  3. HAVING clause
  4. FROM clause
  5. WHERE clause [/quote]
Question 9 True/False

The query performance increases by using NOT operator.

  1. True
  2. False
Question 10 Multiple Choice (Single Answer)

If there are 3 persons with last names JOHN, J and JAMES how many of them are included in the result set of the query "SELECT LAST_NAME FROM STAFF WHERE LAST_NAME BETWEEN 'A' AND 'J'"

  1. 3
  2. 2
  3. 1
  4. 0
Question 11 True/False

NULL values are ingnored for all SQ: 2008 aggregate functions.

  1. True
  2. False
Question 12 Multiple Choice (Multiple Answers)

Which operators can be used to produce summary totals in the result sets of SQL 2008.

  1. GROUPING
  2. WITH ROLL UP
  3. WITH CUBE
  4. WITH SUMMARY
Question 13 True/False

UNION ALL is faster than a UNION

  1. True
  2. False
Question 14 True/False

The query performance increases by using NOT operator.

  1. True
  2. False
Question 15 True/False

NULL values are ingnored for all SQL: 2008 aggregate functions.

  1. True
  2. False
Question 16 Multiple Choice (Single Answer)

Which one is single-row function

  1. STDDEV
  2. VARIANCE
  3. ROUND
  4. COUNT
Question 17 Multiple Choice (Multiple Answers)

which of this Operator Precedence is correct??

  1. - , + (Unary operators, negation)
  2. * , / (Multiplication, division)
  3. +, - , || (Addition, subtraction, concatenation)
  4. NONE of these
Question 18 Multiple Choice (Single Answer)

Which of these is NOT a inequality symbol ??

  1. !=
  2. <>
  3. =^
  4. ^=
Question 19 Multiple Choice (Single Answer)

When you try to save 34567.2255 into a column defined as NUMBER(7,2) what value is actually saved?

  1. 34567.00
  2. 34567.22
  3. 34567.23
  4. 3456.22
Question 20 Multiple Choice (Single Answer)

What is the default display length of the DATE datatype column?

  1. 8
  2. 9
  3. 6
  4. 16