SlideShare a Scribd company logo
SQL interview questions by Jeetendra Mandal - part 2
1. What is Database?
A database is an organized collection of data, stored and retrieved digitally from a remote or local
computer system. Databases can be vast and complex, and such databases are developed using fixed
design and modeling approaches.
2. What is DBMS?
DBMS stands for Database Management System. DBMS is a system software responsible for the
creation, retrieval, updation, and management of the database. It ensures that our data is consistent,
organized, and is easily accessible by serving as an interface between the database and its end-users
or application software.
3. What is RDBMS? How is it different from DBMS?
RDBMS stands for Relational Database Management System. The key difference here, compared to
DBMS, is that RDBMS stores data in the form of a collection of tables, and relations can be defined
between the common fields of these tables. Most modern database management systems like MySQL,
Microsoft SQL Server, Oracle, IBM DB2, and Amazon Redshift are based on RDBMS.
4. What is SQL?
SQL stands for Structured Query Language. It is the standard language for relational database management
systems. It is especially useful in handling organized data comprised of entities (variables) and relations between
different entities of the data.
5. What is the difference between SQL and MySQL?
SQL is a standard language for retrieving and manipulating structured databases. On the contrary, MySQL is a
relational database management system, like SQL Server, Oracle or IBM DB2, that is used to manage SQL
databases.
6. What are Tables and Fields?
A table is an organized collection of data stored in the form of rows and columns. Columns can be categorized as
vertical and rows as horizontal. The columns in a table are called fields while the rows can be referred to as records.
7. What are Constraints in SQL?
Constraints are used to specify the rules concerning data in the table. It can be applied for single or multiple fields in
an SQL table during the creation of the table or after creating using the ALTER TABLE command. The constraints
are:
NOT NULL - Restricts NULL value from being inserted into a column.
CHECK - Verifies that all values in a field satisfy a condition.
DEFAULT - Automatically assigns a default value if no value has been specified for the field.
UNIQUE - Ensures unique values to be inserted into the field.
INDEX - Indexes a field providing faster retrieval of records.
PRIMARY KEY - Uniquely identifies each record in a table.
FOREIGN KEY - Ensures referential integrity for a record in another table.
8. What is a Primary Key?
The PRIMARY KEY constraint uniquely identifies each row in a table. It must contain UNIQUE values and has an
implicit NOT NULL constraint.
A table in SQL is strictly restricted to have one and only one primary key, which is comprised of single or multiple
fields (columns).
9. How to delete a table in SQL?
There are two ways to delete a table from sql: DROP and TRUNCATE. The DROP TABLE command is used to
completely delete the table from the database. This is the command:
DROP TABLE table_name;
The above command will completely delete all the data present in the table along with the table itself.
But if we want to delete only the data present in the table but not the table itself, then we will use the truncate
command:
DROP TABLE table_name ;
10. How to change a table name in SQL?
This is the command to change a table name in SQL:
ALTER TABLE table_name
RENAME TO new_table_name;
We will start off by giving the keywords ALTER TABLE, then we will follow it up by giving the original name of the
table, after that, we will give in the keywords RENAME TO and finally, we will give the new table name.
For example, if we want to change the “employee” table to “employee_information”, this will be the command:
ALTER TABLE employee
RENAME TO employee_information;

More Related Content

PPTX
SQL interview questions jeetendra mandal - part 5
PPTX
SQL interview questions by jeetendra mandal - part 4
PDF
Dbms Interview Question And Answer
PPTX
Database Basics and MySQL
PDF
PostgreSQL Tutorial For Beginners | Edureka
PPTX
Introduction to dbms
PPTX
Relational Database Management System part II
PPT
MySQL and its basic commands
SQL interview questions jeetendra mandal - part 5
SQL interview questions by jeetendra mandal - part 4
Dbms Interview Question And Answer
Database Basics and MySQL
PostgreSQL Tutorial For Beginners | Edureka
Introduction to dbms
Relational Database Management System part II
MySQL and its basic commands

What's hot (19)

PDF
Sql commands
PDF
Sql a practical introduction
PPTX
SQL for interview
PDF
PDF
Chapter8 my sql revision tour
PDF
Excel to SQL Server
PPTX
SQL: Structured Query Language
PDF
SQL Joins With Examples | Edureka
PPTX
Structured query language(sql)ppt
DOCX
SQL Differences SQL Interview Questions
PPTX
Structured query language
PPTX
SQL - Structured query language introduction
PPTX
Sql introduction
PPT
Rdbms
PDF
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
DOC
Database queries
PPTX
Introduction to database
PDF
Sql 2009
Sql commands
Sql a practical introduction
SQL for interview
Chapter8 my sql revision tour
Excel to SQL Server
SQL: Structured Query Language
SQL Joins With Examples | Edureka
Structured query language(sql)ppt
SQL Differences SQL Interview Questions
Structured query language
SQL - Structured query language introduction
Sql introduction
Rdbms
Oracle/SQL For Beginners - DDL | DML | DCL | TCL - Quick Learning
Database queries
Introduction to database
Sql 2009
Ad

Similar to SQL interview questions by Jeetendra Mandal - part 2 (20)

DOCX
What is Database.docx
PDF
DBMS and SQL Questions and Answers (1).pdf
PDF
SQL Complete Tutorial. All Topics Covered
PPTX
Codds rules & keys
PPTX
codd rules of dbms given by E F codd who is called father of dbms
PDF
MSSQL_Book.pdf
PPTX
SKILLWISE-DB2 DBA
PPTX
Database COMPLETE
PDF
Lecture on DBMS & MySQL.pdf v. C. .
PPTX
SQL.pptx for the begineers and good know
PPTX
SQL | DML
PPTX
Relational Database Language.pptx
PDF
Dbms interview questions
DOCX
PDF
Sql smart reference_by_prasad
PDF
Sql smart reference_by_prasad
PDF
Sql tutorial
PDF
SQL -Beginner To Intermediate Level.pdf
PDF
SQL Server Interview Questions PDF By ScholarHat
PPTX
lovely
What is Database.docx
DBMS and SQL Questions and Answers (1).pdf
SQL Complete Tutorial. All Topics Covered
Codds rules & keys
codd rules of dbms given by E F codd who is called father of dbms
MSSQL_Book.pdf
SKILLWISE-DB2 DBA
Database COMPLETE
Lecture on DBMS & MySQL.pdf v. C. .
SQL.pptx for the begineers and good know
SQL | DML
Relational Database Language.pptx
Dbms interview questions
Sql smart reference_by_prasad
Sql smart reference_by_prasad
Sql tutorial
SQL -Beginner To Intermediate Level.pdf
SQL Server Interview Questions PDF By ScholarHat
lovely
Ad

More from jeetendra mandal (20)

PPTX
what is OSI model
PPTX
What is AWS Cloud Watch
PPTX
What is AWS Fargate
PPTX
Eventual consistency vs Strong consistency what is the difference
PPTX
Batch Processing vs Stream Processing Difference
PPTX
Difference between Database vs Data Warehouse vs Data Lake
PPTX
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
PPTX
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
PPTX
Difference Program vs Process vs Thread
PPTX
Carrier Advice for a JAVA Developer How to Become a Java Programmer
PPTX
How to become a Software Tester Carrier Path for Software Quality Tester
PPTX
How to become a Software Engineer Carrier Path for Software Developer
PPTX
Events vs Notifications
PPTX
Microservice Architecture Software Architecture Microservice Design Pattern
PPTX
Event Driven Software Architecture Pattern
PPTX
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
PPTX
Observability vs APM vs Monitoring Comparison
PPTX
Disaster Recovery vs Data Backup what is the difference
PPTX
What is Spinnaker? Spinnaker tutorial
PPTX
Difference between Github vs Gitlab vs Bitbucket
what is OSI model
What is AWS Cloud Watch
What is AWS Fargate
Eventual consistency vs Strong consistency what is the difference
Batch Processing vs Stream Processing Difference
Difference between Database vs Data Warehouse vs Data Lake
Difference between Client Polling vs Server Push vs Websocket vs Long Polling
Difference between TLS 1.2 vs TLS 1.3 and tutorial of TLS2 and TLS2 version c...
Difference Program vs Process vs Thread
Carrier Advice for a JAVA Developer How to Become a Java Programmer
How to become a Software Tester Carrier Path for Software Quality Tester
How to become a Software Engineer Carrier Path for Software Developer
Events vs Notifications
Microservice Architecture Software Architecture Microservice Design Pattern
Event Driven Software Architecture Pattern
Top 5 Software Architecture Pattern Event Driven SOA Microservice Serverless ...
Observability vs APM vs Monitoring Comparison
Disaster Recovery vs Data Backup what is the difference
What is Spinnaker? Spinnaker tutorial
Difference between Github vs Gitlab vs Bitbucket

Recently uploaded (20)

PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
history of c programming in notes for students .pptx
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
assetexplorer- product-overview - presentation
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
System and Network Administration Chapter 2
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
medical staffing services at VALiNTRY
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
CHAPTER 2 - PM Management and IT Context
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
history of c programming in notes for students .pptx
Designing Intelligence for the Shop Floor.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Operating system designcfffgfgggggggvggggggggg
assetexplorer- product-overview - presentation
2025 Textile ERP Trends: SAP, Odoo & Oracle
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Understanding Forklifts - TECH EHS Solution
Internet Downloader Manager (IDM) Crack 6.42 Build 41
System and Network Administration Chapter 2
Wondershare Filmora 15 Crack With Activation Key [2025
medical staffing services at VALiNTRY
VVF-Customer-Presentation2025-Ver1.9.pptx

SQL interview questions by Jeetendra Mandal - part 2

  • 2. 1. What is Database? A database is an organized collection of data, stored and retrieved digitally from a remote or local computer system. Databases can be vast and complex, and such databases are developed using fixed design and modeling approaches. 2. What is DBMS? DBMS stands for Database Management System. DBMS is a system software responsible for the creation, retrieval, updation, and management of the database. It ensures that our data is consistent, organized, and is easily accessible by serving as an interface between the database and its end-users or application software. 3. What is RDBMS? How is it different from DBMS? RDBMS stands for Relational Database Management System. The key difference here, compared to DBMS, is that RDBMS stores data in the form of a collection of tables, and relations can be defined between the common fields of these tables. Most modern database management systems like MySQL, Microsoft SQL Server, Oracle, IBM DB2, and Amazon Redshift are based on RDBMS.
  • 3. 4. What is SQL? SQL stands for Structured Query Language. It is the standard language for relational database management systems. It is especially useful in handling organized data comprised of entities (variables) and relations between different entities of the data. 5. What is the difference between SQL and MySQL? SQL is a standard language for retrieving and manipulating structured databases. On the contrary, MySQL is a relational database management system, like SQL Server, Oracle or IBM DB2, that is used to manage SQL databases.
  • 4. 6. What are Tables and Fields? A table is an organized collection of data stored in the form of rows and columns. Columns can be categorized as vertical and rows as horizontal. The columns in a table are called fields while the rows can be referred to as records. 7. What are Constraints in SQL? Constraints are used to specify the rules concerning data in the table. It can be applied for single or multiple fields in an SQL table during the creation of the table or after creating using the ALTER TABLE command. The constraints are: NOT NULL - Restricts NULL value from being inserted into a column. CHECK - Verifies that all values in a field satisfy a condition. DEFAULT - Automatically assigns a default value if no value has been specified for the field. UNIQUE - Ensures unique values to be inserted into the field. INDEX - Indexes a field providing faster retrieval of records. PRIMARY KEY - Uniquely identifies each record in a table. FOREIGN KEY - Ensures referential integrity for a record in another table.
  • 5. 8. What is a Primary Key? The PRIMARY KEY constraint uniquely identifies each row in a table. It must contain UNIQUE values and has an implicit NOT NULL constraint. A table in SQL is strictly restricted to have one and only one primary key, which is comprised of single or multiple fields (columns). 9. How to delete a table in SQL? There are two ways to delete a table from sql: DROP and TRUNCATE. The DROP TABLE command is used to completely delete the table from the database. This is the command: DROP TABLE table_name; The above command will completely delete all the data present in the table along with the table itself. But if we want to delete only the data present in the table but not the table itself, then we will use the truncate command: DROP TABLE table_name ;
  • 6. 10. How to change a table name in SQL? This is the command to change a table name in SQL: ALTER TABLE table_name RENAME TO new_table_name; We will start off by giving the keywords ALTER TABLE, then we will follow it up by giving the original name of the table, after that, we will give in the keywords RENAME TO and finally, we will give the new table name. For example, if we want to change the “employee” table to “employee_information”, this will be the command: ALTER TABLE employee RENAME TO employee_information;