
AARelational databases are the foundation of many analytics, application, and transaction systems. Interviewers ask this question to confirm that you understand how structured data is organized and queried before moving into SQL problem-solving.
Explain your basic understanding of relational databases. In your answer, cover:
Keep your answer at an introductory-to-practical level. The interviewer is not looking for deep internals, but they do expect clear definitions, correct terminology, and a simple example showing how related tables work together.
A relational database stores data in tables. Each table represents an entity, rows represent individual records, and columns define the attributes of those records.
SELECT customer_id, customer_name
FROM customers;
A primary key uniquely identifies each row in a table. It prevents duplicate records for the key column and provides a stable way to reference specific records.
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(100) NOT NULL
);
A foreign key links one table to another by referencing a primary key. This creates relationships between entities, such as orders belonging to customers.
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_id INT REFERENCES customers(customer_id),
order_total NUMERIC(10,2)
);
SQL is the standard language used to query, insert, update, and delete data in relational databases. It also supports filtering, aggregation, sorting, and joining related tables.
SELECT customer_id, COUNT(*) AS order_count
FROM orders
GROUP BY customer_id;
Normalization is the process of organizing data to reduce redundancy and improve consistency. Instead of storing repeated customer details in every order row, those details are kept in a separate customers table.