使用整數型別
小企業管理局(SBA)透過其在地的小企業發展中心(SBDC)為創業者與小型企業提供諮詢與技術支援。由於線上能見度愈來愈重要,SBA 正推動一項協助小型企業開發電商網站的計畫。你受邀建立一個資料庫,用來儲存這些開發工作的相關資料。在本練習中,你將運用對 PostgreSQL 整數資料型別的理解,為 SBDC 客戶定義一張資料表。
本練習屬於課程
建立 PostgreSQL 資料庫
練習說明
- 完成
client資料表的定義,為各欄位選用最適合的整數型別,以支援可能的資料值範圍。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
-- Create the client table
___ ___ ___ (
-- Unique identifier column
id ___ PRIMARY KEY,
-- Name of the company
name VARCHAR(50),
-- Specify a text data type for variable length urls
site_url VARCHAR(50),
-- Number of employees (max of 1500 for small business)
num_employees ___,
-- Number of customers
num_customers ___
);