Skip to main content

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

  1. Rows (records): each row is a separate object or record. For example, one employee, one order, or one customer.
  2. Columns (fields): each column describes a specific piece of information about the record. For example, name, age, registration date.
  3. A primary key: a unique identifier for every row, helping tell records apart unambiguously.
  4. Data types: every column holds data of a specific type: text, number, date, boolean, and so on.

An example "Employees" table:

IDNameAgeJob TitleDepartmentID
1Ivan30Manager101
2Maria25Accountant102
3Oleksii40Developer101

Every row is a separate employee, every column is a characteristic of that employee.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.