IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'juggybank')
	DROP DATABASE [juggybank]
GO

CREATE DATABASE [juggybank]  ON (NAME = N'juggybank_Data', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\juggybank_Data.MDF' , SIZE = 1, FILEGROWTH = 10%) LOG ON (NAME = N'juggybank_Log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\juggybank_Log.LDF' , SIZE = 1, FILEGROWTH = 10%)
 COLLATE SQL_Latin1_General_CP1_CI_AS
GO

exec sp_dboption N'juggybank', N'autoclose', N'false'
GO

exec sp_dboption N'juggybank', N'bulkcopy', N'false'
GO

exec sp_dboption N'juggybank', N'trunc. log', N'false'
GO

exec sp_dboption N'juggybank', N'torn page detection', N'true'
GO

exec sp_dboption N'juggybank', N'read only', N'false'
GO

exec sp_dboption N'juggybank', N'dbo use', N'false'
GO

exec sp_dboption N'juggybank', N'single', N'false'
GO

exec sp_dboption N'juggybank', N'autoshrink', N'false'
GO

exec sp_dboption N'juggybank', N'ANSI null default', N'false'
GO

exec sp_dboption N'juggybank', N'recursive triggers', N'false'
GO

exec sp_dboption N'juggybank', N'ANSI nulls', N'false'
GO

exec sp_dboption N'juggybank', N'concat null yields null', N'false'
GO

exec sp_dboption N'juggybank', N'cursor close on commit', N'false'
GO

exec sp_dboption N'juggybank', N'default to local cursor', N'false'
GO

exec sp_dboption N'juggybank', N'quoted identifier', N'false'
GO

exec sp_dboption N'juggybank', N'ANSI warnings', N'false'
GO

exec sp_dboption N'juggybank', N'auto create statistics', N'true'
GO

exec sp_dboption N'juggybank', N'auto update statistics', N'true'
GO

use [juggybank]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CreditCard]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CreditCard]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[userinfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[userinfo]
GO

CREATE TABLE [dbo].[CreditCard] (
	[CardName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CardNumber] [char] (14) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ExpiryDate] [datetime] NULL ,
	[Code] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[userinfo] (
	[username] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[password] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
GO

