business users services
Posted by: Dimitris Papageorgiou
Date: July 31, 2014 10:33AM

I have the following problem...simple to understand I believe.
My app will have as registered members business users where these will offer services.
So,I am trying figure out how to store these services in the database.
Currently I have a table with 2 cols where one is buser_ID(indicating who is the user) and the other is a service_ID col which points to another table where the name of the service is stored along with its price. Here are the show statements for the 2 tables.

CREATE TABLE `services_list` (
`serviceID` int(11) NOT NULL AUTO_INCREMENT,
`price` decimal(6,2) DEFAULT NULL,
`servicename` varchar(45) DEFAULT NULL,
PRIMARY KEY (`serviceID`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8

CREATE TABLE `busers_services` (
`b_user` int(11) NOT NULL,
`serviceID` int(11) NOT NULL,
PRIMARY KEY (`b_user`,`serviceID`),
KEY `fk_busers_services_business_users1_idx` (`b_user`),
KEY `fk_busers_services_services_list1_idx` (`serviceID`),
CONSTRAINT `fk_busers_services_business_users1` FOREIGN KEY (`b_user`) REFERENCES `business_users` (`crID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_busers_services_services_list1` FOREIGN KEY (`serviceID`) REFERENCES `services_list` (`serviceID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8

First of all do you think the 2nd table is redundant?
I do not want to ask anything else for now.

Options: ReplyQuote


Subject
Written By
Posted
business users services
July 31, 2014 10:33AM
August 02, 2014 01:02PM
August 03, 2014 04:01PM
August 31, 2014 05:56PM
September 05, 2014 01:22PM
September 25, 2014 04:07PM
August 04, 2014 10:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.