SQL Joins and Functions

Covers SQL join types (self-join, outer join, equi-join), SQL functions (single-row, date, numeric), and SELECT statement basics including literals, operators, and query capabilities.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

When is a Cartesian product formed?

  1. When a join condition is omitted.
  2. When a join condition is invalid.
  3. All rows in the first table are joined to all rows in the second table.
  4. All of the above.
Question 2 True/False

In a join condition it is mandatory to specify the table name along with the Column name.

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

The minimum number of join statements required to join 10 tables together are:

  1. 9
  2. 11
  3. 5
  4. 12
  5. None of the above
Question 4 True/False

A Non equi-join is a join condition that does not contain an equality operator.

  1. True
  2. False
Question 5 True/False

Arithmetic expressions containing a null value evaluate to null.

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

Concatenation operator is

  1. +
  2. -
  3. ||
  4. *
Question 7 Multiple Choice (Single Answer)

What are SQL “SELECT” statement capabilities.

  1. Projection
  2. Selection
  3. Join
  4. All of the above
Question 8 Multiple Choice (Single Answer)

To select all the columns from a table EMP, which one of the following is TRUE?

  1. Select all columns from EMP;
  2. Select distinct columns from EMP;
  3. Select * from EMP;
  4. All of the above
Question 9 True/False

Select ename from emp where ename =”Scott”; This select statement executes successfully.

  1. True
  2. False
Question 10 True/False

Sorting SQL statement result data by column alias is not possible.

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

What are the two types of SQL Functions?

  1. Single-row Functions and Double-row Functions
  2. One-row Functions and Two-row Functions
  3. Single-row Functions and Multiple-row Functions
  4. None of the above
Question 12 True/False

Single-Row Functions can return multiple results per row.

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

Which of these is not a Single-Row Function?

  1. Character Function
  2. Number Function
  3. String Function
  4. Date Function
Question 14 Multiple Choice (Single Answer)

Compare the output of the following: SELECT TRUNC(99.57,1) FROM DUAL; and SELECT ROUND(99.57,1) FROM DUAL;

  1. 99.57,99,6
  2. 99.5,99.6
  3. 99.6,99.6
  4. 99.57,99.57
Question 15 True/False

LAST_DAY(date) finds the date of the last day of the month that contains date.

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

Which of the following WHERE clauses represent equi-join?

  1. Table1.column1=Table2.column2
  2. Table1.column1=Table2.column1
  3. Table1.column2=Table2.column1
  4. None of the above
Question 17 Multiple Choice (Single Answer)

An outer join is used to:

  1. Return records which have no direct match
  2. Return records which have direct match
  3. Return all the records
  4. None of the above
Question 18 Multiple Choice (Single Answer)

____________ is the outer join operator.

  1. (+)
  2. (-)
  3. (*)
  4. +
Question 19 Multiple Choice (Single Answer)

____________ is used to join a table to itself.

  1. SelfJoin
  2. EquiJoin
  3. OuterJoin
  4. InnerJoin
Question 20 True/False

A Literal is enclosed in double quotes.

  1. True
  2. False