-- Create database
USE [master]
GO

CREATE DATABASE TESTDB 
GO

USE [TESTDB]
GO

BEGIN TRANSACTION
GO

CREATE TABLE [ADMINISTRATOR].CONTACTS
	(
	ID int NOT NULL IDENTITY (1, 1),
	FIRSTNAME varchar(15) NOT NULL,
	LASTNAME varchar(15) NOT NULL,
	COMPANY varchar(20) NULL,
	ADDRESS varchar(30) NULL,
	PHONE varchar(15) NULL,
	EMAIL varchar(30) NULL,
	FAX varchar(15) NULL
	)  ON [PRIMARY]
GO
ALTER TABLE [ADMINISTRATOR].CONTACTS ADD CONSTRAINT
	CONTACT_ID PRIMARY KEY CLUSTERED 
	(
	ID
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

--Add contact records
INSERT INTO [ADMINISTRATOR].CONTACTS ([FIRSTNAME],[LASTNAME],[COMPANY],[ADDRESS],[PHONE],[EMAIL],[FAX]) 
	SELECT 'Bob', 'Jones', '12 Elm St', 'Bobs Plumbing', '555-2323', 'bob@bobs_plumbing.com', '555-2333' UNION ALL
	SELECT 'Sally', 'Williams', '23 Millewa Ave', 'Acme Co.', '747-7767', 'swilliams@acme.com', '747-7769' UNION ALL
	SELECT 'James', 'Cummings', '46 Church Rd', 'Ties r Us', '555-1187', 'jcummings@tiesrus.com', '555-1180' UNION ALL
	SELECT 'Haley', 'Smith', '46 Church Rd', 'Ties r Us', '555-1188', 'hsmith@tiesrus.com', '555-1180' UNION ALL
	SELECT 'Patrick', 'Johnson', '23 Millewa Ave', 'Acme Co.', '747-7768', 'pjohnson@acme.com', '747-7769'

GO
COMMIT