What is a table in a database?
A table in a database is the basic structure for storing data, similar to a spreadsheet in Excel. It's made up of rows and columns:
The table's parts
- Rows (records): each row is a separate object or record. For example, one employee, one order, or one customer.
- Columns (fields): each column describes a specific piece of information about the record. For example, name, age, registration date.
- A primary key: a unique identifier for every row, helping tell records apart unambiguously.
- Data types: every column holds data of a specific type: text, number, date, boolean, and so on.
An example "Employees" table:
| ID | Name | Age | Job Title | DepartmentID |
|---|---|---|---|---|
| 1 | Ivan | 30 | Manager | 101 |
| 2 | Maria | 25 | Accountant | 102 |
| 3 | Oleksii | 40 | Developer | 101 |
Every row is a separate employee, every column is a characteristic of that employee.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.