NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL - SQL Question

Daniel Convissor danielc at analysisandsolutions.com
Wed Apr 23 20:50:03 EDT 2008


Hi John:

> I am a bit stuck with legacy naming that is all over the place.

Fun fun fun!


> Is there a defacto standard for schema naming?

There are loads of naming standards.  I think very highly of Peter 
Gulutzan.  The live version of the web page has been yanked, but 
Archive.org to the rescue...

http://web.archive.org/web/20070409075643rn_1/www.dbazine.com/db2/db2-disarticles/gulutzan5

I used to be in the plural camp.  But I've become fond of the singular 
camp.  That way the table can more easily match the names of the columns.  
This makes things easier when it comes to making automatic tools for 
sanitizing input and reverse engineering databases.  Particularly when it 
comes to things like this:

people
  person_id

loans
  loan_id

...VS...

person
  person_id

loan
  loan_id


> I never know what to name timestamp/date fields.

What's your issue?  Not calling things "date"?  I tend to call things 
"birth_date", "creation_date" etc.


> How would you name the following tables?
> Users
> Permissions
> User_Permissions  - a many to many connector table

system_user
system_permission
system_permission_user


But all this kind of stuff is up to personal taste.  When it comes down 
to taste, I often say, "Some people have it.  Some people don't." :)

All that aside, you didn't answer the burning question:  did my query 
suggestion work?! :)

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list