Home arrow MySQL arrow Page 4 - Designing a MySQL Database: Tips and Techniques

Inputting the specifications into MySQL using phpMyAdmin - MySQL

You are planning to develop a PHP web application that needs a MySQL database. Now what? You need to design your MySQL database first. Need a little help? Keep reading.

TABLE OF CONTENTS:
  1. Designing a MySQL Database: Tips and Techniques
  2. Naming the Database, Tables, Field names and Data Types
  3. Finalization of Database Design Specifications
  4. Inputting the specifications into MySQL using phpMyAdmin
By: Codex-M
Rating: starstarstarstarstar / 19
July 13, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

We will now input these specifications into the MySQL environment using the phpMyAdmin graphical interface. Follow these short steps:

Step 1: Log in to phpMyAdmin using your MySQL username and password.

Step 2: Click the "database" link, and in the "Create new database" section enter customercomplaint.

Step 3: On the "Create new table on database customercomplaint," section, enter "customertable" and in the number of fields, enter 6. Click "go."

Use the design specifications to configure the variables in the database. See the screen shot below for a complete guide:

Do not forget to check "Current_Timestamp" under the Default column in receivingdate field. "Unsigned" means it will accept only positive values, which can be set under "Attributes". "Zero Fill" means it will insert zeroes for spaces if the number of digits entered is less than five. 

For example, if the product serial key is 456, MySQL will store it as "00456."

The detailed MySQL query for creating the designed table is as follows:

CREATE TABLE `customercomplaint`.`customertable` (

`customername` VARCHAR( 64 ) NOT NULL ,`price` DECIMAL( 7, 3 ) UNSIGNED NOT NULL ,`datepurchased` DATE NOT NULL ,`productkey` SMALLINT( 5 ) UNSIGNED ZEROFILL NOT NULL ,`complaintdetails` TEXT NOT NULL ,`receivingdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP

) ENGINE = MYISAM

After everything is set, click "Save." You can now start inserting data into your newly-designed database. You will notice it will only accept data according to your specifications and display errors for those are not within the design.



 
 
>>> More MySQL Articles          >>> More By Codex-M
 

blog comments powered by Disqus
   

MYSQL ARTICLES

- Xeround Releases Free Version of MySQL Cloud...
- Oracle Announces New MySQL Specialization
- Constant Contact Chooses SkySQL for MySQL Su...
- Revoke Statement in MySQL
- The Grant Statement in MySQL
- SuccessBricks Announces ClearDB Availability...
- Building a PHP ORM: Deploying a Blog
- TROSYS Launches Free MySQL Manager and Admin...
- Building an ORM in PHP: Domain Modeling
- Building an ORM in PHP
- MySQL Leads Open Source Market, Gets Cluster...
- Oracle Announces Milestone Release for MySQL
- How to Stop SQL Injection Attacks
- New Defragmentation Solution for SQL Server
- Comparison of MyISAM and InnoDB MySQL Databa...


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap

Dev Shed Tutorial Topics: