Wednesday, 6 August 2014

Relational Query Languages| Basic sql query language


BASIC SQL QUERY LANGUAGE

INTRODUCTION-
  • SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS).
  • SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standards (ISO) in 1987. 

WHAT CAN SQL DO?

SQL can execute queries against a database
SQL can retrieve data from a database
SQL can insert records in a database
SQL can update records in a database

SQL can delete records from a database
SQL can create new databases
SQL can create new tables in a database
• SQL can create stored procedures in a database
• SQL can create views in a database
SQL can set permissions on tables, procedures, and views

SQL LANGUAGES

1. Data Definition Language (DDL)
2. Data Manipulation Language (DML)
3. Data Control Language (DCL)

1) DATA DEFINITION LANGUAGE- The Data Definition Language (DDL) manages table and index structure.
COMMAND USED- CREATE, ALTER, DROP,RENAME
CREATE- creates an object (a table) in the database.
ALTER modifies the structure of an existing object in various ways, for  example, adding a column to an existing table or a constraint.
DROP deletes an object in the database, usually irretrievably, i.e., it cannot be rolled back.
RENAME rename scheme object

2) DATA MANIPULATION LANGUAGE- The Data Manipulation Language (DML) is the subset of SQL used to add, update,select and delete data.
COMMAND USED-INSERT, UPDATE, DELETE,SELECT
INSERT adds rows (formally tuples) to an existing table.
UPDATE modifies a set of existing table rows.
DELETE removes existing rows from a table.
SELECT Retrieve data from one or more table

3) DATA CONTROL LANGUAGE-The Data Control Language (DCL) authorizes users to access and manipulate data.          
COMMAND USED- GRANT, REVOKE, COMMENT
GRANT authorizes one or more users to perform an operation or a set of operations on an object.
REVOKE eliminates a grant, which may be the default grant.
COMMENT Adding the element into data dictionary

0 comments:

Post a Comment