Introduction to SQL Foundations
The following list contains the four different items when working with a SQL database.
- rows, and
These are the terms for the different elements of the database. You might think of these as containers, each containing information that is more specific. In a way, they are like stackable measuring cups, each fitting inside the next larger container.
When you are querying the database, you need to include information in your request that indicates where to find the data to query. That information includes the database and other items that contain the data.
- SQL stands for Structured Query Language
- SQL lets you access and manipulate databases
- SQL is an ANSI (American National Standards Institute) standard
Tables, rows, and columns
Most relational database servers use a programming language known as the Structured Query Language (SQL).
SQL is a set-oriented programming language that is designed to allow people to query and update tables of information. This module discusses tables, and how data is represented within tables.
Later in the course, we will discuss the syntax of the SQL language in more detail.
All information is stored in tables. A table is divided into rows and columns. (SQL theorists refer to columns as "attributes" and rows as "tuples", but we will use the more familiar terms "columns" and "rows".
We will also use the terms "record" and "row" interchangeably.) Each database contains 0 or more tables.
Most databases contain many tables.
An example of a table is shown below.
Table 1. Example database table
||29 Magnetic Street
||31 Prime Road
||37 Vector Space
This table contains 3 rows of data. The top "row", which has the labels "ID", "NAME", and "ADDRESS" is shown here for the convenience of the reader.
The table contains 3 columns (ID, NAME, and ADDRESS) where ID is the primary key. SQL provides commands to create tables, insert rows into tables, update data in tables, delete rows from tables, and query the rows in tables.