| Introduction to SQL |
| |
| What is Database? |
| |
| A database is an organized collection of data that
is useful to us. The data inside in a database can be modified, deleted
or new data can be added. They are stored in the form of
records as shown in the table below: |
| |
|
| |
| The above table shows a single record. The columns-Associate_TID,
Associate_name, Age ,Commission are the fields or attributes, while
the row containing the corresponding the values-900678432, Smith,
28, 25000 is a single record. |
| |
| There can be a number of records in a table and
number of tables in a database. The tables in a database
are related to each other through one/more attributes/fields. |
| |
| |
| A Database is diagrammatically shown below. It consists
of two tables-Associate and Asso_INFO. While Associate stores
information regarding an Associate TID, dept and salary, the
table Associate_INFO stores TID, name and date of join of the
Associate. The common link between the tables is established
by the field Asociate-TID. |
| |
|
| |
| |
| SQL Database Tables |
| As explained above, database is nothing but a collection of
inter-related tables. A table consists of rows and columns.
Rows are the records stored whereas columns are attributes or fields.
Each table is identified with a name e.g, Associate (Associate_Tid,
Associate_name, Age, Commission), suggesting Table named
Associate has four fields. |
| |
|
| |
| |
|
|
| |
| |