| | |
SQL is a standard language for accessing and manipulating databases.
[pic]
What is SQL?
SQL stands for Structured Query Language
SQL lets you access and manipulate databases
SQL is an ANSI (American National Standards Institute) standard
[pic]
What Can SQL do?
SQL can execute queries against a database
SQL can retrieve data from a database
SQL can insert records in a database
SQL can update records in a database
SQL can delete records from a database
SQL can create new databases
SQL can create new tables in a database
SQL can create stored procedures in a database
SQL can create views in a database
SQL can set permissions on tables, procedures, and views
SQL Syntax
| | |
[pic]
Database Tables
A database most often contains one or more tables. Each table is identified by a name (e.g. "Customers" or "Orders"). Tables contain records (rows) with data.
Below is an example of a table called "Persons":
|P_Id |LastName |FirstName |Address |City |
|1 |Hansen |Ola |Timoteivn 10 |Sandnes |
|2 |Svendson |Tove |Borgvn 23 |Sandnes |
|3 |Pettersen |Kari |Storgt 20 |Stavanger |
The table above contains three records (one for each person)