Press ESC to close

Top 20 Interview Questions And Answers On SQL For Freshers

Top 20 Interview Questions And Answers On SQL For Freshers




1. What is SQL?
SQL (Structured Query Language) is a programming language designed for managing and manipulating data stored in relational database management systems.

2. What are the basic SQL commands?
The basic SQL commands are:

– SELECT: Retrieves data from a database table.
– INSERT: Inserts new data into a database table.
– UPDATE: Modifies existing data in a database table.
– DELETE: Deletes data from a database table.
– CREATE: Creates a new database table.
– DROP: Deletes a database table.

3. What is the difference between SQL and MySQL?
SQL is a programming language, while MySQL is a relational database management system that uses SQL as its primary language.

4. What is a database table?
A database table is a collection of related data stored in a structured format with rows and columns.

5. What is a primary key?
A primary key is a unique identifier for each row in a database table.

6. What is a foreign key?
A foreign key is a field in a database table that refers to the primary key of another table.




7. How do you retrieve data from multiple tables?
You can retrieve data from multiple tables using the JOIN clause.

8. What is the difference between INNER JOIN and OUTER JOIN?
INNER JOIN returns only the rows that have a match in both tables, while OUTER JOIN returns all the rows from one table and the matching rows from the other table.

9. How do you sort data in a database table?
You can sort data in a database table using the ORDER BY clause.

10. How do you filter data in a database table?
You can filter data in a database table using the WHERE clause.




Top 20 Interview Questions And Answers On SQL

11. What is an index in a database table?
An index is a data structure that improves the speed of data retrieval by providing a quick way to locate specific data.

12. How do you create an index in a database table?
You can create an index in a database table using the CREATE INDEX statement.

13. What is a view in a database?
A view is a virtual table that is based on the result of a query.

SQL interview questions for freshers

14. How do you create a view in a database?
You can create a view in a database using the CREATE VIEW statement.

15. What is a stored procedure in a database?
A stored procedure is a set of SQL statements that are stored in a database and can be executed repeatedly.

16. How do you create a stored procedure in a database?
You can create a stored procedure in a database using the CREATE PROCEDURE statement.

17. What is a trigger in a database?
A trigger is a set of SQL statements that are automatically executed when a specific event occurs in a database.

18. How do you create a trigger in a database?
You can create a trigger in a database using the CREATE TRIGGER statement.

19. What is normalization in a database?
Normalization is the process of organizing data in a database to minimize data redundancy and improve data integrity.

20. What is denormalization in a database?
Denormalization is the process of intentionally designing a database to have redundant data to improve query performance.




Also Read: Top 20 Interview Questions And Answers On Java For Freshers

For More Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *