"Students" table schema and data used in various examples on SQLINFO.net site

Students table schema (ddl)

 

CREATE TABLE dbo.Students
     ( 
        student_id                     INT              NOT NULL  , 
        password                       VARCHAR(15)          NULL  , 
        employee_id_fk                 VARCHAR(15)          NULL  , 
        customer_id_fk                 VARCHAR(15)          NULL  , 
        active_flg                     TINYINT          NOT NULL  , 
        lastname                       VARCHAR(30)          NULL  , 
        firstname                      VARCHAR(20)          NULL  , 
        middlename                     VARCHAR(20)          NULL  , 
        prefix_name                    VARCHAR(6)           NULL  , 
        suffix_name                    VARCHAR(6)           NULL  , 
        gender_code                    VARCHAR(1)           NULL  , 
        birth_dttm                     DATETIME             NULL  , 
        birth_city_nm                  VARCHAR(20)          NULL  , 
        birth_state_code               VARCHAR(2)           NULL  , 
        birth_country_code             VARCHAR(2)           NULL  , 
        gpa                            INT                  NULL  , 
        is_on_staff                    TINYINT          NOT NULL  , 
        soc_sec_num                    VARCHAR(9)           NULL  , 
        driver_license_num             VARCHAR(25)          NULL  , 
        driver_license_state_code      VARCHAR(2)           NULL  , 
        driver_license_country_ocde    VARCHAR(2)           NULL  , 
        other_id_num                   VARCHAR(25)          NULL  , 
        citizen_country_code           VARCHAR(2)           NULL  , 
        marital_status_code            VARCHAR(3)           NULL  , 
        race_code                      VARCHAR(5)           NULL  , 
        ethnic_group_code              VARCHAR(5)           NULL  , 
        veteran_military_status_code   VARCHAR(2)           NULL  , 
        fin_alert_code                 VARCHAR(2)           NULL  , 
        inactive_date                  DATETIME             NULL  , 
        inactive_reason                VARCHAR(255)         NULL  , 
        employee_inactivating          INT                  NULL  , 
        CONSTRAINT PK_Students PRIMARY KEY CLUSTERED (student_id ASC) 
        ON [PRIMARY] 
     )
GO 


CREATE NONCLUSTERED INDEX Students_driver_license_num
ON     dbo.Students(driver_license_num ASC)
ON     [PRIMARY] 

CREATE NONCLUSTERED INDEX Students_last_nm
ON     dbo.Students(lastname ASC)
ON     [PRIMARY] 

CREATE NONCLUSTERED INDEX Students_other_id
ON     dbo.Students(other_id_num ASC)
ON     [PRIMARY] 

CREATE UNIQUE NONCLUSTERED INDEX Students_password
ON     dbo.Students(password ASC)
ON     [PRIMARY] 

CREATE NONCLUSTERED INDEX Students_soc_sec_num
ON     dbo.Students(soc_sec_num ASC)
ON     [PRIMARY] 

GO 
 Collapse All    Expand All
Custom Search

SQL Server Information and Resources