Curfew and Travel Pass Information System Database Design

Curfew and Travel Pass Information System Database Design

The capstone project entitled curfew and travel pass information system is an online platform with responsive web design feature that can adapt to the resolution of the device. It is an information system that manages the curfew and travel pass requirements and transactions. With this project, it will be a lot easier to secure a pass or permit to travel. The said application will be beneficial to the commuters, travelers and essential workers in this time of pandemic. This project will also be a great help to the border checkpoints to validate and check the information of the commuters, travelers and essential workers.

This article will provide you with the list of tables and field/columns for every table in the design of database structure/schema of curfew and travel pass information system. The team will later provide a video tutorial on how to create the database in PHPMyAdmin.

Curfew and Travel Pass Information System Database Design - List of Tables
Curfew and Travel Pass Information System Database Design – List of Tables

This database design has 6 tables with their respective fields and columns as well as their relationships among each other.

tblperson – this table will store the information of the person who wants to be included in the curfew pass information system, the table has 17 columns.

  • person_id – primary key of the table. It is set usually to auto_increment (the database will automatically give this column a value starting from 1).
  • person_code – a unique code given to the person (qr code, barcode, etc)
  • avatar – this will hold the profile image of the person.
  • client_name – full name of the client/customer.
  • email_address – email address of the client/customer.
  • contact_number – contact number of the client/customer, preferably mobile or cellphone number.
  • complete_address – complete address of the client/customer.
  • company_id – the company or organization of the person he/she works for, this is a foreign key that links to the tblcompany.
  • primary_id – primary identification card by the person, foreign key that links to the tblidentificationcardtype.
  • secondary_id – secondary identification card by the person, foreign key that links to the tblidentificationcardtype.
  • emergency_contact_person – the person who will be contacted for emergency purposes.
  • emergency_contact_number – the number of the contact person.
  • relationship_to_the_person – relationship to the contact person.
  • username – the desired username of the client/customer.
  • password – the desired password of the client/customer.
  • status – the value of this column is 0 or 1, 0 means deactivated or inactive, 1 is activated or active.
  • user_id – the user who accepts/approve/deactivate the person profile and registration. It is a foreign key that connects to the user table.

Create SQL Statement – the statement below is used to create the tblperson, copy the sql statement and paste it in the sql manager/tab of your phpmyadmin.

CREATE TABLE `tblperson` (
`person_id` int(11) NOT NULL,
`person_code` varchar(30) NOT NULL,
`avatar` blob NOT NULL,
`client_name` varchar(30) NOT NULL,
`email_address` varchar(30) NOT NULL,
`contact_number` varchar(15) NOT NULL,
`complete_address` varchar(100) NOT NULL,
`company_id` int(11) NOT NULL,
`primary_id` int(11) NOT NULL,
`secondary_id` int(11) NOT NULL,
`emergency_contact_person` varchar(30) NOT NULL,
`emergency_contact_number` varchar(15) NOT NULL,
`relationship_to_the_person` varchar(15) NOT NULL,
`username` varchar(30) NOT NULL,
`password` varchar(30) NOT NULL,
`status` int(1) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

tblcompany – this table will store the list of companies registered in the system. The table has 7 columns.

  • company_id – primary key of the table. It is set usually to auto_increment (the database will automatically give this column a value starting from 1).
  • company_name – the complete name of the company.
  • company_contact_person – contact person of the company
  • company_email – official email address of the company
  • company_contact_number – contact information of the company (landline, mobile, etc)
  • company_website – official website of the company (if any)
  • user_id – the user who accepts/approve/deactivate the company profile. It is a foreign key that connects to the user table.

Create SQL Statement – the statement below is used to create the tblcompany, copy the sql statement and paste it in the sql manager/tab of your phpmyadmin.

CREATE TABLE `tblcompany` (
`company_id` int(11) NOT NULL,
`company_name` varchar(50) NOT NULL,
`company_contact_person` varchar(30) NOT NULL,
`company_email` varchar(30) NOT NULL,
`company_contact_number` varchar(15) NOT NULL,
`company_website` varchar(30) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

tblidentificationcardtype –  this is the table where the list of valid identification card or documents are encoded in the system. These are the documents necessary to present by the person in the checkpoint area.

  • card_type_id – primary key of the table. It is set usually to auto_increment (the database will automatically give this column a value starting from 1).
  • card_category_name – the name of the card or document.
  • card_description – card description.
  • card_type – 0 for primary and 1 for secondary
  • user_id – the user who encodes/updates the type of card allowed by the system. It is a foreign key that connects to the user table.

Create SQL Statement – the statement below is used to create the tblidentificationcardtype, copy the sql statement and paste it in the sql manager/tab of your phpmyadmin.

CREATE TABLE `tblidentificationcardtype` (
`card_type_id` int(11) NOT NULL,
`card_category_name` varchar(30) NOT NULL,
`card_description` varchar(100) NOT NULL,
`card_type` int(1) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

tblrequestpass – this is the table where the request to travel are stored and processed.

  • request_pass_id – primary key of the table. It is set usually to auto_increment (the database will automatically give this column a value starting from 1).
  • person_id – the person who request for a pass.
  • passcode – this is in a form of a qr code or barcode or unique alpha numeric combination.
  • pass_type – this refers to 0 for essential pass, 1 medical pass, 2 others.
  • date_of_request – date of request.
  • date_of_validity – the expiration date of the pass.
  • remarks – additional information of the pass.
  • status – 0 for approved, 1 for disapproved
  • approved_by – the user who processed the transaction

Create SQL Statement – the statement below is used to create the tblrequestpass, copy the sql statement and paste it in the sql manager/tab of your phpmyadmin.

CREATE TABLE `tblrequestpass` (
`request_pass_id` int(11) NOT NULL,
`person_id` int(11) NOT NULL,
`passcode` varchar(30) NOT NULL,
`pass_type` int(1) NOT NULL,
`date_of_request` date NOT NULL,
`date_of_validity` date NOT NULL,
`remarks` varchar(50) NOT NULL,
`status` int(1) NOT NULL,
`approved_by` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

tbluser – this table will store the information of personnel who can access the records of the system.

  • user_id – primary key of the table. It is set usually to auto_increment (the database will automatically give this column a value starting from 1).
  • username – username of the personnel used to login together with the password.
  • password – password of the personnel used to login together with the username.
  • avatar – this will hold the profile image of the user.
  • fullname – the complete name of the personnel or user.
  • contact – contact number of the personnel (mobile/cellphone number).
  • email – email address of the personnel/user.
  • user_category_id – the user group or category of the user.
  • status – the value of this column is 0 or 1, 0 means deactivated or inactive, 1 is activated or active.

Create SQL Statement – the statement below is used to create the tbluser, copy the sql statement and paste it in the sql manager/tab of your phpmyadmin.

CREATE TABLE `tbluser` (
`user_id` int(11) NOT NULL,
`username` varchar(30) NOT NULL,
`password` varchar(30) NOT NULL,
`avatar` blob NOT NULL,
`fullname` varchar(50) NOT NULL,
`contact` varchar(15) NOT NULL,
`email` varchar(30) NOT NULL,
`user_category_id` int(1) NOT NULL,
`status` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

tblusergroup – this table store the information of the user group which includes the functions they can and can’t access in the system.

  • user_group_id – primary key of the table. It is set usually to auto_increment (the database will automatically give this column a value starting from 1).
  • group_name – name of the category or user group.
  • description – information on what the user group is all about.
  • allow_add – this column is to allow or prevent user from adding a record.
  • allow_edit – this column is to allow or prevent user from editing or updating a record.
  • allow_delete – this column is to allow or prevent user from removing or deleting a record.
  • allow_print – this column is to allow or prevent user from printing a report.
  • allow_import – this column is to allow or prevent user from importing records to the system.
  • allow_export – this column is to allow or prevent user from exporting records from the system.

Create SQL Statement – the statement below is used to create the tblusergroup, copy the sql statement and paste it in the sql manager/tab of your phpmyadmin.

CREATE TABLE `tblusergroup` (
`user_group_id` int(11) NOT NULL,
`group_name` varchar(30) NOT NULL,
`description` varchar(50) NOT NULL,
`allow_add` int(1) NOT NULL,
`allow_edit` int(1) NOT NULL,
`allow_delete` int(1) NOT NULL,
`allow_print` int(1) NOT NULL,
`allow_import` int(1) NOT NULL,
`allow_export` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Indexes for dumped tables
--
-- Indexes for table `tblcompany`
--
ALTER TABLE `tblcompany`
ADD PRIMARY KEY (`company_id`),
ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `tblidentificationcardtype`
--
ALTER TABLE `tblidentificationcardtype`
ADD PRIMARY KEY (`card_type_id`),
ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `tblperson`
--
ALTER TABLE `tblperson`
ADD PRIMARY KEY (`person_id`),
ADD KEY `company_id` (`company_id`),
ADD KEY `primary_id` (`primary_id`),
ADD KEY `secondary_id` (`secondary_id`),
ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `tblrequestpass`
--
ALTER TABLE `tblrequestpass`
ADD PRIMARY KEY (`request_pass_id`),
ADD KEY `person_id` (`person_id`),
ADD KEY `approved_by` (`approved_by`);

--
-- Indexes for table `tbluser`
--
ALTER TABLE `tbluser`
ADD PRIMARY KEY (`user_id`),
ADD KEY `user_category_id` (`user_category_id`);

--
-- Indexes for table `tblusergroup`
--
ALTER TABLE `tblusergroup`
ADD PRIMARY KEY (`user_group_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `tblcompany`
--
ALTER TABLE `tblcompany`
MODIFY `company_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tblidentificationcardtype`
--
ALTER TABLE `tblidentificationcardtype`
MODIFY `card_type_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tblperson`
--
ALTER TABLE `tblperson`
MODIFY `person_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tblrequestpass`
--
ALTER TABLE `tblrequestpass`
MODIFY `request_pass_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tbluser`
--
ALTER TABLE `tbluser`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tblusergroup`
--
ALTER TABLE `tblusergroup`
MODIFY `user_group_id` int(11) NOT NULL AUTO_INCREMENT;

Constraints for dumped tables

--
-- Constraints for table `tblcompany`
--
ALTER TABLE `tblcompany`
ADD CONSTRAINT `tblcompany_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tblidentificationcardtype`
--
ALTER TABLE `tblidentificationcardtype`
ADD CONSTRAINT `tblidentificationcardtype_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tblperson`
--
ALTER TABLE `tblperson`
ADD CONSTRAINT `tblperson_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `tblperson_ibfk_2` FOREIGN KEY (`company_id`) REFERENCES `tblcompany` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `tblperson_ibfk_3` FOREIGN KEY (`primary_id`) REFERENCES `tblidentificationcardtype` (`card_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `tblperson_ibfk_4` FOREIGN KEY (`secondary_id`) REFERENCES `tblidentificationcardtype` (`card_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tblrequestpass`
--
ALTER TABLE `tblrequestpass`
ADD CONSTRAINT `tblrequestpass_ibfk_1` FOREIGN KEY (`approved_by`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `tblrequestpass_ibfk_2` FOREIGN KEY (`person_id`) REFERENCES `tblperson` (`person_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `tbluser`
--
ALTER TABLE `tbluser`
ADD CONSTRAINT `tbluser_ibfk_1` FOREIGN KEY (`user_category_id`) REFERENCES `tblusergroup` (`user_group_id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
Curfew and Travel Pass Information System Database Design
Curfew and Travel Pass Information System Database Design

Free Download .sql file

Our team can modify the project based on your specific business requirements.

You may visit our facebook page for more information, inquiries and comments.

Hire our team to do the project.

Comments

comments

, , ,

Post navigation