Most often i work with cms but did not worked with sql directly too much before. I am making a facebook page directory where i am saving page ids the length of facebook page id is 10-13 digit sometimes. So what types of int i should use. I am thinking about BIGINT but what should be the length of it ?
Here is the table visually. I would be glad if you can advice the length of the fields.
Here is the datatype and length i comeup with. But i am confused if these are efficient:
- ID: Database id for the pages (int 5)
- page_id: Facebook page id (bigint)
- page_name: Facebook page name (varchar 50)
- username: username of the page (varchar 50)
- likes: number of likes (int)
- Link: Link to the page (varchar 100)
- Time_added: current timestamp
Correct, you’ll need a
BIGINT: http://dev.mysql.com/doc/refman/5.6/en/numeric-types.html.I’d recommend longer lengths for your
VARCHARfields. It won’t hurt anything, and URLs in particular can get very long. I’d probably bump up the two 50-character fields to 100, and allow for 1,000 characters in the Link field.