Top 50 SQL Interview Questions and Answers

  1. What is SQL?

    SQL (Structured Query Language) is a ANSI (American National Standards Institute) standard computer language for accessing and manipulating database systems. Using SQL statements, we can create a database, create a tables in the database, insert records in to table, update and delete records in the table etc. SQL works with database programs like Oracle, MySQL, PostgreSQL, SQLite, DB2, SQL Server, Sybase, MS Access and many more.

  2. What is a primary key?

    Primary key is a column or a set of columns that uniquely identifies each row in the table and Primary key cannot have NULL value & there should be only one primary key in a table.

  3. Write an SQL query to find the number of students studying in 'CSE' department.

    SELECT COUNT(*) FROM Students WHERE department = 'CSE';

  4. Write an SQL query to find names of student start with 'A' ?

    SELECT * FROM Students WHERE student_name like 'A%';