"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 

/*** 
     Total column      number = 31
     Total foreign key number = 0
     Total index       number = 6
     Max   record      size   = 519
 ***/ 
 

 


If you find this site useful and are a book buyer/reader...

You can support my site by clicking on one of the Links below to Abe books

By doing this, I will receive a small commision on your purchase and making your purchase will not cost you any more money than if you went directly the site yourself! 

Abe Books sells books at a fraction of the original cost. I have purchased many books from them originally cost $40.00 for as little as $5 to $10 dollars including shipping costs


Click on applicable icon to find books at Abe Books on ...

SQL Server 2008 SQL Server 2005 SQL Server 2000 T-SQL

Abe Books is one of my affiliates. I only use affiliates that I also purchase products from. I love Abe books. If it is printed they likely have a copy. I have also included a generic link to Abe Books below.

Once on their site, you will find that they have a nice, easy to use search engine so to find what you are looking for.

Free Shipping 125x125

SQL Server Examples

SQL DML

String Functions

Transactions

Stored Procedures

SQL Views

SQL Table Basics













navTango.com free

75% of your donation

goes to charity.