SQL Technical Interview Q&A
SQL Technical Interview Q&A
Technical
Interview Q&A
and
Sample Queries
SQL Technical Interview Question and Answers:
1. What is Database?
A database is a place to store and manage data. It holds information in an organized way
Example: A school database stores student names, marks, and attendance.
2. What is SQL?
SQL (Structured Query Language) is a language used to read, write, and manage data in a
database.
3. What is MySQL?
MySQL is a popular database software that uses SQL to manage databases. It is free and
open-source.
4. What is DBMS?
A DBMS (Database Management System) is software that stores and retrieves data. It doesn’t
necessarily use relational tables.
Example DBMS: MS Access, file system
5. What Is RDBMS?
RDBMS (Relational DBMS) is a type of DBMS that stores data in tables and allows relations
using keys.
Example: MySQL, PostgreSQL
6. Difference between SQL and MySQL
SQL MySQL
Language Software
3. Create table
CREATE TABLE departments (
dept_id INT PRIMARY KEY,
dept_name VARCHAR(50) NOT NULL UNIQUE
);
CREATE TABLE students (
student_id INT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
age INT CHECK (age >= 17),
gender VARCHAR(10),
dept_id INT,
CONSTRAINT fk_dept FOREIGN KEY (dept_id) REFERENCES departments(dept_id)
);