SlideShare a Scribd company logo
SQL interview questions by jeetendra mandal - part 3
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 by Jeetendra Mandal - part 2
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
SQL interview questions by Jeetendra Mandal - part 2
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

What's hot (20)

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

Similar to SQL interview questions by jeetendra mandal - part 3 (20)

PDF
Dbms interview questions
PPTX
Microsoft SQL 000000000000000000001.pptx
PDF
DBMS Interview Questions PDF By ScholarHat
DOCX
What is Database.docx
PDF
Sql a practical introduction
PDF
DBMS and SQL Questions and Answers (1).pdf
PDF
Sql a practical_introduction
PPTX
PPT SQL CLASS.pptx
PPTX
MS SQL - Database Programming Concepts by RSolutions
DOCX
Sql interview q&a
PDF
SQL for data scientist And data analysist Advanced
PDF
SQL Interview Questions - InterviewBit.pdf
PDF
Lecture on DBMS & MySQL.pdf v. C. .
PPTX
SQL.pptx for the begineers and good know
PPTX
PDF
SQL Server Interview Questions PDF By ScholarHat
PPT
Introduction to structured query language (sql)
PDF
SQL Complete Tutorial. All Topics Covered
PPTX
Relational Database.pptx
PPTX
Introduction to SQL.pptx
Dbms interview questions
Microsoft SQL 000000000000000000001.pptx
DBMS Interview Questions PDF By ScholarHat
What is Database.docx
Sql a practical introduction
DBMS and SQL Questions and Answers (1).pdf
Sql a practical_introduction
PPT SQL CLASS.pptx
MS SQL - Database Programming Concepts by RSolutions
Sql interview q&a
SQL for data scientist And data analysist Advanced
SQL Interview Questions - InterviewBit.pdf
Lecture on DBMS & MySQL.pdf v. C. .
SQL.pptx for the begineers and good know
SQL Server Interview Questions PDF By ScholarHat
Introduction to structured query language (sql)
SQL Complete Tutorial. All Topics Covered
Relational Database.pptx
Introduction to SQL.pptx
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)

PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
System and Network Administration Chapter 2
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Introduction to Artificial Intelligence
PPTX
L1 - Introduction to python Backend.pptx
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Upgrade and Innovation Strategies for SAP ERP Customers
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Design an Analysis of Algorithms I-SECS-1021-03
2025 Textile ERP Trends: SAP, Odoo & Oracle
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
wealthsignaloriginal-com-DS-text-... (1).pdf
System and Network Administration Chapter 2
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Introduction to Artificial Intelligence
L1 - Introduction to python Backend.pptx
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
ai tools demonstartion for schools and inter college
Wondershare Filmora 15 Crack With Activation Key [2025
VVF-Customer-Presentation2025-Ver1.9.pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design

SQL interview questions by jeetendra mandal - part 3

  • 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;