Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/sqldump/public_html/config.php on line 184

Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in /home/sqldump/public_html/config.php on line 184

Warning: mysql_query(): A link to the server could not be established in /home/sqldump/public_html/config.php on line 184
SQL Databases and Tables tutorials from SQL Dumpster

What are SQL databases and tables?

A database is a collection of raw data. It's a system for organizing and storing data which can then be manipulated, sorted and queried (using SQL) to produce information for the end user. A table is a set of data within a database. For example, a database named 'Online shop' may have a table called 'customers'. An organization may have multiple tables within a database, for different purposes. For example, an online shop may have a table for customers (see example below).

The columns within a table, often called table fields, have unique names and pre-defined data types (for example, an integer, varchar, decimal, etc.). Table columns can also have various attributes defining the column functionality - columns can be set as keys, a primary key if the column requires a unique value. Other keys and indexes can also be used to join tables within a database together.

While table columns describe the data types, the table rows contain the actual data for the columns.

Example of a table called 'Customers'

FirstName LastName EmailAddress TelephoneNumber Country
John Doe 01234 234 234 United Kingdom
Arnold Schwarzenegger 69872 726 732 Austria
Sylvester Stallone 888 123 456 United States
Mike Foo 555 893 0923 United States
Back to table of contents