MySQL Forums
Forum List  »  InnoDB

difrent id in a relational DB?? how?
Posted by: theodor michailow
Date: January 30, 2015 08:28AM

hi there... im working on a prodject of mine and i have a little problem now... and can`t thing of a proper solution...

i have a database wich hold difrend values
1.shops - with values wich shop (street name etc..)
2.customers- name of customers witch go in the shop (id,fname,lname, phone)
3.products - and the products they leave or buy ( id, nameOFproduct, price, date... etc....)

now i have connected them with ralations but i get a little problem
i want for each diferent shop the Id form 2.custers to begin from 1
if i have for example 5 custorts in shop 1 i want the id for shop 1 to be form 1 to 5 and for shop 2 if i have there 3 customers the id should be from 1 to 3

now if i have 5 customers in shop 1 i get ID form 1 to 5 and after that if i add 3 customers to shop 2 i get ID= 6,7,8

so how can i make it so that every shop hase a separate ID table for the customers?

Options: ReplyQuote


Subject
Views
Written By
Posted
difrent id in a relational DB?? how?
1817
January 30, 2015 08:28AM
1062
February 03, 2015 10:54AM


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.