DATABASE DESIGN CONCEPTS
TCCS 121 – Student Notes 10
Introduction to Structured Query Language (SQL)
What is SQL?
SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in relational database.
SQL is the standard language for Relation Database System. All relational database management systems like MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server use SQL as standard database language.
Also, they are using different dialects, such as:
• MS SQL Server using T-SQL,
• Oracle using PL/SQL,
• MS Access version of SQL is called JET SQL (native format) etc.
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 drop databases
SQL can create new tables in a database
SQL can drop tables in a database
SQL can create stored procedures in a database
SQL can create views in a database
SQL can create functions in a database
SQL can set permissions on tables, procedures, and views
SQL can be embedded in other languages using SQL modules, libraries & pre-compilers
SQL Process:
When you are executing an SQL command for any RDBMS, the system determines the best way to carry out your request and SQL engine figures out how to interpret the task.
There are various components included in the process. These components are Query Dispatcher, Optimization Engines, Classic Query Engine and SQL Query Engine, etc. Classic query engine handles all non-SQL queries, but SQL query engine won't handle logical files.
Following is a simple diagram showing SQL Architecture:
The Demo Database used in the notes is hosted at http://www.w3schools.com/sql/ SQL Commands:
The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT,