Database Scripts
Create Customer Table
CREATE TABLE customers (
id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(),
first_name NVARCHAR(50) NOT NULL,
last_name NVARCHAR(50) NOT NULL,
email NVARCHAR(100) UNIQUE NOT NULL,
phone_number NVARCHAR(15) UNIQUE,
address_line1 NVARCHAR(100) NOT NULL,
address_line2 NVARCHAR(100),
city NVARCHAR(50) NOT NULL,
state CHAR(2) NOT NULL DEFAULT 'WA',
zip_code CHAR(5) NOT NULL,
country NVARCHAR(50) NOT NULL DEFAULT 'USA'
);Insert sample records in the Customer table
Stored procedure for selecting a list of customers
Stored procedure for selecting one customer
Stored procedure for creating or updating a customer record
Last updated
Was this helpful?