SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast ParfaitMacaron's Avatar
    Join Date
    Mar 2013
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Naming Tables & Fields in SQL

    Should I capitalize each table name e.g. (Members) and field name (Forename) or leave them as lower cases?

    Thank you!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,262
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    declare all your names in lower case

    some database systems (you did not say which you were using) disregard identifier case, and you can code the names either way, in fact, you can mix them up from one query to the next

    Members, MEMBERS, members, mEmBeRs, ...

    however, this is not always true...
    Quote Originally Posted by da mysql manual
    In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine). Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix.
    -- http://dev.mysql.com/doc/refman/5.0/...nsitivity.html
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast ParfaitMacaron's Avatar
    Join Date
    Mar 2013
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. I'm using MySQL. So I will declare using lower cases.

    Quote Originally Posted by r937 View Post
    declare all your names in lower case

    some database systems (you did not say which you were using) disregard identifier case, and you can code the names either way, in fact, you can mix them up from one query to the next

    Members, MEMBERS, members, mEmBeRs, ...

    however, this is not always true...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •