Language Notes
Language Notes
system determines the best way to carry out your request and
SQL engine figures out how to interpret the task.
Query Dispatcher
Optimization Engines
Classic Query Engine
SQL Query Engine, etc.
A classic query engine handles all the non-SQL queries, but a SQL
query engine won't handle logical files. Following is a simple
diagram showing the SQL Architecture –
SQL Data type
An SQL data type refers to the type of data which can be stored in
a column of a database table.
Data Description
Type
Data Description
type
Data Description
type
o CREATE
o ALTER
o DROP
o TRUNCATE
Syntax:
NAME CHAR(20),
AGE NUMBER(4);
Example
Syntax:
To add a new column in the table..
ALTER TABLE table_name
ADD column_name COLUMN-definition;
Example
Example
ALTER TABLE EMPLOYEE
MODIFY( NAME VARCHAR(20));
Syntax
Example
DROP NAME;
TRUNCATE: It is used to delete all the rows from the table and free
the space containing the table.
Syntax:
Example:
1. TRUNCATE TABLE EMPLOYEE;
o INSERT
o UPDATE
o DELETE
o SELECT
Syntax:
Example
EXAMPLE-
VALUES(‘AMAN’,23);
VALUES (‘&1’,’&2’,&3);
Syntax:
For example:
UPDATE EMPLOYEE
SALARY=SALARY+1000;
OR
UPDATE EMPLOYEE
SALARY=SALARY+1000;
WHERE E_CODE=’222’;
DELETE: It is used to remove one or more row from a
table.
Syntax:
For example:
OR
o Grant
o Revoke