ddsingh@infomatics.info +91 9760014754

What is MySQL:-

    MySQL is a fast, easy to use relational database.

    It is currently the most popular open-source database.

    It is very commonly used in conjunction with PHP scripts

    to create powerful and dynamic server-side applications.

 

    MySQL is used for many small and big businesses. It is developed, marketed and supported by MySQL AB, a Swedish company.

     It is written in C and C++.

Reasons of popularity:-

    MySQL is becoming so popular because of these following reasons

 

  ->MySQL is an open-source database so you don't have to pay

         a single penny to use it.

     ->MySQL is a very powerful program so it can handle a large

         set of functionality of the most expensive and powerful

          database packages.

->MySQL is customizable because it is an open source database

 

->MySQL is quicker than other databases so it can work well even with the large data set.

 

->MySQL supports many operating systems with many languages like PHP, PYTHON, JAVA, etc.

 

->MySQL uses a standard form of the well-known SQL data language.

 

->MySQL is very friendly with PHP, the most popular language for web development.

->MySQL supports large databases, up to 50 million rows or more in a table.

->The default file size limit for a table is 4GB, but you can increase this (if your operating system can handle it) to a theoretical limit of 8 million terabytes (TB).

History of MySQL:-

  MySQL is an open source database product that was created by MySQL AB, a company founded in 1995 in Sweden.

 

    In 2008, MySQL AB announced that it had agreed to be acquired by Sun Microsystems for approximately $1 billion.

 

Initial Efforts

     The project of MySQL was started in 1979, when MySQL's inventor, Michael Widenius developed an in-house database tool called UNIREG for managing databases.

    After that UNIREG has been rewritten in several different languages and extended to handle big databases.

 

     After some time Michael Widenius contacted David Hughes, the author of mSQL, to see if Hughes would be interested in connecting mSQL to UNIREG's B+ ISAM handler to provide indexing to mSQL.

 

    That's the way MySQL came in existence.

 

   MySQL is named after the daughter of Michael Widenius whose name is "My".

Installation of MySql:-

  Download MySQL

Follow these steps:-

    Go to MySQL official website   http://www.mysql.com/downloads/

 

        Choose the version number for MySQL community server

         which you want.

 

MySql-Workbench-Interface

 

Verify MySQL installation:-

  Open your MySQL Command Line Client, it should be appeared with a mysql> prompt.

 

  If you have set any password, write your password here.

  Now,you are connected to the MySQL server and you can execute all the SQL command at mysql>

 

->IF You Want to See the Existing Databases

              Show Databases;

MySQL Create Database:-

  A database is a collection of data.

 

  MySQL allows us to store and retrieve the data from the database in a efficient way.

 

  In MySQL, we can create a database using the

     CREATE DATABASE statement.

 

    But, if database already exits, it throws an error.

    To avoid the error,   we can use the IF NOT EXISTS option with the CREATE DATABASE statement.

 

    You can create a MySQL database by using

    MySQL Command Line   Client.

 

  Open the MySQL console and write down password,

  if you set one while installation.

Syntax:-

  CREATE DATABASE database_name; 

Ex:-

  CREATE DATABASE College;

 

You can check the created database by the following query:

 

SHOW DATABASES;

MySQL SELECT Database:-

    SELECT Database is used in MySQL to select a particular database to work with.

     This query is used when multiple databases are available with MySQL Server.

 

     You can use SQL command USE to select a particular database.

Syntax:-

  USE database_name; 

Ex:-

    Use College;

To See The Active Database We Use this command

Select Database();

MySQL Drop Database:-

Syntax:

  DROP DATABASE database_name;  

Ex:-

  DROP DATABASE College;  

 

Now you can check that either your database is removed

by executing the following query

 

     SHOW DATABASES;  

MySQL Data Types:-

   A Data Type specifies a particular type of data, like integer, floating points, Boolean etc.

    It also identifies the possible values for that type,

    MySQL uses many different data types broken into three categories

 

Numeric

Date and Time

String Types.


Next