mysql - Duplicate Customers with Different Customer Id -


i have customer table customer id auto number , primary key. have table orders customer id foreign key. in customers table 1 customer assigned multiple ids how resolve ? 1 customer can have multiple orders how can assign same customer id multiple orders without manually doing so?

i have customer table following fields: 1- customerid - autonumber - primary key 2- buyername 3- addstreet1 4- addstreet2 5- addcity 6- addstate 7- addzipcode 8- addcountry 9- phoneno 10- email 11- company 12- receiptname have table named orders following fields: 1- orderid - primary key 2- customerid 3- purcahsedate 4- fulfillmentcenter 5- saleschannel 6- additionalinfo have relation between customer.customerid , orders.customerid of 1 many. i.e 1 customer can have multiple orders. if data in customer table has same customer twice particular customer gets 2 ids. if run duplicate query , remove customers, orders table change customer id. prime question.

thanks


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -