Basic SQL Interview Questions

    Question 1SQL Definition and Purpose

    What is SQL, and why is it used?

    Question 2Database vs Table Distinction

    What is the difference between a database and a table?

    Question 3Selecting All Columns

    Which query retrieves all columns from the students table?

    Question 4Filtering Rows with WHERE

    Write a query to find all employees whose department is 'HR'.

    Question 5Primary Key vs Unique Key

    What is the difference between primary key and unique key?

    Question 6Sorting Results

    Which query returns student names in ascending order?

    Question 7Foreign Key Concept

    What is a foreign key?

    Question 8SQL Constraints Overview

    What are constraints in SQL?

    Question 9NULL vs 0 Distinction

    What is the difference between NULL and 0?

    Question 10Counting Rows

    Which query counts the total number of students in the students table?