TCL also known as Transaction Control Language.It is used to manage different transactions occurring within a database.Various statements included under this category are:

1) COMMIT
2) ROLLBACK

COMMIT:
This is used to commit or saving the changes permanently you have made.Syntax:

COMMIT;

ROLLBACK:
It is used to discard the changes you have made.Syntax:

ROLLBACK;

IMPORTANT POINTS:
1) In case of Mysql,always use START TRANSACTION at the beginning.
2) When you use commit/rollback.It will commit/rollback the changes you have made after writing START TRANSACTION.

Read more

DCL is also known as DATA CONTROL LANGUAGE.It is used to create roles, permissions, and referential integrity.Moreover,It is used to control access to database by securing it.Statements included under DCL are:

1)GRANT
2)REVOKE

GRANT:
It is used to grant privileges at specified access level. Syntax:

GRANT privilege[....]
ON object[,.....]
TO { PUBLIC | GROUP | USERNAME};


REVOKE:
The REVOKE statement enables system administrators to revoke privileges from MySQL accounts.

Read more

DML also known as Data Manipulation Language.It is used to retrieve, store, modify, delete, insert and update data in database.Various statements or commands included under this category are:

1)INSERT
2)SELECT
3)UPDATE
4)DELETE

INSERT:
This statement is used to insert data into a table. Syntax:
INSERT INTO <table name>(<column name1>,.....) 
VALUES('a','b','c');

*(column name1,....) is an optional part.
*If you are writing a column names make sure count of no. of values=count of no. of columns and should be in the same order as the column names.

SELECT:
This statement is used to retrieve data from a database based on various condition using WHERE conditions.

SELECT <column name1>,<column_name2>,....
FROM <table name>
WHERE <condition>.

UPDATE:
This statement is used to update values in a table. Syntax:

UPDATE <table name>
SET <column name1>=<value>
WHERE <condition>;

DELETE:
This is used to delete certain rows from a table based on certain conditions.

DELETE FROM <table name> WHERE <condition>;


IMPORTANT PIONTS:
1) Always apply semi-colon(;) at the end of the query.

Read more

DDL refers to Data Definition Language.This is used for defining a database.
Commands or Statements included under this category are:

1)CREATE
2)ALTER
3)DROP

CREATE:
CREATE statement is used to create databases or tables.

Creating a Database:
CREATE DATABASE <database name>;

Creating a table:
CREATE TABLE <table name>
(
<column name> <data type> <constraint>,
...
...
);

ALTER:
ALTER statement is basically used to modify a table.Modifying a table means modifying the structure of a table like column names,data types,constarints.For changing the values within a column use DML(please refer to DATA MANIPULATION LANGUAGE)

Altering a table:
ALTER <table name>
MODIFY COLUMN <column name> <data type>;

DROP:
Drop is basically used to drop a table.Dropping a table means deleting the entire table permanently(including data and the entire structure).

DROP TABLE <table name>;


IMPORTANT POINTS TO REMEBER:
1) If we you are using SQL workbench,After Creating a database always remember to use this database by:
USE <database name>.
2) Always use Capslock characters while writing SQL statements.
3) Always use ANSI standards.

Read more

E-R MODEL:
The Entity-Relationship model is based on a perception of the world as a collection of basic objects(entities) and relationships amongh these objects.

RELATIONAL MODEL:
Data and Relationships are represented by a collection of tables.Each table has a number of columns with unique names.For example:customer,account.

NETWORK MODEL:
Data are represented by collection of records.Relationships among data are represented by links.Organization is that of an arbitrary graph.

HIERARCHICAL MODEL:
The hierarchical model is similar to the network model.Organization of the records is like a collection of trees,rather than arbitrary graphs.

Read more

SQL refers to "Structured Query Language". It is basically used to retrieve data from databases with the help of select statement.Moreover,You can create databases using create commands.

Some Important terms Of MYSQL are:

DATABASE(DB):
A database is a collection of logically related data.It is used to search data to answer queries.A database may be designed for batch processing,real time processing,or online processing.

DATABASE MANAGMENT SYSTEM(DBMS):
Database System is a set of software or programs that enables storing,modifying,and not extracting information from a database.It also provides users with tools to add,delete,access,modify and analyze data stored in one location.

DATA MODEL:
A data model is a representation of a real world situation about which data is to be collected and stored in a database.A data model depicts the data-flow and logical interrelationship among different data elements.



Read more

Powered by Blogger.