开发者

How to insert a row in mysql table using mamp phpMyAdmin

I have a table created in mamp phpMyAdmin as follows:

id Country  Province Language
-- -------  -------- --------
1  Canada    Alberta  English   
2  Canada    Ontario  English
3  Canada    Quebec   French
4  Australia Victoria English
  1. I set id=Unique, Province=Primary, Language=Primary. Does it matter if I choose anything to create a relational database eventually?
  2. How can I reorder the count开发者_StackOverflow社区ry list without reordering the ids? So the updated table has now id 1 Australia and so on?


  1. Yes indices will affect the performance of joined table queries. It's best to tackle those when you start writing the queries.

  2. It depends on the interface. If your admin tool is listing records ordered by ID then you would need to change the ID to change the order (obviously!). If it's for your own purposes, then add a "display_order" field and ORDER BY display_order when writing your queries

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜