A table is a structured database object used to store related information. A table is made up of columns and rows. Columns describe the type of information being stored, while rows contain individual records. For example, an Employees table may contain EmployeeID, EmployeeName, Department, Salary, and JoiningDate columns. Each employee is represented by a row in that table.
Tables are one of the most important concepts in SQL. Most SQL queries retrieve or manipulate information from one or more tables. Understanding tables makes it easier to learn SELECT, WHERE, GROUP BY, JOIN, INSERT, UPDATE, and DELETE.
An Employees table may contain 10,000 employees. The columns describe employee attributes such as name, department, salary, and location. Each row represents one employee.
SELECT
*
FROM Employees;
Organizations create tables for customers, employees, products, sales, orders, transactions, accounts, branches, departments, and many other business entities.
- A table stores related information.
- Columns represent attributes or fields.
- Rows represent individual records.
- A table can contain many rows.
- A database can contain many tables.
- Tables can be connected using keys.
What is a table in SQL?
A table is a database object used to store related information in rows and columns.
Can a database contain multiple tables?
Yes. A relational database commonly contains multiple tables that can be connected through relationships.