01/12/2014

What is Database?

| |
0 comments

What is Database?


A database is a separate application that stores a collection of data. Each database has one or more distinct APIs for creating, accessing, managing, searching and replicating the data it holds.

Other kinds of data stores can be used, such as files on the file system or large hash tables in memory but data fetching and writing would not be so fast and easy with those types of systems.

So nowadays, we use relational database management systems (RDBMS) to store and manage huge volume of data. This is called relational database because all the data is stored into different tables and relations are established using primary keys or other keys known as foreign keys.

A Relational DataBase Management System (RDBMS) is a software that:
  • Enables you to implement a database with tables, columns and indexes.
  • Guarantees the Referential Integrity between rows of various tables.
  • Updates the indexes automatically.
  • Interprets an SQL query and combines information from various tables.

RDBMS Terminology:

Before we proceed to explain MySQL database system, let's revise few definitions related to database.
  • Database: A database is a collection of tables, with related data.
  • Table: A table is a matrix with data. A table in a database looks like a simple spreadsheet.
  • Column: One column (data element) contains data of one and the same kind, for example the column postcode.
  • Row: A row (= tuple, entry or record) is a group of related data, for example the data of one subscription.
  • Redundancy: Storing data twice, redundantly to make the system faster.
  • Primary Key: A primary key is unique. A key value can not occur twice in one table. With a key, you can find at most one row.
  • Foreign Key: A foreign key is the linking pin between two tables.
  • Compound Key: A compound key (composite key) is a key that consists of multiple columns, because one column is not sufficiently unique.
  • Index: An index in a database resembles an index at the back of a book.
  • Referential Integrity: Referential Integrity makes sure that a foreign key value always points to an existing row.
MySQL Database:

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. MySQL is becoming so popular because of many good reasons:
  • 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 uses a standard form of the well-known SQL data language.
  • MySQL works on many operating systems and with many languages including PHP, PERL, C, C++, JAVA, etc.
  • MySQL works very quickly and works well even with large data sets.
  • MySQL is very friendly to PHP, the most appreciated 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).
  • MySQL is customizable. The open-source GPL license allows programmers to modify the MySQL software to fit their own specific environments.
Read More

MySQL Introduction

| |
0 comments

MySQL Introduction

MySQL is (as of July 2013) the world's most widely used open-source relational database management system (RDBMS), enabling the cost-effective delivery of reliable, high-performance and scalable Web-based and embedded database applications. It is widely-used as the database component of LAMP (Linux, Apache, MySQL, Perl/PHP/Python) web application software stack.

MySQL was developed by Michael Widenius and David Axmark in 1994. Presently MySQL is maintained by Oracle (formerly Sun, formerly MySQL AB).

MySQL tutorial of w3resource is a comprehensive tutorial to learn MySQL(5.6). We have hundreds of examples covered, often with PHP code. This helps you to learn how to create PHP-MySQL based web applications.

What is MySQL
  • MySQL is a database management system. 
  • MySQL databases are relational.
  • MySQL software is Open Source.
  • The MySQL Database Server is fast, reliable, scalable, and easy to use.
  • MySQL Server works in client/server or embedded systems.
  • Initial release : 23 May 1995Current stable release : 5.6.13 / 30 July 2013
  • Written in : C, C++
  • Operating system : Cross-platform
  • Available in : English
  • License of MySQL is available under GNU General Public License (version 2) or proprietary EULA.
  • MySQL reduces the Total Cost of Ownership (TCO)   
                     - Reducing database licensing costs by over 90%
                     - Cutting systems downtime by 60%
                     - Lowering hardware expenditure by 70%
                      -Reducing administration, engineering and support costs by up to 50% 

MySQL Editions

There are five types MySQL editions.
  • MySQL Enterprise Edition : This edition includes the most comprehensive set of advanced features, management tools and technical support to achieve the highest levels of MySQL scalability, security, reliability, and uptime. 
  • MySQL Standard Edition : This edition enables you to deliver high performance and scalable Online Transaction Processing (OLTP) applications. It provides the ease of use that has made MySQL famous along with industrial-strength performance and reliability.
  • MySQL Classic Edition : This edition is the ideal embedded database for ISVs, OEMs and VARs developing read-intensive applications using the MyISAM storage engine.
  • MySQL Cluster CGE : MySQL Cluster is a scalable, real-time, ACID-compliant database, combining 5 x 9s availability and open source technology. With a distributed, multi-master architecture and no single point of failure, MySQL Cluster scales horizontally on commodity hardware accessed via SQL and NoSQL APIs. 
  • MySQL Embedded (OEM/ISV) : MySQL Database is a full-featured, zero-administration database that more than 3000 ISVs, OEMs, and VARs rely on to bring their products to market faster and make them more competitive. 
 Who uses MySQL
  • Some of the most visited websites like Flickr, Facebook, Wikipedia, Google (not for search), YouTube. 
  • Content Management Systems like WordPress, phpBB, Drupal, Joomla, TYPO3, MODx.
  • Last but not least, a large number of web developers across the world.

MySQL supported platforms

MySQL runs on

    -Linux (RedHat, SUSE, Mandrake, Debian)
    -Embedded Linux (MontaVista, LynuxWorks BlueCat)
    -Unix (Solaris, HP-UX, AIX)
    -BSD (Mac OS X, FreeBSD)
    -Windows (Windows 2000, Windows NT)
    -RTOS (QNX)

MySQL supported third party tools

Drivers :

    -ODBC
    -JDBC
    -.NET
    -C++

Languages :

    C
    C++
    C#
    Java
    Delphi
    Visual Basic
    Perl
    Python
    PHP

Development Tools :

    Microsoft Visual Studio
    Borland Delphi and JBuilder
    Eclipse
    NetBeans
 
 Some of the widely used MySQL front ends (tools for managing MySQL)

The MySQL GUI Tools Bundle is a cross-platform open source suite of desktop applications, building and manipulating the data within MySQL databases Development on the GUI Tools bundle has stopped, The GUI Tools bundle has been replaced by MySQL Workbench with the beta releases of MySQL Workbench 5.2. Currently MySQL Workbench Team are working on Version 6.0. The first public beta, labeled version 6.0.2, was released on June 14, 2013.
There are lot of third-party free and proprietary graphical administration applications available that integrate with MySQL and users to work with database. Here are some third-party tools for managing

MySQL :

Tools                            Description
phpMyAdmin                Third party, Free, Web based
HeidiSQL                      Third party, Free, For Windows
Adminer                        Third party, Free
DBEdit                          Third party, Free
dbForge GUI Tools        Third party, Free
Navicat                          Third party, Commercial
Maatkit                           Third party, Command line, free
MySQL Sandbox           Third party, Command line, free
SQLBuddy                     A free Web-based front end, developed in PHP.
SQLyog                          Commercial, but a free 'community' edition is available.
Toad for MySQL            Third party, free from Quest Software

Key features of MySQL

    MySQL follows ANSI SQL 99, the standard SQL.
    Cross Platform.
    Unicode support
    ACID compliance
    Stored procedures
    Triggers
    Cursors
    Views
    Information schema
    Strict mode (ensures MySQL does not truncate or otherwise modify data to conform to an underlying data type, when an incompatible value is inserted into that type)
    Independent storage engines
    Transactions with the InnoDB and NDB Cluster storage engines; savepoints with InnoDB
    SSL support
    Query caching
    Sub-SELECTs (i.e. nested SELECTs)
    Replication support (i.e. Master-Master Replication & Master-Slave Replication) with one master per slave, many slaves per master
    Full-text indexing and searching using MyISAM engine
    Embedded database library
    Shared-nothing clustering through MySQL Cluster
    Support for hotbackup
    Multiple storage engines, allowing one to choose the one that is most effective for each table in the application
    Commit grouping, gathering multiple transactions from multiple connections together to increase the number of commits per second.

Key relational database features supported by MySQL

    High-performance
    Main-memory tables with disk-based tables
    Single-User and Multi-User
    Multi-Threaded
    Multi-Process
    SQL-92 and SQL-99
    ACID Transactions
    Referential Integrity
    Cascading Updates and Deletes
    Multi-table Joins
    Row-level Locking
    Online Hot Backup
    Replication
    Clustering
    BLOBs (Binary Large Objects)
    UDFs (User Defined Objects)
    OLTP (On-Line Transaction Processing)
    Unicode and Double-Byte character support
    Drivers for ODBC, JDBC, .NET and C++

Tutorial objectives

1. A short and concise description to help you to understand about the topic / MySQL command.

2. Syntax of the MySQL command with descriptions of all the parameters used.

3. Display of the actual table on which the MySQL command is being applied.

4. How that MySQL command can be executed with PHP.

5. Explanation of the code.

6. Output of the MySQL command when executed form windows command prompt.

7. Display of the output with PHP in a separate browser window.

8. After reading this largest third party online MySQL tutorial by w3resource, you will be able to install, manage and develop PHP-MySQL web applications by your own.

9. You may refer MySQL Documentation along with this tutorial.

We have a comprehensive, SQL TUTORIAL -2003 standard , which will help you to understand how to prepare queries to fetch data against various conditions.
MySQL :
Tools Description
phpMyAdmin Third party, Free, Web based
HeidiSQL Third party, Free, For Windows
Adminer Third party, Free
DBEdit Third party, Free
dbForge GUI Tools Third party, Free
Navicat Third party, Commercial
Maatkit Third party, Command line, free
MySQL Sandbox Third party, Command line, free
SQLBuddy A free Web-based front end, developed in PHP.
SQLyog Commercial, but a free 'community' edition is available.
Toad for MySQL Third party, free from Quest Software
- See more at: http://www.w3resource.com/mysql/mysql-tutorials.php#sthash.hzaVFuZW.dpuf
MySQL :
Tools Description
phpMyAdmin Third party, Free, Web based
HeidiSQL Third party, Free, For Windows
Adminer Third party, Free
DBEdit Third party, Free
dbForge GUI Tools Third party, Free
Navicat Third party, Commercial
Maatkit Third party, Command line, free
MySQL Sandbox Third party, Command line, free
SQLBuddy A free Web-based front end, developed in PHP.
SQLyog Commercial, but a free 'community' edition is available.
Toad for MySQL Third party, free from Quest Software
- See more at: http://www.w3resource.com/mysql/mysql-tutorials.php#sthash.hzaVFuZW.dpuf
MySQL :
Tools Description
phpMyAdmin Third party, Free, Web based
HeidiSQL Third party, Free, For Windows
Adminer Third party, Free
DBEdit Third party, Free
dbForge GUI Tools Third party, Free
Navicat Third party, Commercial
Maatkit Third party, Command line, free
MySQL Sandbox Third party, Command line, free
SQLBuddy A free Web-based front end, developed in PHP.
SQLyog Commercial, but a free 'community' edition is available.
Toad for MySQL Third party, free from Quest Software
- See more at: http://www.w3resource.com/mysql/mysql-tutorials.php#sthash.hzaVFuZW.dpuf
Read More

Check Your Codes

Check the result of your (sample) HTML,CSS,JavaScript code.