SQL Fundamentals
Test your knowledge of SQL query syntax, operators, functions, subqueries, joins, and DML operations.
Questions
____________ 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.
Duplicate values are eliminated by which keyword
- Duplicate
- Distinct
- Remove
- Delete
The two types of subqueries are:
- Single-row subquery, Double-row subquery
- Double-row subquery, Multiple-row subquery
- Multiple-row subquery
- Single-row subquery and Multiple subquery
Single-row subquery returns:
- Only one row
- Two rows
- Zero rows
- There is no such subquery
What is the result of the query below? SELECT Stud_name, Rollnum FROM STUDENT WHERE stud_marks=(SELECT MIN (stud_marks) FROM STUDENT GROUPBY Rollnum);
- It gives the name and marks of all the students.
- It does not return anything.
- It shows an error saying” INVALID SYNTAX ERROR”
- It shows an error saying” Single-row subquery returns more than one row
Which of the following is not a multiple-row operator?
- IN
- OF
- ALL
- ANY
Which operator compares a value to every value returned by a subquery?
- IN
- OF
- ALL
- ANY
A DML statement is executed when you
- Add new rows to a table
- Modify existing rows of a table
- Remove existing rows from a table
- All of the above
The right syntax insert a row into a table is
- Insert to table tablename (….);
- Insert into table tablename (….);
- Insert into table tablename values (…..);
- Any one of the above
Which is the function that records the current date?
- Date
- Sysdate
- Current Date
- System Date
Limiting the rows in a select statement for a specific condition is done by the clause
- Distinct
- Projection
- Where
- All of the above
Character values are case insensitive
- 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