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

SQL Interview Questions Cheat Sheet

The document provides an overview of key concepts related to SQL and databases, including definitions of SQL, databases, primary keys, foreign keys, and normalization. It explains the differences between primary keys and unique keys, outlines the types of normalization, and describes the concept of joins in SQL. Overall, it serves as a foundational guide to understanding relational database management.

Uploaded by

Bharath Karapuri
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)
84 views3 pages

SQL Interview Questions Cheat Sheet

The document provides an overview of key concepts related to SQL and databases, including definitions of SQL, databases, primary keys, foreign keys, and normalization. It explains the differences between primary keys and unique keys, outlines the types of normalization, and describes the concept of joins in SQL. Overall, it serves as a foundational guide to understanding relational database management.

Uploaded by

Bharath Karapuri
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

Q 1. What is SQL?

Ans: SQL stands for Structured Query Language. It is a


programming language used for managing and
manipulating relational databases.

Q 2. What is a database?
Ans: A database is an organized collection of data stored
and accessed electronically. It provides a way to
store, organize, and retrieve large amounts of data
efficiently.

Q 3. What is a primary key?


Ans: A primary key is a column or combination of columns
that uniquely identifies each row in a table. It
enforces the entity integrity rule in a relational
database.

01
Q 4. What is a foreign key?
Ans: A foreign key is a column or combination of columns
that establishes a link between data in two tables. It
ensures referential integrity by enforcing
relationships between tables.

Q 5. What is the difference between a primary key


and a unique key?
Ans: A primary key is used to uniquely identify a row in a
table and must have a unique value. On the other
hand, a unique key ensures that a column or
combination of columns has a unique value but does
not necessarily identify the row.

02
Q 6. What is normalization?
Ans: Normalization is the process of organizing data in a
database to minimize redundancy and dependency.
It involves breaking down a table into smaller tables
and establishing relationships between them.

Q 7. What are the different types of


normalization?
Ans: The different types of normalization are:
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce-Codd Normal Form (BCNF)
Fourth Normal Form (4NF)
Fifth Normal Form (5NF) or Project-Join Normal
Form (PJNF)
Q 8. What is a join in SQL?
Ans: A join is an operation used to combine rows from two
or more tables based on related columns. It allows
you to retrieve data from multiple tables
simultaneously.

03

You might also like