Supporting an SBA marketing campaign
The SBA has recently seen applications for their loan offerings decline. You have been hired to build a database to support marketing campaigns to increase SBA loan applications. In this exercise, you will define a campaign
table to track campaign characteristics and results. Descriptions for the fields of this table are as follows:
- an
id
column to assign a unique identifier to each campaign - a
name
column restricted to 50 characters in length - a
budget
column that is restricted to monetary values less than $100,000 - a
num_days
column to indicate the length in days of the campaign (typically 180 days or less) - a
goal_amount
column to track the target number of applications - a
num_applications
column to track the number applications received
This exercise is part of the course
Creating PostgreSQL Databases
Exercise instructions
- Define the
campaign
table including the required columns (id
,name
,budget
,num_days
,goal_amount
,num_applications
) and the most appropriate data type specification for each.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- 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
);