Beruflich Dokumente
Kultur Dokumente
Introduction to SQL
I. What is SQL?
stands for Structured Query Language
a database sublanguage used in querying, updating, and managing relational
databases
derived from an IBM research group that created Structured English Query Language
(SEQUEL) in the 1970s
can either be used in formulating interactive queries or be embedded in an application
as instructions for handling data
designed for both technical and non-technical users
A. Major Components of SQL
Data Manipulation Language (DML) is a module of the SQL language which
allows you to retrieve, update, add, or delete data in a database.
Data Definition Language (DDL) enables you to create and modify the database
itself.
Data Control Language (DCL) maintains the proper security for the database.
II. Data Definitions
A. Database Manipulation
1. The CREATE DATABASE statement is used to create a database.
2. The DROP DATABASE statement is used to delete a database.
B. Database Table Manipulation
1. The CREATE TABLE statement is used to create a table within a database.
2. The ALTER TABLE statement allows for the modification of specific attributes of
a table, such as addition and deletion of columns.
3. The DROP TABLE statement is used to delete a specified table in a database.
III. Basic Data Retrieval
A. Basic SQL Expression Clauses
The SELECT clause is used to list the attributes desired in the result of a query,
allowing retrieval of data in SQL.
The FROM clause lists the relations to be scanned in evaluation of an expression.
The WHERE clause consists of a predicate involving attributes of relations that
appear in the FROM clause.
References
Coronel, C., Crockett, K., and Rob, P. (2012). Database systems: Design, implementation &
management. USA: Cengage Learning EMEA
Singh, S. K. (2009). Database systems: Concepts, design and applications. India: Pearson Education.
Adamski, J. and Pratt, P. (2012). Database management systems (7th ed.). USA: Cengage Learning
Elmarsi, R. and Navathe, S. (2010). Fundamentals of database systems (6th ed.). Pearson Eduaction
South Asia Pte. Ltd.
Rockoff, L. (2011). The language of SQL. Cengage Learning.
Korth, H., Silberschatz, A., and Sudarshan, S. (2011). Database system concepts (6th ed.). New York.
McGraw-Hill.