BDG Scenario 3

Grade.sql

If Exists (Select * From sysobjects Where name = N'Grade' And user_name(uid) = N'dbo')
    Drop Table dbo.Grade
Go

Create Table dbo.Grade
    (
    GradeId int Not Null Identity (1, 1),
    GradeScaleId int Not Null,
    Name nvarchar(50) Not Null,
    Value float(53) Null,
    AffectAverage bit Not Null Constraint DF_Grade_EffectAverage Default (1)
    )
Go
Alter Table dbo.Grade Add Constraint
    PK_Grade Primary Key Nonclustered
    (
    GradeId
    )
Go
Alter Table dbo.Grade Add Constraint
    FK_Grade_GradeScale Foreign Key
    (
    GradeScaleId
    ) References dbo.GradeScale
    (
    GradeScaleId
    )
Go