Your SlideShare is downloading. ×
  • Like

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Mysql Naming Conventions Bangalore Mysql User Group Oct 11 09

  • 2,491 views
Published

Sudheer Satyanarayana presented MySQL Naming Conventions at the Bangalore MySQL User Group on October 11, 2009. …

Sudheer Satyanarayana presented MySQL Naming Conventions at the Bangalore MySQL User Group on October 11, 2009.

Things to consider.

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,491
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
17
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Bangalore MySQL User Group Meet Up October 11, 2009 MySQL Naming Conventions Sudheer Satyanarayana http://techchorus.net http://binaryvibes.co.in
  • 2. Why?
    • Readability
    • 3. Maintainability
    • 4. Reduced development costs
  • 5. First Things First
    • Avoid Reserved words
      • Look up the Manual
    • Write a policy
      • One size doesn't fit all
  • 6. Case Sensitivity
      • All lower case: user_type
      • 7. All upper case: USER_TYPE
      • 8. Camel case: userType
      • 9. Mixed case: UserType
    Be consistent Avoid inconsistent usage like user_type, productType
  • 10. Databases
    • To prefix or not? mydb or myprefix_mydb
    • 11. You may not have an option
    • 12. You may not want to disclose the database name
  • 13. Tables
    • To prefix or not? Mytable vs myprefix_mytable
    • 14. Avoid generic prefixes like tbl_user
    • 15. Case sensitivity matters
    • 16. Plural or singular? user vs users
    • 17. Acronyms vs descriptive names
    • 18. Avoid too long or two short names
      • myprefix_user_preferences_type vs
      • 19. user_pref_type
  • 20. Columns
    • Suffixing _id to indexed key – user_id vs uid vs id
    • 21. Beware of reserved words – timestamp, when
    • 22. Self explanatory foreign key name
      • Table contact: contact_id, PK user_id REFERENCES user_id of user
  • 23. Benefits
    • More readable
    • 24. Maintainable
    • 25. Avoid deployment problems
    • 26. Reduced development costs
  • 27. Tip See what established projects are doing
  • 28. Thank you