That's not how a database works since records don't have an order without an order by in your SELECT statement. There is no relation between records if you don't create that relation. It's the responsibility of your front end to set the correct content for your INSERT statements. In your case you should prohibit empty strings '' and add a not null constraint to the restaurant column. A better database model would be nice as well, you shouldn't store 20.000 times the value "McDonalds", just google 3NF and improve your model
↧