Search⌘ K
AI Features

Creating Tables

Explore how to build SQL tables by defining columns with specific data types and designating primary keys. This lesson helps you understand the structure of relational databases and apply CREATE TABLE statements to manage data effectively.

Relational database

When a table is organized in a manner where each row can be distinctly identified, and every cell in the table contains a single, indivisible value, the table is termed a relation. A collection of such tables forms a relational database

Data types

Each column in a table is associated with a specific data type, which defines the kind of data that can be stored in that column. It helps the database system understand how to store, retrieve, and manipulate the data. Here’s a brief overview of some common data types:

  • INTEGER or INT: The INT data type is employed to represent whole numbers without decimal points. For example, EmployeeID INT.

  • DECIMAL or DEC: The DECIMAL data type is utilized for storing ...