ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

02-Creating Database and Setting Up tables

Now, I’m going to start this tutorial on how to create a database and set up the tables that are needed. You have to install XAMMP in your computer. After that, open the browser and type the “localhos/phpmyadmin/” in the navigation panel and press enter on the keyboard in your computer to redirect into the MySQL Localhost. Create a database and name it “dbinformation”. Then, do this query for creating all the tables.

 

 

For the employees table

  1. CREATE TABLE IF NOT EXISTS `employees` (
  2. `EMPLOYEE_ID` int(11) NOT NULL,
  3. `FIRST_NAME` varchar(255) DEFAULT NULL,
  4. `LAST_NAME` varchar(255) DEFAULT NULL,
  5. `MIDDLE_NAME` varchar(255) DEFAULT NULL,
  6. `ADDRESS` varchar(255) DEFAULT NULL,
  7. `PHONE_NUMBER` varchar(255) DEFAULT NULL,
  8. `STATUS` varchar(255) DEFAULT NULL,
  9. `BIRTH_DATE` datetime DEFAULT NULL,
  10. `BIRTH_PLACE` varchar(255) DEFAULT NULL,
  11. `GENDER` varchar(255) DEFAULT NULL,
  12. `AGE` int(11) DEFAULT NULL,
  13. `EMERG_CONTACT` varchar(255) DEFAULT NULL,
  14. PRIMARY KEY (`ID`),
  15. KEY (`EMPLOYEE_ID`)
  16. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

For the employees work information table

  1. CREATE TABLE IF NOT EXISTS `employeesworkinfo` (
  2. `EMPLOYEE_ID` varchar(255) NOT NULL,
  3. `D_RATE` varchar(255) DEFAULT NULL,
  4. `POSITION` varchar(90) DEFAULT NULL,
  5. `P_METHOD` varchar(255) DEFAULT NULL,
  6. `W_STATUS` varchar(255) DEFAULT NULL,
  7. `D_HIRED` datetime DEFAULT NULL,
  8. PRIMARY KEY (`ID`),
  9. KEY (`EMPLOYEE_ID`)
  10. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

For the users table

  1. CREATE TABLE IF NOT EXISTS `USERACCOUNTS` (
  2. `USER_ID` varchar(255) NOT NULL,
  3. `UNAME` varchar(255) DEFAULT NULL,
  4. `USERNAME` varchar(255) DEFAULT NULL,
  5. `PASS` varchar(255) DEFAULT NULL,
  6. `TYPE` varchar(30) DEFAULT NULL,
  7. PRIMARY KEY (`ID`),
  8. KEY (`USER_ID`)
  9. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Facebook Comments

Check Your Domain Ranking

Leave a Reply

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

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!