Font size
  • A-
  • A
  • A+
Site color
  • R
  • A
  • A
  • A
Skip to main content
Readepert
  • Home
  • Calendar
  • Course Categories
    Programming Languages AI, ML And Data Science
  • Exams
  • Results
  • Tutorials
  • Books
  • Colleges
  • Universities
  • Schools
  • Webstes
  • Software & Tools
  • Compilers & Practice Tools
  • More
You are currently using guest access
Log in
Readepert
Home Calendar Course Categories Collapse Expand
Programming Languages AI, ML And Data Science
Exams Results Tutorials Books Colleges Universities Schools Webstes Software & Tools Compilers & Practice Tools
Expand all Collapse all

Understanding Tables, Rows, and Columns

  1. Dashboard
  2. Courses
  3. Programming Languages
  4. SQL
  5. Module 1: Introduction to Databases And SQL
  6. Understanding Tables, Rows, and Columns
Completion requirements

When learning SQL, the first step is to understand how data is organized inside a database.
The three most important building blocks are:

  • Tables

  • Rows (Records)

  • Columns (Fields)

Letโ€™s break these down with clear examples.


1. ๐Ÿ”น What is a Table?

  • A table is like a container for data.

  • Think of it as an Excel sheet inside a database.

  • Each table stores information about a specific type of data.

๐Ÿ‘‰ Example: An Employees table stores details about employees.
It looks like a grid with rows and columns.

Employees Table (Example):

EmployeeID Name Department Salary
101 John HR 50,000
102 Alice IT 70,000
103 David Finance 65,000
  • Table name: Employees

  • Rows = each employee record

  • Columns = employee details (ID, Name, etc.)


2. ๐Ÿ”น What is a Row (Record)?

  • A row is a single entry in the table.

  • It represents one instance of the data type stored in the table.

  • Each row contains all the column values for that record.

๐Ÿ‘‰ Example:

ย 
Row Example (Employee 101) EmployeeID: 101 Name: John Department: HR Salary: 50,000

So, the first row in the Employees table means:

  • There is an employee named John,

  • His ID is 101,

  • He works in HR,

  • His salary is 50,000.


3. ๐Ÿ”น What is a Column (Field)?

  • A column defines an attribute or property of the data.

  • Every row must have a value (or sometimes NULL) for each column.

๐Ÿ‘‰ Example Columns in the Employees table:

  • EmployeeID โ†’ unique identifier

  • Name โ†’ employeeโ€™s name

  • Department โ†’ department name

  • Salary โ†’ salary amount

Each column has a data type (e.g., INT, VARCHAR, DATE, etc.).
For example:

  • EmployeeID โ†’ Integer

  • Name โ†’ Text (VARCHAR)

  • Salary โ†’ Number/Decimal


4. ๐Ÿ“Š Putting It All Together

Letโ€™s visualize:

  • Table = Excel file named Employees.xlsx

  • Column = Each Excel column โ†’ โ€œNameโ€, โ€œSalaryโ€, โ€œDepartmentโ€

  • Row = Each Excel row โ†’ โ€œJohn, 101, HR, 50000โ€

So in SQL:

  • Table = container of data

  • Row = one record (employee, student, order, etc.)

  • Column = attribute/field of that record


5. ๐Ÿ–ฅ๏ธ SQL Example

Letโ€™s create the Employees table in SQL:

ย 
CREATE TABLE Employees ( EmployeeID INT PRIMARY KEY, Name VARCHAR(50), Department VARCHAR(50), Salary DECIMAL(10,2) );

Insert some rows:

ย 
INSERT INTO Employees (EmployeeID, Name, Department, Salary) VALUES (101, 'John', 'HR', 50000), (102, 'Alice', 'IT', 70000), (103, 'David', 'Finance', 65000);

Retrieve data (see rows & columns):

ย 
SELECT * FROM Employees;

โœ… You now understand:

  • Tables = storage like Excel sheet

  • Rows = records (John, ID 101, etc.)

  • Columns = attributes (Name, Salary, DeptID)

๐Ÿ“˜ Understanding Tables, Rows, and Columns (with Real-Life Examples)


1. ๐Ÿ“ฆ Use-Case: Online Shopping (E-Commerce)

Think about Amazon or Flipkart.
They need to store details about their products.

Products Table Example:

ProductID ProductName Category Price Stock
201 iPhone 15 Mobile 80000 50
202 Samsung TV Electronics 60000 20
203 Nike Shoes Fashion 5000 100
  • Table: Products

  • Rows: Each row is one product (iPhone, TV, Shoes).

  • Columns: ProductID, Name, Category, Price, Stock.

๐Ÿ‘‰ SQL Example:

ย 
SELECT ProductName, Price FROM Products WHERE Category = 'Mobile';

This will list all Mobiles and their prices.


2. ๐Ÿฆ Use-Case: Banking

A bank needs to track customers and their accounts.

Customers Table Example:

CustomerID Name AccountType Balance
301 Rahul Savings 15000.00
302 Priya Current 50000.00
303 Arjun Savings 32000.00
  • Table: Customers

  • Rows: Each customer is a record.

  • Columns: ID, Name, Account Type, Balance.

๐Ÿ‘‰ SQL Example:

ย 
SELECT Name, Balance FROM Customers WHERE Balance > 20000;

This query shows all customers who have more than โ‚น20,000.


3. ๐ŸŽ“ Use-Case: Education (School / College)

A school keeps records of students.

Students Table Example:

StudentID Name Class Marks
401 Neha 10 89
402 Karan 12 76
403 Meena 9 92
  • Table: Students

  • Rows: Each student = one row.

  • Columns: StudentID, Name, Class, Marks.

๐Ÿ‘‰ SQL Example:

ย 
SELECT Name, Marks FROM Students WHERE Marks >= 90;

This shows toppers scoring 90 or above.


4. ๐Ÿš– Use-Case: Ride Booking (Uber/Ola)

A ride-booking app must store trips.

Rides Table Example:

RideID CustomerName Pickup Drop Fare
501 Ankit Delhi Noida 350
502 Sonali Mumbai Pune 1200
503 Ramesh Bangalore Airport 600
  • Table: Rides

  • Rows: Each ride = one row.

  • Columns: RideID, Customer, Pickup, Drop, Fare.

๐Ÿ‘‰ SQL Example:

ย 
SELECT CustomerName, Fare FROM Rides WHERE Fare > 500;

This lists all high-value rides.


5. ๐Ÿ›’ Putting All Use-Cases Together

  • E-Commerce (Products) โ†’ whatโ€™s being sold.

  • Banking (Customers) โ†’ who owns accounts.

  • Education (Students) โ†’ who studies in school.

  • Ride Booking (Rides) โ†’ trips being tracked.

In all these cases:

  • Table = container of data

  • Row = one record

  • Column = attribute of that record

This lesson is not ready to be taken.
Previous activity What is a Database?
Next activity Introduction to SQL

Contact us

Follow us

You are currently using guest access (Log in)
Data retention summary
Get the mobile app
Get the mobile app
Play Store App Store
Powered by Moodle

This theme was proudly developed by

Readexpert.com