SQL: Structured Query Language
SQL: Structured Query Language
SQL
SQL stands for Structured Query Language
SQL, Structured Query Language, is the standard language used to
communicate with a relational database.
It works well on Oracle, Microsoft SQL Server, Sybase, Informix,
and others.
With SQL, you can build databases, enter data into the database,
manipulate data, and query the database.
SQL is a simple, English-like language that is relatively easy to
learn.
It is Case-Insensitive.
WAYS OF CREATING/MAINTAINING
DATABASE
Command-line based
GUI based
SOME IMPORTANT OPERATIONS
Creating database
Inserting values in database
Extracting/Retrieving data
Deleting data/table
ATTRIBUTE DATA TYPES
CHAR(size): character strings of fixed length.
VARCHAR(size)/VARCHAR2(size): character strings of
variable length.
NUMBER (P, S): to store fixed or floating point numbers.
P (precision): max length of data
S (scale): determines the number of places to the
- - -
- - -
- - -
TABLE STRUCTURE
Department (Table Name)
- - -
- - -
- - -
TABLE STRUCTURE
Department (Table Name)
- - -
- - -
- - -
TABLE STRUCTURE
Department (Table Name)
- - -
- - -
- - -
CREATE TABLE SYNTAX
CREATE TABLE Command in SQL-
Slide 2-10
CREATE TABLE department
( Dname VARCHAR2(15) ,
Dnumber NUMBER,
Mgr_ssn CHAR(9)
);
INSERTING DATA INTO TABLE SYNTAX
INSERT INTO command-
Slide 2-11
INSERT INTO department
VALUES ( ‘Computer Science’ , 007, ‘COMSCIAMU’ );
EXTRACTING DATA FROM TABLE
SELECT command-
WHERE Dnumber=007;
Book:
SQL, PL/SQL by Ivan Bayross