Most of the registration process on websites, ask you for the country name from drop down. My question is , should we design our db like this: Table 1: Country (countryID, countryName) Table 2: Registration(Name, email ... Country(Id/Name) . So, it should be countryId in the registration table or countryName ? Which is the best approach ?
CountryID would be smaller, so it would be best I'd say. int(3) perhaps? All you need is an int just big enough to be able to represent the number of countries in your drop-down. So to save yourself any trouble of having to look up a countryID in your country table after the form gets submitted, just pre-populate your form with these id's corresponding the names, eg <option value="1">USA</option> etc.
Well, you've got countryID common to both tables, so for argument's sakes if you were wanting to find all members from Ireland, you'd search something like this: select r.* from registration r left join country c using(countryid) where c.countryname="ireland"