In the SQL programming language, a table is composed of data arranged into rows, or records, that consist of one or more fields.
A SQL database consists of one or more tables, and a table is where data is stored. A table is a structured container for holding data arranged into rows (or records) and columns (or fields).
Once a new database has been created and has been specified for use, tables can be created within it. The following command tells SQL to make a new table, titled customers to track the names of people who are customers of a business.
CREATE TABLE customers
(
customer_id int(11),
first_name varchar(50),
last_name varchar(50),
);
With some data in it, the table might look something like this:
| customer_id | first_name | last_name |
| 1 | John | Doe |
| 2 | Mark | Martin |
| 3 | Evan | Sheehan |
Each line in the above
CREATE TABLE command (between the parentheses) describes a
field in the table. A field can be thought of as a column in the table. Every customer entered into the table will occupy a row of the table, also called a
record. Each row (or record) of the table specified above contains three fields, remembering values for the three customer attributes of:
customer_id,
first_name, and
last_name.