Supabase Table with Data Types and Constraints
📖 Scenario: You are setting up a database table in Supabase to store information about employees in a company. Each employee has an ID, name, email, age, and hire date.
🎯 Goal: Create a table called employees in Supabase with appropriate data types and constraints to ensure data quality.
📋 What You'll Learn
Create a table named
employeesAdd a column
id as an integer primary keyAdd a column
name as text and not nullAdd a column
email as text, unique and not nullAdd a column
age as integer with a check constraint to allow only ages 18 and aboveAdd a column
hire_date as date and not null💡 Why This Matters
🌍 Real World
Companies use databases like Supabase to store employee information securely and reliably.
💼 Career
Knowing how to define tables with correct data types and constraints is essential for database administrators and backend developers.
Progress0 / 4 steps