What is MySQL?
MySQL is a fast, easy-to-use RDBMS being used for
many small and big businesses. MySQL is developed, marketed and supported by
MySQL AB, which is a Swedish company. Its name is a combination of “My”, the name of co-founder Michael Widenius’s daughter,8 and “SQL”, the abbreviation for Structured Query Language.
provides data modeling, SQL development, and comprehensive administration tools
for server configuration, user administration, backup, and much more. MySQL
Workbench is available on Windows, Linux and Mac OS X. The
data in a MySQL database are stored in tables. A table is a collection of
related data, and it consists of columns and rows.
MySQL is released under an open-source
license. So you have nothing to pay to use it.
MySQL is a very powerful program in its
own right. It handles a large subset of the functionality of the most expensive
and powerful database packages.
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).
MySQL works on many operating systems
and with many languages including PHP, PERL, C, C++, JAVA, etc.
MySQL is customizable. The open-source
GPL license allows programmers to modify the MySQL software to fit their own
of the world’s largest and fastest-growing organizations including Facebook,
Google, Adobe, Alcatel Lucent and Zappos rely on MySQL to save time and money
powering their high-volume Web sites, business-critical systems and packaged
Offshoots of MySQL
MySQL are called forks. They include:
1. Drizzle – a
lightweight open source database management system in development based on
– a popular community-developed “drop-in” replacement for MySQL that
uses MySQL APIs and commands.
Server with XtraDB– an enhanced version of MySQL known for horizontal scalability.
MySQL Create Database
database is used to create database.
create database db1;
database is used to select database.
create query is used to create a table, view, procedure and function.
CREATE TABLE customers
PRIMARY KEY (id )
4) MySQL Alter Query
query is used to add, modify, delete or drop colums of a table. Let’s see a
query to add column in customers table:
ALTER TABLE customers
ADD age varchar(50);
insert query is used to insert records into table.
insert into customers values(101,’rahul’,’delhi’);
6) MySQL Update Query
update query is used to update records of a table.
update customers set name=’bob’, city=’london’ where id=101;
7) MySQL Delete Query
update query is used to delete records of a table from database.
delete from customers where id=101;
8) MySQL Select Query
select query is used to fetch records from database.
SELECT * from customers;
9) MySQL Truncate Table Query
update query is used to truncate or remove records of a table. It doesn’t
truncate table customers;