開始使用免費開始

支援 SBA 行銷活動

SBA 近期發現其貸款申請數量下滑。你受雇建立一個資料庫,以支援行銷活動並提升 SBA 貸款申請量。在此練習中,你將定義一個 campaign 資料表,用來追蹤活動特性與成效。此資料表的欄位說明如下:

  • id 欄位:為每個活動指派唯一識別碼。
  • name 欄位:長度限制為 50 個字元。
  • budget 欄位:金額需小於 $100,000。
  • num_days 欄位:表示活動天數(通常為 180 天以內)。
  • goal_amount 欄位:用來追蹤目標申請件數。
  • num_applications 欄位:用來追蹤實際收到的申請件數。

本練習屬於課程

建立 PostgreSQL 資料庫

檢視課程

練習說明

  • 定義 campaign 資料表,包含必要欄位(idnamebudgetnum_daysgoal_amountnum_applications),並為每個欄位指定「最」合適的資料型別。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

-- Create the campaign table
___ ___ ___ (
  -- Unique identifier column
  ___ ___ PRIMARY KEY,
  -- Campaign name column
  ___ ___(50),
  -- The campaign's budget
  ___ NUMERIC(___, ___),
  -- The duration of campaign in days
  ___ ___ DEFAULT 30,
  -- The number of new applications desired
  ___ ___ DEFAULT 100,
  -- The number of received applications
  ___ ___ DEFAULT 0
);
編輯並執行程式碼