I will explain Introduction to Oracle SQL in this post of Oracle SQL Tutorial series.
If you don’t know what is the database and Why database, you can read the following posts before this.
WHAT IS SQL (STRUCTURED QUERY LANGUAGE) ?
SQL is not a programming language like C, JAVA, C ++ it is a sub language used in databases such as Oracle, MYSQL , SQL SERVER .
SQL is a query language that is used to add , delete , access and update data in a database .
USAGE AREAS OF SQL
Creating , modifying database objects ,
Controlling access to database, objects ,
Modeling , managing data sets ,
Data query , add , delete operations are performed .
WHY CHOOSE SQL?
Allows users to define and modify data .
Allows users to set permissions on tables , views .
Allows users to access data from relational database management systems .
Allows modules to be embedded in different languages .
Security, performance , data recovery features are the main features that are effective in choosing sql .
Provides quick processing of data and easy querying .
CLASSIFICATION OF SQL COMMANDS
SQL commands are categorized into 3 sections according to their functions :
DML (Data Manipulation Language) : Data processing language . For managing data with in table or schema objects (SELECT , UPDATE , INSERT , MERGE , DELETE , CALL)
DCL (Data Control Language) : Data control language . Used to set authorization or privileges . (GRANT,REVOKE)
DDL (Data Definition Language) : Data definition language . Used to define tables, database structures, or schemas . (CREATE , TRUNCATE , ALTER , COMMENT , DROP , RENAME)
TCL (Transaction Control) : The process is the control language . For managing changes made by DML . (COMMIT , SAVEPOINT , ROLLBACK)
SQL WRITING RULES
SQL statements do not distinguish between upper and lower case .
Keywords cannot be abbreviated or divided into lines (keywords : Select , From , etc.) .
Expressions are usually in separate lines .
Typically , key expressions are written in capital letters .
Date and character type data is written to the left and numeric data is written adjacent to the right .
Most Important SQL Commands are as follows.
- SELECT – query or extracts data from a database
- INSERT INTO – inserts data or records into a database
- UPDATE – updates and modify any data in a database
- DELETE – deletes any data from a database
- CREATE TABLE – creates a new table on Database
- ALTER TABLE – modifies any propery of table
- DROP TABLE – remove and purge a table
- CREATE INDEX – creates an index
- DROP INDEX – remove an index
- CREATE DATABASE – creates a new database on Instance
- ALTER DATABASE – change any propery of a database