title: Weak entity on mysql with no primary key
body: <p>I have a question about transfering a weak entity from an e-r model to sql tables.
  Specifically i am using mysql.</p>
  
  <p>Lets say i have the table hotels in which i have primary key id for each hotel, named id.</p>
  
  <p>Then i want to create a table for rooms. A room is considered weak entity because it cannot be identified without refering to a hotel and because it cannot exist without a hotel.</p>
  
  <p>So lets say that rooms contain columns with data and two other columns.
  First column is a foreign key to hotel id and a second column which is a room number.</p>
  
  <p>Note than many rooms can have the same number but no room in the same hotel can have the same number. So this is a way to identify a specific room.</p>
  
  <p>How can i put this into a table?
  I cannot declare the number as unique because its not unique, i cannot declare it as a primary key either for the same reason. So am i creating a table without primary key?</p>
  
  <p>Also, the foreign key "hotel_id" is a unique key since it is a primary key in hotels table.
  I suppose i won't having problems using many rooms with the same foreign key.</p>
  
  <p>To sum up.
  My question is how to create the table rooms, is there any way to automatically identify each room except the obvious (identifying the room by selecting a room with specific number and hotel_id)?.</p>
  
  <p>Thank you in advance.</p>