MySQL Tutorial for Beginners
By: Marlin Phptpoint
Tags: MySQL, Database

MySQL was developed by MySQL AB, a Swedish company formed in 1995. In 2008, MySQL AB announced that Sun Microsystems had agreed to get it for around $1 billion.

MySQL is RDMS(Relational management System). it is a free open source SQL management system and storing information for your website and directly use PHP to access that material and it’s extremely easy for beginners to find out MySQL for MySql Tutorial for Beginners. it’s fast, reliable and user-friendly. MySQL may be a cross-platform that operates on a computer.

There are differing types Of Keys that are utilized in Database

Candidate Key — The candidate keys during a table are specified because of the minimum set of keys, and may identify any data row within the table uniquely.

Primary Key — it’s chosen from one among the candidate keys and becomes a table’s identifying key.

Super Key — it’s the most key Superset. It includes a group of attributes including the first key, which may define every data row within the table in a unique way.

Composite Key — If any single table attribute can’t be the key i.e. it can’t uniquely identify a row, instead we combine two or more attributes to make a key. this is often referred to as the key to composite.

Secondary Key — This chooses just one of the candidate keys because of the primary key.

Foreign Key — it’s worth of the attribute during a table that acts because of the primary key in another. Therefore, the international key’s useful in connecting two tables together. Information should be entered with care within the international key column because information entered incorrectly will invalidate the connection between the 2 columns.

There are four sorts of SQL:

1. DDL(Data Definition Language)

2. DML(Data Manipulation Language)

3. DCL(Data Control Language)

4. TCL(Transaction Control Language)

DDL

DDL may be a Data Definition Language is that the statement or commands which are wont to define the database and alter the structure of your database tables.

There are some commands of DDL are:

CREATE — it’s wont to create the records within the database.

Following syntax are:

CREATE DATABASE ;

ALTER — it’s a command that’s wont to alter the structure of the database.

Following syntax are:

ALTER TABLE table_name ADD(

column_name datatype);

DROP — it’s wont to drop/delete the table from the database.

Following syntax are:

DROP TABLE table_name

TRUNCATE — it’s wont to remove all records from a table, including all spaces allocated to the information/records are removed.

Following syntax are:

TRUNCATE TABLE table_name

COMMENT — Comment is employed to feature comments to the info dictionary.

RENAME — it’s a command that’s wont to rename a table.

Following syntax are:

RENAME TABLE old_table_name to new_table_name

2. DML

DML may be a Data Manipulation Language is that the statement or commands which are wont to manipulate the info including various SQL commands.

There are some commands of DML are:

SELECT — it’s wont to select/retrieves data from a table.

Following syntax are:

SELECT

column_name1,

column_name2,

column_name3,

…

column_nameN

FROM table_name;

INSERT — it’s a command that’s wont to insert new data into a database.

Following syntax are:

INSERT INTO table_name VALUES(data1, data2, …)

UPDATE — it’s wont to update/modify existing data within a table.

Following syntax are:

UPDATE table_name SET column_name = new_value WHERE some_condition;

DELETE — it’s wont to delete all records from a database table.

Following syntax are:

DELETE FROM table_name;

3. DCL

DCL may be a Data Control Language is that the statement or commands which is employed to deals with rights, permissions and other controls of a database system and therefore the commands include like Grant and Revoke.

There are some Commands of DCLare:

GRANT — it’s wont to allow users to access privileges to the database.

Following the command of the grant is:

GRANT privilege_name

ON object_name

TO {user_name |PUBLIC |role_name}

[WITH GRANT OPTION];

REVOKE — it’s wont to withdraw the user’s access privileges given by using the GRANT command.

Following the syntax of revoke is:

REVOKE privilege_name

ON object_name

FROM {user_name |PUBLIC |role_name}

4. TCL

TCL is employed to Transaction Control Language is that the statement or commands which are wont to affect the transaction of the database.

This MySQL tutorial is supposed for absolutely the beginners and as we all realize it may be a business database platform that’s easy and straightforward to use and it’s generally used with PHP. Nowadays, when the planet is in constant need of individuals who can work with huge amounts of knowledge if you’ve got the chance, you shouldn’t consider it because you’ll be prepared whenever for each chance which is that the best reason to find out MySQL.