Module 1: Creating Database in MySQL
Getting Started with MySQL Database
a. Open XAMPP Control Panel and run Apache and MySQL Services;
b. Open your browser and type in the URL the following: localhost/xampp
c. In the tools menu, click phpMyAdmin
Note: If you are using 5.6.3 version, the same environment should be seen in your browser.
d. To create a database, click the new command:
PHP with MySQL Modules prepared by SHERWIN M. CAACBAY 1|Page
e. Set the name of your database to dbSIS as shown in the figure:
f. Click the create button, once the database has been created successfully, open the
database and create the following tables:
Table Name Field Name Data Type Remarks
Students ID int (11) Primary Key/ Auto increment
StudentNo varchar(20)
LastName varchar(50)
FirstName varchar(50)
MiddleName varchar (50)
DepartmentID int (11)
CourseID int (11)
Courses ID int (11) Primary Key/ Auto increment
Code varchar (20)
Description varchar (50)
DepartmentID int (11)
Departments ID int (11) Primary Key/ Auto increment
Code varchar (20)
Description varchar (50)
Users ID int (11) Primary Key/ Auto increment
Username varchar (50)
Password varchar (50)
AccessLevel varchar (50)
PHP with MySQL Modules prepared by SHERWIN M. CAACBAY 2|Page
Note: Refer to the screenshot below on how to set the primary key and auto increment of a
certain field.
PHP with MySQL Modules prepared by SHERWIN M. CAACBAY 3|Page
g. After creating the following tables, insert the following records as shown in the figure:
For courses table:
For departments table:
For students table:
For users table:
Note: students, departments and courses table needs to establish a relationship because
the three (3) tables are mutually dependent to each other. To create a relation between
courses and departments tables and students, courses and departments tables please refer
to the next modules.
PHP with MySQL Modules prepared by SHERWIN M. CAACBAY 4|Page