Saturday, January 26, 2013

Introduction To MySQL

Probably MySQL is the most widely used database today, especially for web-development. Most people choose not thinking its best , but looks it as a package of LAMP(Linux Apache MySQL Php). I am here going to make an attempt to make attempt to help newbies to introduce to MySQL. But if you have time in your hand and to learn it all there is best tutorial available at http://dev.mysql.com/doc/refman/5.1/en/

So, what's MySQL?
MySQL is an RDBMS - Relational Database Management System. What is RDBMS will be the next question. It means nothing huge,  except for the data is saved in single row in a linear format(no tree structure or other complex data structures saved in single cell/column). 

Key Concepts MySQL
We will consider how to save whole data for a school. So lets consider we are running a school and we have many students, faculty, subjects, school events, exam schedules and so on.

Tables:
Each entity can be considers as an table, like students, faculty, subjects etc. A table contains some information about one or more entities. For instance, a student table will student id, student name, date of birth, class he belongs to and so on. 

Rows and Columns:
In a table, we can consider its holding a two-dimensional data. Just like you class register, there is a row for each student and a column for each day to mark the attendance. Same is true about a database table, each row in the table represent and unique entity and each column hold a value of a particular attribute of the entity.

"id" Column:
The id columns is not a universal standard, but most MySQL developers maintain a column named id in tables. The idea is to uniquely identify any row in a table. Just like each student has a unique enrollment id among all students.

Database:
Probably this is what I should have mentioned first, but for the sake of priority, I am putting it below. In a database server, we can have different databases. Its nothing but used to group the related tables. In a school, you can think of databases like academic, exams, events etc. Each database can have tables below it.

(These are just the basics, we have functions, stored procedures, viewes, indexes etc, which will never be requied on you day one)





No comments:

Post a Comment