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.
Questions
When is a Cartesian product formed?
- When a join condition is omitted.
- When a join condition is invalid.
- All rows in the first table are joined to all rows in the second table.
- All of the above.
In a join condition it is mandatory to specify the table name along with the Column name.
- True
- False
The minimum number of join statements required to join 10 tables together are:
- 9
- 11
- 5
- 12
- None of the above
A Non equi-join is a join condition that does not contain an equality operator.
- True
- False
Arithmetic expressions containing a null value evaluate to null.
- True
- False
Concatenation operator is
- +
- -
- ||
- *
What are SQL “SELECT” statement capabilities.
- Projection
- Selection
- Join
- All of the above
To select all the columns from a table EMP, which one of the following is TRUE?
- Select all columns from EMP;
- Select distinct columns from EMP;
- Select * from EMP;
- All of the above
Select ename from emp where ename =”Scott”; This select statement executes successfully.
- True
- False
Sorting SQL statement result data by column alias is not possible.
- True
- False
What are the two types of SQL Functions?
- Single-row Functions and Double-row Functions
- One-row Functions and Two-row Functions
- Single-row Functions and Multiple-row Functions
- None of the above
Single-Row Functions can return multiple results per row.
- True
- False
Which of these is not a Single-Row Function?
- Character Function
- Number Function
- String Function
- Date Function
Compare the output of the following: SELECT TRUNC(99.57,1) FROM DUAL; and SELECT ROUND(99.57,1) FROM DUAL;
- 99.57,99,6
- 99.5,99.6
- 99.6,99.6
- 99.57,99.57
LAST_DAY(date) finds the date of the last day of the month that contains date.
- True
- False
Which of the following WHERE clauses represent equi-join?
- Table1.column1=Table2.column2
- Table1.column1=Table2.column1
- Table1.column2=Table2.column1
- None of the above
An outer join is used to:
- Return records which have no direct match
- Return records which have direct match
- Return all the records
- None of the above
____________ is the outer join operator.
- (+)
- (-)
- (*)
- +
____________ is used to join a table to itself.
- SelfJoin
- EquiJoin
- OuterJoin
- InnerJoin
A Literal is enclosed in double quotes.
- True
- False