MySQL Introduction

There are a large number of database management systems currently available, some commercial and some free.

Some of them : Oracle, Microsoft Access, Mysql and PostgreSQL.

These database systems are powerful, feature-rich software, capable of organizing and searching millions of records at very high speeds.

Understanding Databases, Records, and Primary Keys

Every Database is composed of one or more tables.

These Tables, which structure data into rows and columns, Impose organization on the data.

The records in a table(below) are not arranged in any particular order.

To make it easy to identify a specific record,therefore, it becomes necessary

BookId BookName Price($)
1 The Shining 250
2 Shutter Island 300
3 The Overlook 180
4 Safe Harbour 200
5 Trunk Music 300

to add a unique identifying attribute to each record, such as a serial number or sequence code.
In the preceding example, each record is identified by a unique “record ID” field;
this field is referred to as the Primary key for the table.

Understanding Relationships and Foreign Keys(RDBMS)

You already know that a single database can hold multiple tables.
In a Relational database management system(RDBMS), these tables can be linked to each other by one or more common fields, called foreign keys.

These foreign keys make it possible to create one-to-one or one-to-many relationships between different tables, and combine data from multiple tables.

GenreId GenreName
1 Horror
2 Crime
3 Romance
AuthorID AuthorName
1 Stephen King
2 Danielle Steele
3 Dennies Lehane
4 Michael Connelly
5 Nora Roberts
BookId BookName GenerID AuthorID
1 The Shining 1 1
2 Shutter Island 2 3
3 The Overlook 1 1
4 Safe Harbour 1 4
5 Trunk Music 3 2
6 Sisters 3 2
7 Blodd Broters 1 4
8 Pet Sematary 3 5

What is Database administrator(DBA) ?

Database administrator is the super user of database, he has unrestricted rights and privileges to access database, grant permission to other database users.

What is Database user(DBU) ?

Database user is the person who uses the database in a restricted privileges, provided by database administrator.

Download MySQL Database

If you have installed PHP’s WAMP or XAMPP server, then mysql database already exists. if you don’t have then download mysql database from here


  • Faizan August 23, 2014 at 5:06 pm Reply

    How to insert data from textarea to database?

    • sangita machhi July 11, 2015 at 5:30 am Reply

      Hello..I m sangita ..I wanna give online test but I can’t choose the category .please answer.

  • Narayan September 22, 2014 at 5:44 am Reply

    please post the small $ sample projects with database.

  • Narayan September 22, 2014 at 9:28 am Reply

    all post are very good. u have done great worke.
    please post login,registration and insert,update & delete in PHP with separate database.

  • sangita machhi July 11, 2015 at 5:32 am Reply

    Hello.. I m sangita from Surat Gujarat. I wanna give online test.. But I can’t choose the category. Plz Answer ..

    • Sanjeev Rai July 11, 2015 at 12:21 pm Reply

      Hi Sangita, Let me check and update the question

  • sachn August 4, 2015 at 8:43 am Reply

    why we use css properties autocomplete:off;

    • Sanjeev Rai August 4, 2015 at 11:54 am Reply

      Autocomplete allows the browser to predict the value. When a
      user starts to type in a field, the browser should display options to fill in
      the field, based on earlier typed values.


  • Neeraj Kumar January 25, 2016 at 6:36 am Reply

    sanjeev sir i have a query to ask…. let us suppose we have 2 tables in a database…(1.district and 2.regions) district table consist of two fields i.e district code and district name, similarly regions table has 2 fields i.e. region code and region name…. i want to map the regions with the relevant district… in the html i have 2 dropdowns and i am fetching there the names of the district and regions in the dropdowns from the database…. but at the back end i want to save the district and region codes which are integers associated with those names which are selected by the user at the interface a different table. so the user can select the district and region on the page and at the backend the table should be populated with the corresponding codes… waiting for your reply…

  • Tauras Neeraj February 1, 2016 at 10:24 am Reply

    sir how to insert the multiple select values into data base???? m facing problem in this… insert query only inserting only a single value from sthose selected options…. i want to insert all the selected items in the database…

  • Cheru Passah July 22, 2016 at 6:29 pm Reply

    sir how to decrypt the selected column using aes_encryption and decryption? would be helpful if you help tq

    • Sanjeev Rai July 23, 2016 at 6:17 am Reply

      try aes_decrypt()

      Why u want to descrpt ? for login page?

Leave a Reply

Your email address will not be published. Required fields are marked *