Anda di halaman 1dari 3

2/14/2017 SQLIntroductionTypeofSQLStatements(DDL,DML,DCL,TCS,SCS)

Follow@way2tutorial 6,367followers Follow 685

Search on Way2Tutorial.com

Home HTML CSS Java Script j-Query XML Ajax SQL PL/SQL Tutorial Index

Popular Pages
HTML5 Tags References
SQL Constraints
PL/SQL Tutorial
CSS Properties

SQL Tutorial Home Oracle SQL Introduction


Introduction SQL
Previous Learn Next Learn
SQL Introduction
SQL Data Types
SQL Syntax
SQL CREATE / SHOW / What is SQL?
USE / DROP DATABASE SQL stands for Structured Query Language use for storing, manipulating and retrieving relational
SQL CREATE / DROP TABLE database data.
SQL DESC TABLE SQL queries to retrieve data from database same as you can adding and manipulating database data.
Basic SQL
SQL Insert SQL is a very powerful and diverse database language use to storing data into databases. SQL is loosely typed
SQL Update language so you can learn easily.
SQL Delete
In this SQL tutorial, we use command line examples to know about executing speed of SQL. It's take very bit of
SQL Select
time for executing and retrieving result.
SQL Distinct
SQL Alter SQL is a greater tool with web languages such as PHP, Python, Java, ASP et cetera to build dynamic web
applications.
SQL Where
SQL AND/OR Before starting SQL, relational databases have several point that are important to keep in mind.
SQL Between 1. RDBMS stands for Relational Database Management System.
SQL IN/NOT IN 2. Data Integrity : Store data only once and avoiding data duplication.
SQL LIKE (Wildcards) 3. SQL Constraints : Constraints are the rules which are apply to table columns to store valid data and prevents
SQL Constraints the user to storing/entering invalid data into table columns.
4. Better security : Assign grant or privilege to a individual User. Using this grant user can store confidential
SQL Constraints
data into table by using username or password.
SQL Primary Key
5. Database Normalization : Database normalization is the process to store database data very efficiently. No
SQL Foreign Key need to store same data more then one time and reduce the Data redundancy.
SQL Not Null 6. Different types of relationships : One to one, One to many, Many to many
SQL Unique 1. One to one relationship : merging for two tables.
SQL Check 2. One to many relationship : create a foreign key from an parent table to the child table.
SQL Default 3. Many to many relationship : create a new relation table.
Advance SQL Keep in your mind...
SQL GROUP BY SQL is not case sensitive.
SQL Having But SQL Data is a case sensitive.
SQL Order By
SQL TOP clause (LIMIT) SQL Process Flow
SQL Alias
When you execute SQL query come to a SQL Server. SQL Server work is managing database, load balancing,
SQL Transaction
transaction management etc. SQL server call to a actual physical database table and return the result. This
SQL Truncate
process is take small bit of time and depend of query and SQL server load.
SQL Index
SQL Joins
SQL Join
SQL INNER Join
SQL Equi Join
SQL Natural Join
SQL Outer Join
SQL LEFT Outer Join
SQL RIGHT Outer Join
SQL FULL Outer Join

http://www.way2tutorial.com/sql/oracle_sql_introduction_type_of_sql_statement.php 1/3
2/14/2017 SQLIntroductionTypeofSQLStatements(DDL,DML,DCL,TCS,SCS)
SQL SELF Join
SQL Cross Join
SQL UNION Clause
SQL Function
SQL Function

Rules of Semicolon(;) or Forward Slash(/) in SQL


There is a huge difference in SQL between the meaning of a / and a ; because they work differently.
SQL database systems require semicolon(;) at the end of statement to know it's ending.
Use forward slash(/) once at the end of each script, to tell SQL that there is not more lines of code. you can't
use forward slash(/) at the middle of the script.

The ; means terminate the current statement execute it and store it to the "SQL buffer", whereas the / executes
whatever statement script is in the current "SQL buffer".

Type of SQL Statement (DDL, DML, DCL, TCS, SCS Commands)


SQL statements are divided into five different categories: Data definition language (DDL), Data manipulation
language (DML), Data Control Language (DCL), Transaction Control Statement (TCS), Session Control Statements
(SCS).

Data Definition Language (DDL) Statements


Data definition statement are use to define the database structure or table.

Statement Description
CREATE Create new database/table.
ALTER Modifies the structure of database/table.
DROP Deletes a database/table.
TRUNCATE Remove all table records including allocated table spaces.
RENAME Rename the database/table.

Data Manipulation Language (DML) Statements


Data manipulation statement are use for managing data within table object.

Statement Description
SELECT Retrieve data from the table.
INSERT Insert data into a table.
UPDATE Updates existing data with new data within a table.
DELETE Deletes the records rows from the table.
MERGE (also called UPSERT) statements to INSERT new records or UPDATE existing records
MERGE
depending on condition matches or not.
LOCK TABLE statement to lock one or more tables in a specified mode. Table access denied to
LOCK TABLE
a other users for the duration of your table operation.
CALL Statements are supported in PL/SQL only for executed dynamically. CALL a PL/SQL program
EXPLAIN PLAN or EXPLAIN PATH access the data path.

Data Control Language (DCL) Statements


Data control statement are use to give privileges to access limited data.

Statement Description
GRANT Gives privileges to user for accessing database data.
REVOKE Take back for given privileges.

http://www.way2tutorial.com/sql/oracle_sql_introduction_type_of_sql_statement.php 2/3
2/14/2017 SQLIntroductionTypeofSQLStatements(DDL,DML,DCL,TCS,SCS)
ANALYZE ANALYZE statement to collect statistics information about index, cluster, table.
To track the occurrence of a specific SQL statement or all SQL statements during the user
AUDIT
sessions.
COMMENT Write comment to the data table.

Transaction Control Statement (TCS)


Transaction control statement are use to apply the changes permanently save into database.

Statement Description
COMMIT Permanent work save into database.
ROLLBACK Restore database to original form since the last COMMIT.
SAVEPOINT Create SAVEPOINT for later use ROLLBACK the new changes.
SET TRANSACTION command set the transaction properties such as read-write/read only
SET TRANSACTION
access.

PL/SQL Transaction Commit, Rollback, Savepoint, Autocommit, Set Transaction read more.

Session Control Statements (SCS)


Session control statement are manage properties dynamically of a user session.

Statement Description
ALTER SESSION statement to modify conditions or parameters that are affect to your
ALTER SESSION
database connection.
SET ROLE SET ROLE statement to enable or disable the roles that are currently enabled for the session.

Like Tweet
Tweet +1
Share Share Pin It

Previous Learn Next Learn

Search on Way2Tutorial.com Search

Web Development Tutorials: HTML | CSS | Java Script | XML | Ajax | SQL | PL/SQL | More Tutorials...
About Way2Tutorial: Home | Terms of use | Validate by: XHTML 1.0 Transitional
Report Error: Suggestion/Page Bug |2010-2017| www.way2tutorial.com

http://www.way2tutorial.com/sql/oracle_sql_introduction_type_of_sql_statement.php 3/3