Backend Developer SQL and Database Assessment

30 SQL, RDBMS and Database Questions from Beginner to Advanced Level

Database knowledge is one of the most important skills for backend developers. Whether you work with Oracle, MySQL, PostgreSQL, SQL Server, or cloud databases, understanding SQL and database concepts is critical.

This assessment evaluates:

✅ SQL Fundamentals
✅ Joins
✅ Group By and Having
✅ Primary and Foreign Keys
✅ Indexes
✅ Normalization
✅ Transactions
✅ ACID Properties
✅ Oracle and MySQL Concepts
✅ Query Output Prediction


Sample Tables

EMPLOYEE

EMP_IDNAMEDEPT_IDSALARY
1John105000
2Mary206000
3Steve107000
4David304000

DEPARTMENT

DEPT_IDDEPT_NAME
10IT
20HR
30Finance

SET 1 – SQL Fundamentals


Q1. Which SQL statement retrieves data?

A. INSERT
B. UPDATE
C. SELECT
D. DELETE


Q2. What is the output?

SELECT COUNT(*)
FROM EMPLOYEE;

A. 3
B. 4
C. 5
D. NULL


Q3.

SELECT MAX(SALARY)
FROM EMPLOYEE;

A. 4000
B. 5000
C. 6000
D. 7000


Q4.

SELECT NAME
FROM EMPLOYEE
WHERE SALARY > 5000;

How many rows are returned?

A. 1
B. 2
C. 3
D. 4


Q5.

SELECT DISTINCT DEPT_ID
FROM EMPLOYEE;

A. 2 rows
B. 3 rows
C. 4 rows
D. 1 row


Q6. Which constraint uniquely identifies a row?

A. Foreign Key
B. Unique Key
C. Primary Key
D. Check


Q7. Which keyword sorts data?

A. GROUP BY
B. ORDER BY
C. SORT
D. ARRANGE


Q8. What does NULL represent?

A. Zero
B. Empty String
C. Unknown value
D. Space


Q9. Which SQL clause filters grouped data?

A. WHERE
B. HAVING
C. GROUP BY
D. ORDER BY


Q10. Which database is open source?

A. Oracle
B. DB2
C. MySQL
D. SQL Server


Answers – SET 1

QAnswerExplanation
1CSELECT retrieves data from tables.
2BEMPLOYEE contains 4 rows.
3DMaximum salary is 7000.
4BMary and Steve have salaries above 5000.
5BDepartments 10, 20, and 30.
6CPrimary key uniquely identifies rows.
7BORDER BY sorts results.
8CNULL means unknown or unavailable value.
9BHAVING filters groups after aggregation.
10CMySQL is open source.

SET 2 – Joins and Group By


Q1.

SELECT E.NAME,
       D.DEPT_NAME
FROM EMPLOYEE E
INNER JOIN DEPARTMENT D
ON E.DEPT_ID=D.DEPT_ID;

A. 3 rows
B. 4 rows
C. 2 rows
D. 1 row


Q2. Which join returns all rows from both tables?

A. INNER JOIN
B. LEFT JOIN
C. RIGHT JOIN
D. FULL OUTER JOIN


Q3.

SELECT DEPT_ID,
       COUNT(*)
FROM EMPLOYEE
GROUP BY DEPT_ID;

How many rows?

A. 2
B. 3
C. 4
D. 1


Q4.

SELECT DEPT_ID,
       AVG(SALARY)
FROM EMPLOYEE
GROUP BY DEPT_ID;

Which clause is mandatory?

A. ORDER BY
B. GROUP BY
C. HAVING
D. DISTINCT


Q5.

SELECT *
FROM EMPLOYEE
WHERE DEPT_ID IN (10,20);

Rows returned?

A. 2
B. 3
C. 4
D. 1


Q6. Which join returns unmatched rows from the left table?

A. INNER JOIN
B. LEFT JOIN
C. CROSS JOIN
D. SELF JOIN


Q7.

SELECT DEPT_ID,
       COUNT(*)
FROM EMPLOYEE
GROUP BY DEPT_ID
HAVING COUNT(*) > 1;

Result?

A. Department 10
B. Department 20
C. Department 30
D. All departments


Q8. Which operator checks for NULL?

A. = NULL
B. == NULL
C. IS NULL
D. NULL()


Q9. What does a Foreign Key do?

A. Sorts rows
B. Creates index
C. Maintains relationship between tables
D. Removes duplicates


Q10. Which clause executes first?

A. SELECT
B. GROUP BY
C. FROM
D. ORDER BY


Answers – SET 2

QAnswerExplanation
1BAll employees have matching departments.
2DFULL OUTER JOIN returns all rows.
3BThree departments exist.
4BAggregation requires GROUP BY.
5BEmployees in departments 10 and 20.
6BLEFT JOIN preserves left table rows.
7ADepartment 10 has two employees.
8CNULL comparison requires IS NULL.
9CForeign key enforces referential integrity.
10CFROM executes before SELECT.

SET 3 – Advanced Database Concepts


Q1. Which ACID property guarantees completed transactions?

A. Consistency
B. Atomicity
C. Isolation
D. Durability


Q2. What is normalization?

A. Data duplication
B. Organizing data to reduce redundancy
C. Indexing tables
D. Creating views


Q3. Which normal form removes repeating groups?

A. 1NF
B. 2NF
C. 3NF
D. BCNF


Q4. Which normal form removes transitive dependency?

A. 1NF
B. 2NF
C. 3NF
D. 4NF


Q5. What does an index improve?

A. INSERT speed only
B. UPDATE speed only
C. Query performance
D. Storage size


Q6.

CREATE INDEX IDX_EMP
ON EMPLOYEE(NAME);

Purpose?

A. Enforce uniqueness
B. Improve search performance
C. Create table
D. Create constraint


Q7. Which statement starts a transaction?

A. START TRANSACTION
B. BEGIN
C. COMMIT
D. Both A and B


Q8. What does COMMIT do?

A. Undo changes
B. Save changes permanently
C. Lock table
D. Create backup


Q9. What does ROLLBACK do?

A. Saves changes
B. Removes table
C. Undoes uncommitted changes
D. Creates index


Q10. Which Oracle feature automatically generates values?

A. Trigger
B. Sequence
C. Cursor
D. Synonym


Answers – SET 3

QAnswerExplanation
1BAtomicity ensures complete success or failure of transactions.
2BNormalization reduces redundancy and anomalies.
3A1NF removes repeating groups and ensures atomic values.
4C3NF removes transitive dependencies.
5CIndexes speed up data retrieval operations.
6BIndexes improve lookup performance.
7DBoth BEGIN and START TRANSACTION are supported.
8BCOMMIT permanently saves transaction changes.
9CROLLBACK restores previous state.
10BOracle sequences generate unique values.

Backend Developer Interview Evaluation

ScoreRating
27–30Excellent Database Knowledge
24–26Strong SQL Skills
20–23Good Fundamentals
15–19Average
Below 15Needs Improvement

Topics Covered

✅ SQL Queries
✅ SELECT Statements
✅ Aggregate Functions
✅ Joins
✅ Group By
✅ Having
✅ Primary Keys
✅ Foreign Keys
✅ Constraints
✅ ACID Properties
✅ Transactions
✅ Normalization
✅ Indexes
✅ Oracle Sequences
✅ MySQL Concepts

These assessments are ideal for:

  • Java Backend Developers
  • Spring Boot Developers
  • Full Stack Developers
  • Database Developers
  • Oracle Developers
  • MySQL Developers
  • Technical Interview Preparation
  • Campus Hiring Assessments

A backend developer who scores above 80% generally demonstrates strong SQL and database fundamentals expected in enterprise applications.

Leave a Reply

Your email address will not be published. Required fields are marked *