TOP SQL INTERVIEW QUESTIONS

Pramod Dutta
2 min readJan 15, 2024

--

1.Difference between SQL and MySQL: SQL is a standard language for accessing and managing databases, while MySQL is an open-source relational database management system (RDBMS) that uses SQL​​​​.

2.What are ACID properties in a transaction?: ACID stands for Atomicity, Consistency, Isolation, and Durability. These properties ensure reliable processing in a database system during transaction processing​​.

3.Dateadd function in SQL: The DATEADD function adds a number to a specified part of a date and returns the modified date. It’s useful for calculations involving dates​​.

4.What is a View in SQL?: A view is a virtual table representing a subset of data from one or more tables. Views are not physically present in the database but act like tables​​.

5.Different types of indexes: The three main types of indexes in SQL are Unique Index, Clustered Index, and NonClustered Index, each serving different purposes in data retrieval and storage optimization​​.

6.What is a Cursor?: A cursor in SQL is a control structure used for traversal of records in a database. It acts like a pointer, allowing operations on data row by row​​.

7.Subsets of SQL: SQL has several subsets, including Data Definition Language (DDL) for database structure operations, Data Manipulation Language (DML) for data access and modification, and Data Control Language (DCL) for access control​​​​.

8.What is a Stored Procedure?: A stored procedure is a set of SQL statements that can be stored in the database. A stored procedure can be invoked and executed as needed, which is efficient for frequently used or complex operations​​.

9.What are Scalar Functions?: Scalar functions in SQL are used to return a single value based on the input value. For example, UCASE() converts a specified field to upper case​​.

10.What is a Natural Join?: A natural join in SQL is a type of join that creates an implicit join clause for you based on the common columns in the two tables being joined. It is a subset of the inner join​

--

--

Pramod Dutta
Pramod Dutta

No responses yet