SQL Functions and Joins
Test your knowledge of SQL functions (ROUND, TRUNC, MOD, SYSDATE, LAST_DAY), join types (self join, outer join, equi-join), and other essential SQL concepts.
Questions
We can nest Group Functions
- True
- False
SYSDATE is a date function that returns the current database server date and time.
- True
- False
The value returned by the subquery is used by the main query.
- True
- False
To perform wild card search “Like” is used .
- True
- False
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
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
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
- Outerjoin
- innerjoin
- equijoin
A null is the same as zero or a blank space.
- True
- False
What is the output of the following? SELECT ROUND(1111.93412,3) FROM DUAL;
- 1112
- 1111.93
- 1111.93412
- 1111.934
What does the MOD Function do?
- It divides both the values and gives the quotient.
- It multiplies both the values and gives the product.
- It divides both the values and gives the remainder.
- There is no such function.