Database Design: Composite key vs one column primary key
问题 A web application I am working on has encountered an unexpected 'bug' - The database of the app has two tables (among many others) called 'States' and 'Cities'. ' States ' table fields: ------------------------------------------- idStates | State | Lat | Long ------------------------------------------- ' idStates ' is an auto-incrementing primary key. ' Cities ' table fields: ---------------------------------------------------------- idAreaCode | idStates | City | Lat | Long -----------------