It2EDU

Wednesday, October 5, 2016

DBMS - Structured Query Language









Database systems and databases are essential in our daily
routine life.  Typically Data is
maintained in databases. Mainly data is of two types one is structure data and other
is unstructured data. Databases are developed to handle database operations
like store, retrieve, modify and delete of data.




Some databases are Oracle,
MySql, SqlServer, Sybase, DB2 and Access. These data bases are support to the
user to handle database operations.





Data: A data is an information piece or characters or
symbols or fact. In general data is generated so many ways.


Field: A field is an entity.


Record:  A record is a
collection of related fields.


Table: Data is organized in rows and column wise with same
characteristics is known as a table.


Database: A database is a collection of data tables. In
database each table is identified by a name call it as a table name.





Structured Query Language:


SQL is a Structured Query Language it is commonly used for
all relational databases for data definition, data control and data manipulation.
It follows ANSI standards.


DDL (Data Definition Language) : DDL is a standard command
set used to define data structures creation. This command set helps us to
creation and modification of data.


DML (Data Manipulation Language): DML is command set used
for modify the existing data.  It consists
of Select, Insert, Update and Delete statements.


DCL (Data Control Language): DCL is a set of commands to provide
privileges to various users. It provides data access to the identified user.





                                               Data
Definition Language



Syntax for Creation of Table:


Create table <table name> (


Column1 data type(size) [any constraints],


Column2 data type (size) [any constraints],


Column3 data type(size) [any constraints],


……………………………………………………………………


);





Rules for creation of table:


A table name should starts with an alphabet.


Reserved words are not allowed to use as table name.


Blank spaces and quotes are not allowed in table name.


Constraints for column while creating the table:


NOT NULL – Must have a value.


UNIQUE – It should be unique.


PRIMARY KEY – It identifies the record uniquely and
duplicates are not allowed.


CHECK – it verifies the given condition.


DEFAULT – default value


REFERENCES – Access the reference of source.








0 comments:

Post a Comment