SQL Server Interview Topic 1: Database Basics and Table Design
This topic checks whether you understand the basic building blocks of SQL Server. A full stack developer must know this because the backend API usually reads from and writes to database tables.
You should be able to explain a database, table, row, column, primary key, foreign key, data type, NULL value, constraint, and identity column using a simple School Management System example.
Q1. What is SQL Server?
Quick interview answer:
SQL Server is a database management system from Microsoft. We use it to store, read, update, and protect application data. In a School Management System, SQL Server can store students, teachers, exams, marks, fees, and attendance.
Study in detail: SQL Server Introduction - This article explains SQL Server in simple words and shows where it fits in backend development.
Q2. What is the difference between a database and a table?
Quick interview answer:
A database is a container for related data. A table is one organized list inside the database. For example, SchoolManagement is the database, and Student, Teacher, and Exam are tables inside it.
Study in detail: Create Database and Tables - This article shows how one database can contain many related tables.
Q3. What is a row and what is a column?
Quick interview answer:
A column describes one type of information, such as student name or mobile number. A row stores one complete record. In a Student table, one row means one student, and columns hold that student's details.
Study in detail: Insert Data - This article helps you see how values are inserted into table columns as rows.
Q4. What is a primary key?
Quick interview answer:
A primary key uniquely identifies each row in a table. It should not be empty and should not repeat. In a Student table, StudentId can be the primary key because each student needs one unique id.
Study in detail: Constraints - This article explains primary key and other rules that protect table data.
Q5. What is a foreign key?
Quick interview answer:
A foreign key connects one table to another table. It helps SQL Server stop invalid data. For example, ExamMarks.StudentId can refer to Student.StudentId, so marks cannot be added for a student who does not exist.
Study in detail: Foreign Keys - This article explains table relationships using beginner-friendly examples.
Q6. What are SQL Server data types?
Quick interview answer:
A data type tells SQL Server what kind of value a column can store. INT stores whole numbers, NVARCHAR stores text, DATE stores dates, and DECIMAL stores values like marks or fees. Choosing the correct data type keeps data clean.
Study in detail: Data Types - This article shows common data types and when to use each one.
Q7. What is NULL in SQL Server?
Quick interview answer:
NULL means the value is missing or unknown. It is not the same as zero, empty text, or false. For example, if a student's middle name is not entered, that column can be NULL.
Study in detail: NULL Handling - This article explains how to check and handle missing values safely.
Q8. What are constraints and why do we use them?
Quick interview answer:
Constraints are rules added to table columns. They stop wrong data before it enters the table. For example, a NOT NULL rule can force student name to be required, and a CHECK rule can stop marks from going above 100.
Study in detail: Constraints - This article expands constraints with practical SQL examples.
Practice Before Next Topic
Create a small SchoolManagement database with a Student table and an ExamMarks table. Add a primary key in Student, a foreign key in ExamMarks, and choose correct data types for name, date of birth, marks, and mobile number.
When you answer SQL basics, always use a real table example. Definitions alone sound memorized. Examples show that you understand the concept.