CREATE TABLE dbo.QW_CATEGORY (
    [qw_categoryid] [int] NOT NULL,
    [qw_name] [varchar] (255) NOT NULL ,
    [qw_description] [varchar] (2000) NULL ,
    CONSTRAINT [pk_qw_category] PRIMARY KEY CLUSTERED ([qw_categoryid]) WITH FILLFACTOR = 80 ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE dbo.QW_SUBCATEGORY (
    [qw_subcategoryid] [int] NOT NULL,
    [qw_categoryid] [int] NOT NULL,
    [qw_name] [varchar] (255) NOT NULL ,
    [qw_description] [varchar] (2000) NULL ,
    CONSTRAINT [pk_qw_subcategory] PRIMARY KEY CLUSTERED ([qw_subcategoryid]) WITH FILLFACTOR = 80 ON [PRIMARY],
    CONSTRAINT [fk_qw_categoryid] FOREIGN KEY ([qw_categoryid]) REFERENCES QW_CATEGORY ([qw_categoryid])
) ON [PRIMARY]
GO

-- all new update scripts must include a line like this:
UPDATE QX_SYS_PROP SET PROP_VAL = '025' WHERE (PROP_ID = 'DB_APP_VERSION');
