Creating a Database

Creating a Database

Creating a database can be difficult even though it is not supposed to be. Before you can start building your database, you need to know what a database is. A database is simple a collection of records.

It comes with different sizes depending on the user and the purpose. There are so many programs used to create a database. But for the purpose of this article we will discuss creating a database with MySQL.
MySQL is a popular database with Web developers. Its speed and small size make it ideal for a Web site. Add to that the fact that it’s free, it can run on many operating systems – Windows, Linux, Mac OS and It’s available on almost all Web hosts.

Before you start developing your database, you need to design your database structure.

You must identify what you want to be in your database or what you want to collect from your users.

For example it could be their names, address or you want to deliver information to them. After that, you need to organize your database. A database consists of rows and columns and where they meet is the field which contains the values.

Here are steps for organizing your database:

1. Name your database.

Give your database a name.

2. Identify the information you want in your database.

You must list the information that you want to store in the database.

3. Name a table for each item.

4. Identify the primary key.

The primary key is a unique identifier of a row in a table.

The primary key can be more than one column combined. For example, customer first name might not have a unique identifier because two customers can have the same name but the customer id can be the primary key.

After you have finished planning your database you need to follow these steps.

1. Download and install XAMPP
2. Open XAMPP start Apache and Mysql
3. Click on phpMyAdmin
4. Click on database
5. Enter the database name and click create
6. Enter the name of your table and the number of columns (based on your structure) and click Go.
7. Enter your object names and click save.

You have successfully created a database.

You can also create it online. You have to log into your cpanel account and click on phpMyAdmi. Follow the instructions from step 4

MySQL Data Type Description

CHAR Fixed-length character string.
VARCHAR Variable-length character string between 1 and 255.
TEXT Variable-length character string with a maximum length of 64K of text.
INT(length) Integer with a range from -2147483648 to +2147483647.
DATE Date value with year, month, and date. Displays the value as YYYY-MM-DD
DATETIME Date and time are stored together.