SQL Table Examples


 Back to the main menu

The following tables are only examples and any use of these tables in a company or critical environment signifies the prior knowledge and acceptance, on behalf of the implentor, that the authors of this software are not liable for damages or losses in use of these tables. No guarantees are made as to the quality or reliabity of the table designs listed below. They are listed to help database designers/creators in their work by showing an example.
The schema used is non-standard. It shows the table name above three columns. The first is the name of the variable, the second is the type of that variable, and the third is the size (if necessary).


Example Accounts Database Table
This table was designed for a custom system needing user accounts where they could have a login and password to a website. It tracks logins, modifications to the data and who created the account. It also allows the account to be locked out. The password should be MD5 encrypted and stored in the database that way.

tblAccounts
 AccountID INTEGER 11
 Name VARCHAR 200
 Login VARCHAR 12
 Password VARCHAR 32
 Locked TINYINT
 LoginCount INTEGER 11
 LastLogin DATETIME
 Created DATETIME
 CreatedBy VARCHAR 200
 Updated DATETIME
 UpdatedBy VARCHAR 200

* The AccountID is a PRIMARY KEY (also UNIQUE)
* The Password is MD5 encrypted, hence the length of 32
* The Locked value is either zero (0) or one (1)
Example Products Database Table
This table was designed to store basic production information, possibly in a small business database or online shopping cart. It is highly recommended that this table be customized to your needs.

tblProducts
 ProductID INTEGER 11
 Name VARCHAR 200
 ShortDescription VARCHAR 250
 LongDescription TEXT
 Price DECIMAL(9,2)
 ImageURL VARCHAR 250
 Locked TINYINT
 ViewCount INTEGER 11
 LastViewed DATETIME
 Created DATETIME
 CreatedBy VARCHAR 200
 Updated DATETIME
 UpdatedBy VARCHAR 200

* The ProductID is a PRIMARY KEY (also UNIQUE)
* The ImageURL points to an image of the product
* The Locked value is either zero (0) or one (1)