create database in mysql

Create Database in MySQL

Last PHP tutorial we learnt how to open and run MySQL server from wampserver.
Now, in this PHP tutorial we will learn to create new database in MySQL. The database is a collection of information.
A Database contains many tables. Each table consist  rows and columns. A table contains a information.

Now, Open MySQL using http://localhost/phpmyadmin/ link in browser.

CREATE DATABASE Statement

The CREATE DATABASE statement is used to create a new database in MySQL.

Syntax :

CREATE DATABASE databaseName;

 

After run MySQL now create a new database in MySQL, and then after create new tables in newly created database.
Below screen shows how to create a new database in MySQL Server. Write database name and click go button to create new database in system.

mysql

Create New Database in MySQL wmap


Create Table in MySQL

Now, after creating a new database, create new table in database like below.While creating a table we need to assign columns name and data type and length for  each columns. A table has many columns as per table requirements. Each column has valid data type and length.

mysql

Create New Table in MySQL wamp

In above figure write Table name and click go button to create a new table in database. When we click go button you have below screen which specify the columns name, type and length… while creating a table we need to create columns with name, data types and length attributes

sqlcreatenewtable

Create Table in MySQL wamp

In above figure we create columns ID, Name, Address and City in table “StudentMst” in “School” Database. All above columns assign with proper datatypes and length, The ID columns has INT datatypes while other all have VARCHAR datatypes.

Here is video php tutorial for create new database in MySQL using wamp server.

Leave a Reply

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

4 + 3 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">