Repair Shop Management System Database Design

Repair Shop Management System Database Design

The project repair shop management system is an online platform intended to cater the transactions between the shop owner, technician and customers/clients. The design of this project can be used by computer repair shop, cellphone repair shop, car/auto repair shop and many more.

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

Repair Shop Management System Database Design - List of Tables

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

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 IF NOT EXISTS `tbluser` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `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, PRIMARY KEY (`user_id`), KEY `user_category_id` (`user_category_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblusergroup – this table store the information of the user group which includes the functions they can and can’t access in 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 IF NOT EXISTS `tblusergroup` ( `user_group_id` int(11) NOT NULL AUTO_INCREMENT, `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, PRIMARY KEY (`user_group_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblclient – this table will store the information of the customer/clients, the table has 9 columns.

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

CREATE TABLE IF NOT EXISTS `tblclient` ( `client_id` int(11) NOT NULL AUTO_INCREMENT, `client_code` varchar(15) 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, `username` varchar(30) NOT NULL, `password` varchar(30) NOT NULL, `status` int(1) NOT NULL, PRIMARY KEY (`client_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblservices – list of services offered by the shop will be stored and managed in this table.

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

CREATE TABLE IF NOT EXISTS `tblservices` ( `service_id` int(11) NOT NULL AUTO_INCREMENT, `service_name` varchar(30) NOT NULL, `description` varchar(50) NOT NULL, `amount` float NOT NULL, `encoded_by` int(11) NOT NULL, PRIMARY KEY (`service_id`), KEY `encoded_by` (`encoded_by`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblitem – list of items, materials, tools and products of the shop will be encoded and stored in this table.

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

CREATE TABLE IF NOT EXISTS `tblitem` ( `item_id` int(11) NOT NULL AUTO_INCREMENT, `item_name` varchar(30) NOT NULL, `item_category_id` int(11) NOT NULL, `image` blob NOT NULL, `description` varchar(50) NOT NULL, `serial_no` varchar(30) NOT NULL, `amount` float NOT NULL, `encoded_by` int(11) NOT NULL, PRIMARY KEY (`item_id`), KEY `item_category_id` (`item_category_id`,`encoded_by`), KEY `encoded_by` (`encoded_by`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblitemcategory – items are grouped according to their purpose. This table has two columns.

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

CREATE TABLE IF NOT EXISTS `tblitemcategory` ( `item_category_id` int(11) NOT NULL AUTO_INCREMENT, `category_name` varchar(30) NOT NULL, PRIMARY KEY (`item_category_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tbltechnician – information of the technician and repair man will be encoded and stored in this table. The table consists of 11 columns.

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

CREATE TABLE IF NOT EXISTS `tbltechnician` ( `technician_id` int(11) NOT NULL AUTO_INCREMENT, `technician_code` varchar(15) NOT NULL, `avatar` blob NOT NULL, `technician_name` varchar(30) NOT NULL, `technician_email` varchar(30) NOT NULL, `techinician_contact` varchar(15) NOT NULL, `specialization_details` varchar(100) NOT NULL, `technician_username` varchar(30) NOT NULL, `technician_password` varchar(30) NOT NULL, `status` int(1) NOT NULL, `encoded_by` int(11) NOT NULL, PRIMARY KEY (`technician_id`), KEY `encoded_by` (`encoded_by`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblworkorder – work request of the customers will be stored and processed on this table and it has 10 entities/fields.

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

CREATE TABLE IF NOT EXISTS `tblworkorder` ( `work_order_id` int(11) NOT NULL AUTO_INCREMENT, `request_date` date NOT NULL, `service_id` int(11) NOT NULL, `amount` float NOT NULL, `customer_id` int(11) NOT NULL, `technician_id` int(11) NOT NULL, `estimate_date_of_completion` date NOT NULL, `status` int(1) NOT NULL, `remarks` varchar(100) NOT NULL, `processed_by` int(11) NOT NULL, PRIMARY KEY (`work_order_id`), KEY `service_id` (`service_id`,`customer_id`,`technician_id`,`processed_by`), KEY `processed_by` (`processed_by`), KEY `customer_id` (`customer_id`), KEY `technician_id` (`technician_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblworkorderdetails

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

CREATE TABLE IF NOT EXISTS `tblworkorderdetails` ( `work_order_detail_id` int(11) NOT NULL AUTO_INCREMENT, `work_order_id` int(11) NOT NULL, `item_id` int(11) NOT NULL, `quantity` int(5) NOT NULL, `amount` float NOT NULL, `total` float NOT NULL, PRIMARY KEY (`work_order_detail_id`), KEY `work_order_id` (`work_order_id`,`item_id`), KEY `item_id` (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblpayment

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

CREATE TABLE IF NOT EXISTS `tblpayment` ( `payment_id` int(11) NOT NULL AUTO_INCREMENT, `or_no` varchar(15) NOT NULL, `work_order_id` int(11) NOT NULL, `total_amount` float NOT NULL, `is_paid` int(1) NOT NULL, `date_of_payment` date NOT NULL, `paid_by` varchar(50) NOT NULL, `remarks` varchar(50) NOT NULL, `processed_by` int(11) NOT NULL, PRIMARY KEY (`payment_id`), KEY `work_order_id` (`work_order_id`,`processed_by`), KEY `processed_by` (`processed_by`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

tblshopinfo

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

CREATE TABLE IF NOT EXISTS `tblshopinfo` ( `shop_id` int(11) NOT NULL AUTO_INCREMENT, `shop_name` varchar(50) NOT NULL, `owner_name` varchar(30) NOT NULL, `address` varchar(100) NOT NULL, `email_address` varchar(30) NOT NULL, `contact_no` varchar(15) NOT NULL, `website` varchar(30) NOT NULL, `updated_by` int(11) NOT NULL, PRIMARY KEY (`shop_id`), KEY `updated_by` (`updated_by`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Repair Shop Management System Database Design

Repair Shop Management System Database Design

Constraints for dumped tables -- -- Constraints for table `tblitem` -- ALTER TABLE `tblitem` ADD CONSTRAINT `tblitem_ibfk_2` FOREIGN KEY (`item_category_id`) REFERENCES `tblitemcategory` (`item_category_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `tblitem_ibfk_1` FOREIGN KEY (`encoded_by`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `tblpayment` -- ALTER TABLE `tblpayment` ADD CONSTRAINT `tblpayment_ibfk_2` FOREIGN KEY (`work_order_id`) REFERENCES `tblworkorder` (`work_order_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `tblpayment_ibfk_1` FOREIGN KEY (`processed_by`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `tblservices` -- ALTER TABLE `tblservices` ADD CONSTRAINT `tblservices_ibfk_1` FOREIGN KEY (`encoded_by`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `tblshopinfo` -- ALTER TABLE `tblshopinfo` ADD CONSTRAINT `tblshopinfo_ibfk_1` FOREIGN KEY (`updated_by`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `tbltechnician` -- ALTER TABLE `tbltechnician` ADD CONSTRAINT `tbltechnician_ibfk_1` FOREIGN KEY (`encoded_by`) REFERENCES `tbluser` (`user_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; -- -- Constraints for table `tblworkorder` -- ALTER TABLE `tblworkorder` ADD CONSTRAINT `tblworkorder_ibfk_4` FOREIGN KEY (`technician_id`) REFERENCES `tbltechnician` (`technician_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `tblworkorder_ibfk_1` FOREIGN KEY (`processed_by`) REFERENCES `tbluser` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `tblworkorder_ibfk_2` FOREIGN KEY (`service_id`) REFERENCES `tblservices` (`service_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `tblworkorder_ibfk_3` FOREIGN KEY (`customer_id`) REFERENCES `tblclient` (`client_id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `tblworkorderdetails` -- ALTER TABLE `tblworkorderdetails` ADD CONSTRAINT `tblworkorderdetails_ibfk_2` FOREIGN KEY (`work_order_id`) REFERENCES `tblworkorder` (`work_order_id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `tblworkorderdetails_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `tblitem` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE;

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.