
-- DROP TABLE tl_score;



CREATE TABLE tl_score (
    object_id int NOT NULL ,
    object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
    object_created_date datetime DEFAULT getdate() NOT NULL
    ,
    score_number numeric(12) NULL,
    color_rank numeric(12) NULL,
    wghtd_score numeric(12) NULL,
    test_analysis_id numeric(12)  NULL,
    factor_number numeric(12)  NULL,
    level_number numeric(12)  NULL,
    narrative_id numeric(12)  NULL,
    candidate_id numeric(12)  NULL
    );



ALTER TABLE tl_score ADD    
    CONSTRAINT PK_tl_score PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_score_test_analysis_id 
    ON tl_score (test_analysis_id);

    CREATE INDEX idx_tl_score_narrative_id 
    ON tl_score (narrative_id);

    CREATE INDEX idx_tl_score_candidate_id 
    ON tl_score (candidate_id);
