Skip to main content

MySQL Tutorial for Beginners

 MySQL Tutorial for Beginners


MySQL- Tutorial.jpg
MySQL tutorial

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

MySQL is RDMS(Relational Database Management System).  It's a free open source SQL database management system and storing information for your website and directly use PHP to access that material and it's very easy for beginners to learn MySQL for MySql Tutorial for Beginners. It is fast, reliable and user-friendly. MySQL is a cross-platform that operates on a computer.


There are different Types Of Keys that are used in Database

  • Candidate Key - The candidate keys in a table are specified as the minimum set of keys, and can identify any data row in the table uniquely.
  • Primary Key - It is chosen from one of the candidate keys and becomes a table's identifying key.
  • Super Key - It is the main key Superset. It includes a set of attributes including the primary key, which can define every data row in the table in a unique way.
  • Composite Key -  If any single table attribute can not be the key i.e. it can not uniquely identify a row, instead we combine two or more attributes to form a key. This is known as the key to composite.
  • Secondary Key - This chooses only one of the candidate keys as the primary key.
  • Foreign Key - It is a value of the attribute in a table that acts as the primary key in another. Therefore, the international key is useful in connecting two tables together. Information should be entered with great care in the international key column because information entered incorrectly will invalidate the relationship between the two columns.

There are four types of SQL:

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

DDL is a Data Definition Language is the statement or commands which are used to define the database and Change the structure of your database tables.

There are some commands of DDL are:

  • CREATE –  It is used to create the records in the database.
Following syntax are:
CREATE DATABASE <DB_NAME>;

  • ALTER  - It is a command that is used to alters the structure of the database.
Following syntax are:
ALTER TABLE table_name ADD(
    column_name datatype);

  • DROP – It is used to drop/delete the table from the database.
Following syntax are:
DROP TABLE table_name

  • TRUNCATE –  It is used 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 used to add comments to the data dictionary.
  • RENAME – It is a command that is used to rename a table.
Following syntax are:
RENAME TABLE old_table_name to new_table_name

2. DML

DML is a Data Manipulation Language is the statement or commands which are used to manipulate the data including various SQL commands.
 
There are some commands of DML are:

  • SELECT - It is used to select/retrieves data from a table.
Following syntax are:
SELECT 
    column_name1, 
    column_name2, 
    column_name3, 
    ...
    column_nameN 
    FROM table_name;

  • INSERT - It is a command that is used to insert new data into a database.
Following syntax are:
INSERT INTO table_name VALUES(data1, data2, ...)

  • UPDATE - It is used to update/modify existing data within a table.
Following syntax are:
UPDATE table_name SET column_name = new_value WHERE some_condition;

  • DELETE - It is used to delete all records from a database table.
Following syntax are:
DELETE FROM table_name;

3. DCL

DCL is a Data Control Language is the statement or commands which is used to deals with rights, permissions and other controls of a database system and the commands include such as Grant and Revoke.

There are some Commands of DCLare:
  • GRANT - It is used to allow users to access privileges to the database.
Following command of grant is:

GRANT privilege_name
ON object_name
TO {user_name |PUBLIC |role_name}
[WITH GRANT OPTION];

  • REVOKE - It is used 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 used to Transaction Control Language is the statement or commands which are used to deal with the transaction of the database.

This MySQL tutorial is meant for absolute beginners and as we all know it is a business database platform that is easy and simple to use and it is generally used with PHP. Nowadays, when the world is in constant need of people who can work with huge amounts of data if you have the opportunity, you shouldn’t think twice about it because you will be prepared every time for every chance and that is the best reason to learn MySQL.

Comments

Popular posts from this blog

Python Tutorial for Beginners

Learn Python with Industrial Experts with Examples Python is a popular general-purpose high-level, interactive and object-oriented scripting language that was invented by Guido Rossum in 1990. Python programming is commonly used in Computing Science in Artificial Intelligence, Human language Generation, Neural Networks and other specialized fields. Python for beginners , it has a basic syntax that is easy to use. That makes Python an outstanding language for novice to learn technology. Why Learn Python It is the most common and rapidly growing programming language of the present time. Here are 10 explanations for learning Python:   1.  It is simple and easy to understand  2.  It is very popular and on-demand  3   It has several libraries and frameworks  4.  It is often used in Data science  5.  It is often used in Artificial Intelligence and Machine Learning  6.  It is used in Web development  7.  It is compact and can

Download Free PHP Projects

PHP is a language used in the server scripting process. It is not used in static websites but if you want an interactive web page then PHP is the best way to write the code. The software is completely open-source and you can download it for free. You can also opt for some free PHP projects to understand the whole language properly. If you search online, you will find a lot of PHP projects available for download. You can get them and start practicing.   Administrative Panel with Login and Registration Facility   If you are searching for PHP free projects online then this project can be of great help to you. Here you have to make a full-fledged administrative panel with the feature of user login and user registration process. So, you will get to learn how to make a user management portal by using PHP software. You can get the project requirement and source code online.   Student Record Management   It is another unique project for your PHP practice. In this project, yo

SEO Website Audit

SEO Audit How to Perform an SEO Audit of your website? An SEO audit defines as the process of examining the functioning and presence of the site in numerous areas. With the help of this, one can find basic issues of the websites that require improvement as well as prevent the websites from the scams. In addition to it, it also keeps your websites updated with updates related to the rankings that are upgraded by Google. Apart from it, you can also take help from SEO tutorials.  Areas covered by an SEO audit:   An audit covers numerous areas. Here is the list of some significant areas. ●   Ensure you about Problematic codes - It gives the information about the reason that causes your website ranking down or slows it down. You can either hire the web developer or take guidance from SEO tutorial to resolve this problem ●  Keywords - It shows you the usage of keywords is well placed, on a point or not. Crawling audit - It commences with crawl. It informs you