75+ SQL Interview Questions - swapnakpanda
Tags: job, interview, sql, programming
Published: 2022-10-05 13:38:57

####   Original Tweet  [@swapnakpanda](https://twitter.com/swapnakpanda)
{% embed https://twitter.com/swapnakpanda/status/1576775410867527681 %}

     ➤ Oracle
     ➤ MySQL
     ➤ MariaDB
     ➤ PostgreSQL
     ➤ SQL Server
     ➤ SQLite

⇩ 

#### Level: Beginner to Medium
Topics:

➊ Introduction to RDBMS
➋ Normalisation
➌ Introduction to SQL
➍ Tables and Fields
➎ Constraints
➏ DDL
➐ DML &amp; DQL
➑ Joins 

### ➊ Introduction to RDBMS

➀ What is a Database?
➁ What are the different types of databases?
➂ What is a DBMS?
➃ What is the difference between a database and a DBMS?
➄ What is RDBMS?
➅ Name a few popular RDBMS vendors.
➆ What is the ACID property in a database? 

### ➋ Normalisation

➀ What is normalisation?
➁ Why is normalisation necessary?
➂ What are the disadvantages of not performing normalisation?
➃ What are the different normal forms (NF)?
➄ What is denormalisation? 

### ➌ Introduction to SQL

➀ What is SQL?
➁ What is the use of SQL?
➂ Is SQL a programming language?
➃ What are the different parts of SQL?
     Or,
➄ Group SQL commands into different parts.
➅ What is DDL?
➆ What is DML?
➇ What is DQL?
➈ What is DCL?
➉ What is TCL? 

### ➍ Tables and Fields

➀ What is a Table?
➁ What is a field in a Table?
➂ Write a SQL command to create a Table.
➃ How do you change the name of a Table?
➄ How to truncate a table?
➅ How to drop a table? 

### ➎ Constraints

➀ What is a constraint?
➁ What are the different levels of constraints?
➂ Give examples of various constraints.
➃ What is a primary key?
➄ What is a unique key? 

➅ Difference between a primary key and a unique key.
➆ What is a foreign key?
➇ What is NULL value?
➈ What is NOT NULL constraint?
➉ Is blank space or Zero (0) same as NULL? 

### ➏ DDL

➀ Give some examples of DDL commands.
➁ Write the syntax for creating a table
➂ How to specify the default value for a column?
➃ How to specify a foreign key?
➄ How to specify a unique key?
➅ How to specify multiple columns as the primary key? 

➆ What different constraints can you add to a column while creating a table?
➇ How to create a copy of a table? (both structure and data).

➈ You have 'n' tables and asked to create a separate table that will contain a few columns from these tables with data being copied. 

➉ What is SELECT INTO used for? (In SQL Server)
➀➀ Difference between ALTER and RENAME.

➀➁ Can a previously nullable column be altered to a NOT NULL column? If so, explain the steps. 

### ➐ DML &amp; DQL

➀ How do you insert rows into a table?
➁ What are the different syntaxes for inserting records into a table?
➂ What is the syntax to insert multiple records at a time?
➃ How to update data in a table?
➄ How to delete a row in a table? 

➅ Difference between DELETE and TRUNCATE?
➆ Explain how DML operations are performed on a View.
     Or,
➇ Are Views used only for SELECT queries?
➈ How to fetch rows from a table?
➉ What is a query condition? How to write it in SQL?
➀➀ How to sort the fetched records? 

➀➁ What is grouping? How to write in SQL?
➀➂ How to find how many records are being fetched?
➀➃ How to find the maximum and minimum value for a field in fetched records?
➀➄ How to sum values in a field for all records? 

### ➑ Joins

➀ What is a join in SQL?
➁ What are the different types of joins?
➂ What is Inner Join?
➃ What is Left Outer Join?
➄ What is Right Outer Join?
➅ What is Full Outer Join?
➆ What is Cross Join? 

➇ What is a Self Join?
➈ What is Equi Join?
➉ What is Natural Join?

➀➀ Given a query in Cross Join, convert it into an Inner Join.

➀➁ Given a query in Right Outer Join, convert it into a Left Outer Join. 

➀➂ Convert an Inner Join into an Equi Join.
        Or,
➀➃ What is required to convert an Inner Join into an Equi Join?

➀➄ What should be taken care of to improve the performance of queries containing Joins. 

#### 🚥 Disclaimer

⬘ The questions covered here are mostly conceptual.

⬗ I never claim only these types of questions are/should be asked during interviews.

⬙ For interviews, you should have fundamentals strong. And you should be able to provide solutions to practical problems. 

Hey 👋

I am a Tech Writer, Educator, and Mentor from India 🇮🇳, here sharing

✰ Tutorials
✰ Tricks
✰ Career Tips
✰ Cheat Sheets
✰ Interview Questions
✰ Roadmaps
             on
➠ Web Development
➠ Data Structures and Algorithms
➠ Databases

Thanks for reading. 🙏 

#### Click [Here](https://www.knowledge-twitter.com/)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/)