SQL Databases

SQL
databases, or Relational Database
s, employ the traditional way of storing data (where each database may contain several tables). However, it is worth mentioning that in RDB
s, each table contains rows that have the same attributes or "shape". As an example, in a "restaurant" database, you may have one table for customers
, another for orders
, and yet another for restaurant locations
.
Now here comes the importance of columns. Each column describes one specific piece of information about the record. The type of data that each column will contain is also predefined. For example, in a customer
table, one column may contain the customer id
(an integer
type column). Another may show the customer order id
(another integer
), and a third may contain information about customer address (varchar
).
Properly defining tables and columns is upfront work to be done to gainfully use a database. Then, the day to day task becomes adding new rows. This is where the SQL
language comes in handy. It offers a convenient way to create tables, define columns, add records, delete them, etc. It also allows us to "connect" or associate
(create relationships for) multiple tables by using the concept of primary
and foreign
keys.
