Introduction to SQL
DDL consists of :
Create command is used to create the DB objects like table,view, synonym, sequence, user, index, cluster, tablespace, segment, database, DBlink, proceduire, Function, Package, Trigger, Role, Directory type...
Syntax
CREATE TABLE TABLENAME
(
- SQL is referred as Structured query language, is database computer language required for managing the data relational data base management system.It acts as Interface for database only,universal interface.
- SQL is Non-Procedural language and it is 4th generation language.
- Procedural means execution from top to bottom and it is 3rd generation language.
- Data definition language(DDL)
- Data manipulation language(DML)
- Transaction control language (TCL)
- Data control language(DCL)
- System control language(SCL)
- Session control language(SCL)
- Data Query/Retrieval language
DDL consists of :
- Create
- Alter
- Drop
- Select
- Update
- Delete
- Insert
- Savepoint
- Commit
- Rollback
- Grant
- Revoke
Create command is used to create the DB objects like table,view, synonym, sequence, user, index, cluster, tablespace, segment, database, DBlink, proceduire, Function, Package, Trigger, Role, Directory type...
Syntax
CREATE TABLE TABLENAME
Char(size): To store fixed length char strings.Max upto 2000 bytes.By default 1 Byte.
Varchar(size):To store variable length.Max 4000 Bytes. Difference between varchar and char is that when we use char and assign the size all the placed are reserved for that column and where as varchar releases the memory when they are not used.
LONG: Data upto 2 GB can be stored.
RAW:To store binary data like signature,Thumb,impressions,photographs.
Long Raw: To store binary data upto 2GB size No default.
LOB: large objects
CLOB: char large objects
BLOB:Binary large objects.
Bfile:Binary file
Number(P,S):where P is primary, S is secondary(where P is left size of precision,S is right side precision) Ex:Salary number(6,2). Date: DD-MM-YY