0% found this document useful (0 votes)
2 views

SQL Interview Questions

The document provides a series of interview questions and answers related to MySQL and SQL, covering topics such as definitions, features, data types, and key concepts like ACID properties. It distinguishes between MySQL and SQL, explains the use of SELECT and WHERE clauses, and outlines differences between DELETE and TRUNCATE, as well as CHAR and VARCHAR data types. Additionally, it defines what a database and a database schema are.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

SQL Interview Questions

The document provides a series of interview questions and answers related to MySQL and SQL, covering topics such as definitions, features, data types, and key concepts like ACID properties. It distinguishes between MySQL and SQL, explains the use of SELECT and WHERE clauses, and outlines differences between DELETE and TRUNCATE, as well as CHAR and VARCHAR data types. Additionally, it defines what a database and a database schema are.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Interview questions and Answers

1.What is MySQL?
Answer: MySQL is an open-source relational database management system (RDBMS)
that uses Structured Query Language (SQL) to manage and manipulate data.

2.What is the difference between MySQL and SQL?


Answer: SQL is a standard query language for databases, while MySQL is an RDBMS
that uses SQL to manage data.

3.What are the main features of MySQL?


Answer: Open-source, multi-threaded, scalable, supports multiple storage engines,
and cross-platform compatibility.

4.What are MySQL data types?


Answer: Common data types include:
• Numeric: INT, FLOAT, DOUBLE
• String: VARCHAR, CHAR, TEXT
• Date/Time: DATE, TIME, DATETIME

5.What is SQL?
Answer:
SQL (Structured Query Language) is a standard language used to interact with relational
databases. It is used to perform operations like querying, updating, inserting, and
deleting data, as well as creating and modifying database structures.

6.What is the SELECT statement used for?


Answer:
The SELECT statement is used to retrieve data from a database.
Example:

7. What is the WHERE clause used for?


Answer:
The WHERE clause is used to filter records based on specified conditions.
Example:

8.What are ACID properties in a database?


Answer:
ACID stands for Atomicity, Consistency, Isolation, and Durability. These properties
ensure reliable database transactions.
• Atomicity: Ensures that a transaction is either fully completed or fully rolled back (all-
or-nothing).
• Consistency: Ensures that the database remains in a valid state before and after a
transaction.
• Isolation: Ensures that concurrent transactions do not affect each other.
• Durability: Ensures that once a transaction is committed, the changes are permanent
even in case of a system failure.

9. What is the difference between DELETE and TRUNCATE?


Answer:
• DELETE: Deletes specific rows based on a condition. It can be rolled back.
• TRUNCATE: Deletes all rows in a table. It cannot be rolled back.

10.What is the difference between CHAR and VARCHAR?


Answer:
• CHAR: Fixed-length string. Example: CHAR(5) will always store 5 characters, padding
with spaces if necessary.
• VARCHAR: Variable-length string. Example: VARCHAR(5) will store up to 5 characters
without padding.

11.What is a database?
Answer:
A database is an organized collection of data stored electronically. It allows for efficient
storage, retrieval, and manipulation of data. Databases are managed using Database
Management Systems (DBMS), such as MySQL, PostgreSQL, and Oracle.

12.What is a database schema?

Answer:
A schema is the blueprint or structure of a database that defines how data is organized.
It includes definitions of tables, columns, data types, relationships, indexes, views, and other
database objects.

You might also like