3| SQL OPERATIONS AND FUNCTIONS |EXAM 2025 WITH 150
ACCURATE SOLUTIONS
1. Given two tables, Employees and Departments, how would you write a
query to retrieve all employees and their corresponding department
names, even if some employees do not belong to a department?
Use a LEFT OUTER JOIN between Employees and Departments.
Use an INNER JOIN between Employees and Departments.
Use a RIGHT JOIN between Employees and Departments.
Use a CROSS JOIN between Employees and Departments.
2. If a user attempts to insert a row into a view that has a WHERE clause
restricting certain values, and the WITH CHECK OPTION is applied, what
will happen if the inserted row does not meet the WHERE clause criteria?
The database will generate an error message explaining the
violation.
The operation will succeed without any warnings.
The row will be inserted but will not appear in the view.
The database will automatically adjust the row to meet the criteria.
3. If you need to retrieve data from two tables where some records may not
have matching entries in both tables, which JOIN type would you use in
MySQL?
FULL JOIN
INNER JOIN
RIGHT JOIN
LEFT JOIN
,4. _______________ is when a subquery's WHERE clause references a column from
the outer query.
Correlated
Exists
Regressed
Dependent
5. Describe the purpose of aggregate functions in SQL and how they are
typically used in queries.
Aggregate functions in SQL are used to perform calculations on
a set of values and return a single value, often used in
conjunction with the GROUP BY clause.
Aggregate functions are used to join multiple tables together.
Aggregate functions are used to filter rows based on specific
conditions.
Aggregate functions are used to create new tables from existing
data.
6. What is a requirement for tables to be considered compatible in SQL?
The same number of columns with the same data types
At least one common column
Different data types in each column
Identical column names
7. Describe the difference between the MIN() and MAX() functions in SQL.
MIN() returns the smallest value, while MAX() returns the largest
value in a set.
MIN() counts the entries, while MAX() calculates the average.
, Both functions return the same value from the set.
MIN() and MAX() are used for string concatenation.
8. What is the term used to describe a numeric estimate of processing time
for an SQL operation?
resource allocation
time complexity
execution time
cost
9. Describe the outcome of performing a cross-join between two tables in
SQL.
A cross-join creates a new table with only unique rows from both
tables.
A cross-join merges two tables based on a specified condition.
A cross-join filters rows based on matching column values.
A cross-join produces a result set that includes all possible
combinations of rows from both tables.
10. Functions that are useful for string manipulation, such as getting a
substring, finding a match within a string, replacing parts of a string, and
converting a string value into uppercase or lowercase.
Date
String
Logical
Type Conversion
11. What SQL operation is used to retrieve specific rows from a table based
on a condition?
, select operation
update operation
delete operation
insert operation
12. If you have a table of employee records and you want to retrieve the list
of employees sorted by their hire date from the most recent to the
oldest, which SQL clause would you use?
SORT BY hire_date DESC
ORDER BY hire_date ASC
FILTER BY hire_date DESC
ORDER BY hire_date DESC
13. Describe what is meant by 'set operations' in SQL and give an example.
Set operations are limited to numerical data types only.
Set operations only apply to tables with identical column names.
Set operations are used to create new tables from existing ones
without any conditions.
Set operations in SQL refer to operations like union, intersect,
and difference that work on compatible tables.
14. What is the SQL operator used to check if a value lies within a specified
range?
LIKE
EXISTS
IN
BETWEEN