0% found this document useful (0 votes)
18 views3 pages

Essential SQL Interview Questions

This document provides a comprehensive overview of essential SQL interview questions, covering topics such as the definition of SQL, command types (DDL, DML, DCL, TCL), and comparisons between SQL and NoSQL. It also explains key concepts like Primary Keys, Foreign Keys, Unique Keys, Composite Keys, and Candidate Keys. The content is aimed at preparing candidates for SQL-related job interviews.

Uploaded by

engineermind07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Essential SQL Interview Questions

This document provides a comprehensive overview of essential SQL interview questions, covering topics such as the definition of SQL, command types (DDL, DML, DCL, TCL), and comparisons between SQL and NoSQL. It also explains key concepts like Primary Keys, Foreign Keys, Unique Keys, Composite Keys, and Candidate Keys. The content is aimed at preparing candidates for SQL-related job interviews.

Uploaded by

engineermind07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SQL Interview Questions

Top SQL Interview Questions


You Must Know

Jayasurya SM
Data Analyst

Swipe right
Basics (1)
Q1: What is SQL
SQL (Structured Query Language) is a standard language for storing,
managing, and retrieving data in relational databases.

Advanced Tip: SQL is declarative → you specify what you want, not
how. Query optimizers handle execution.

Q2: What are SQL command types (DDL, DML, DCL,


TCL)?
DDL (Data Definition Language): CREATE, ALTER, DROP – defines
structure.
DML (Data Manipulation Language): SELECT, INSERT, UPDATE,
DELETE – works with data.
DCL (Data Control Language): GRANT, REVOKE – controls
permissions.
TCL (Transaction Control Language): COMMIT, ROLLBACK,
SAVEPOINT – manages transactions.

Q3: SQL vs NoSQL?


SQL: Relational, structured, uses tables. Great for ACID
transactions.
NoSQL: Non-relational, schema-less, good for unstructured/large-
scale data (e.g., MongoDB).
Swipe right
Basics (2)
Q1: What is a Primary Key?
A column (or set of columns) that uniquely identifies each row.
Cannot be NULL.

Q2: What is a Foreign Key?


A column that references a primary key in another table to
maintain relationships.

Q3: Primary Key vs Unique Key?


Primary Key: Only one per table, auto-indexed, no NULL allowed.
Unique Key: Multiple allowed, ensures unique values but NULLs
are allowed.

Q4: What is a Composite Key?


A key made up of two or more columns that together uniquely
identify a row. Useful when no single column is unique by itself.

Q5: What is a Candidate Key?


A column (or set of columns) that can qualify as a Primary Key. A
table may have multiple candidate keys, but only one is chosen as
the Primary Key.

Swipe right

You might also like