Working with Integer Types in PostgreSQL
📖 Scenario: You are creating a simple database table to store information about employees in a company. Each employee has an ID number, their age, and their salary in whole dollars.Different integer types can store different ranges of numbers. You will practice creating a table using smallint, integer, and bigint types to store these values efficiently.
🎯 Goal: Create a PostgreSQL table named employees with three columns: employee_id as smallint, age as integer, and salary as bigint. This will help you understand how to use different integer types for different data sizes.
📋 What You'll Learn
Create a table named
employeesAdd a column
employee_id with type smallintAdd a column
age with type integerAdd a column
salary with type bigint💡 Why This Matters
🌍 Real World
Companies often store employee information in databases. Choosing the right integer type helps save space and improves performance.
💼 Career
Database administrators and developers must understand data types to design efficient and reliable database schemas.
Progress0 / 4 steps