Table of Contents



pears.DepartmentTag

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

Description

Allows non department candidate date questions to be departmentalised.

Columns

Column Type Null Default Comment
DepartmentTagID char(20) NOT NULL
TagID char(3) NULL
TagLocation char(3) NULL 'P' Will always be P but needed for referential integrity
DepartmentID char(2) NULL

Primary Key

Foreign Keys

Constraint Columns References Delete/update action
Department DepartmentID pears.Department (departmentid) ON DELETE CASCADE
TagKey TagLocation, TagID pears.tag (taglocation, tagid) NOT NULL; ON DELETE CASCADE

Referenced By

Indexes

Triggers

Original SQL

-- IQX database structure split by table
-- Source: IQXDatabaseStructure - with comments.sql
-- Table: "pears"."DepartmentTag"
-- Table comment: Allows non department candidate date questions to be departmentalised.
-- Statement count: 5
 
CREATE TABLE "pears"."DepartmentTag" (
    "DepartmentTagID"                CHAR(20) NOT NULL
   ,"TagID"                          CHAR(3) NULL
   ,"TagLocation"                    CHAR(3) NULL DEFAULT 'P'
   ,"DepartmentID"                   CHAR(2) NULL
   ,PRIMARY KEY ("DepartmentTagID" ASC) 
)
GO
 
 
COMMENT ON COLUMN "pears"."DepartmentTag"."TagLocation" IS 
	'Will always be P but needed for referential integrity'
GO
 
 
COMMENT ON TABLE "pears"."DepartmentTag" IS 
	'Allows non department candidate date questions to be departmentalised.'
GO
 
 
ALTER TABLE "pears"."DepartmentTag"
    ADD FOREIGN KEY "Department" ("DepartmentID" ASC)
    REFERENCES "pears"."Department" ("departmentid")
    ON DELETE CASCADE
GO
 
 
ALTER TABLE "pears"."DepartmentTag"
    ADD NOT NULL FOREIGN KEY "TagKey" ("TagLocation" ASC,"TagID" ASC)
    REFERENCES "pears"."tag" ("taglocation","tagid")
    ON DELETE CASCADE
GO