How do I add a photo to my comment or blog entry?
database naming conventions
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ColdFusion > database naming conventions 24 June 2004 23:56:36

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

database naming conventions

Marlon Moyer 24 June 2004 23:56:36
 I just got told that I have to go back and put a vw prefix on all my
views and tbl prefix on my tables so that people know when they're a
table or a view when writing queries. Jeez, that just seems a little
silly to me. If you don't know if you're writing against a table or a
view should you be writing queries anyway? :)­

Anyone else have to follow silly rules like this?

Marlon

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Protect your mail server with built in anti-virus protection. It's not only good for you, it's good for everybody.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=39

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117315
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Michael Dinowitz 24 June 2004 18:47:01 permanent link ]
 While I don't, I can see the logic in it. Prefixing saves time when
your in a rush to fix something and is 'self documentation' for when
others have to review your code. In general, a good practice.


----- Original Message -----
From: Marlon Moyer <marlon.moyer@gmail­.com>
Date: Thu, 24 Jun 2004 10:37:40 -0500
Subject: database naming conventions
To: CF-Community <cf-community@house­offusion.com>


I just got told that I have to go back and put a vw prefix on all my

views and tbl prefix on my tables so that people know when they're a

table or a view when writing queries. Jeez, that just seems a little

silly to me. If you don't know if you're writing against a table or a

view should you be writing queries anyway? :)­



Anyone else have to follow silly rules like this?



Marlon_____________­___________________



~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=34

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117317
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
JediHomer 24 June 2004 18:48:46 permanent link ]
 The only prefixes in that respect that I use would be spr_ for sprocs...

but even then the exec usually gives away the fact its a sproc


----- Original Message -----
From: Marlon Moyer <marlon.moyer@gmail­.com>
Date: Thu, 24 Jun 2004 10:37:40 -0500
Subject: database naming conventions
To: CF-Community <cf-community@house­offusion.com>

I just got told that I have to go back and put a vw prefix on all my
views and tbl prefix on my tables so that people know when they're a
table or a view when writing queries. Jeez, that just seems a little
silly to me. If you don't know if you're writing against a table or a
view should you be writing queries anyway? :)­

Anyone else have to follow silly rules like this?

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=37

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117320
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Charlie Griefer 24 June 2004 19:06:03 permanent link ]
 IMO it's not about anything being 'given away'...it's about
self-documentation (Mike D. already made that point tho).

Some people prefix arrays with arr_ or ar_, structures with st_, etc. well,
when you see:

<cfscript>
arr_myArray = arrayNew(1);
</cfscript>

you kind of know that myArray is an array when you see the arrayNew()
function after it :)­

It's just good habit so that you (or whoever comes after you once you get
hit by the proverbial bus or meteorite) can more easily understand your code
at any given point in the page, rather than have to trace the code back to a
variable declaration to determine its type.

That convention, I actually don't follow...but the tbl_ prefix on database
tables I do.

Different strokes. Not 'wrong' or 'right' to do either, neither, or a
little of both. But to answer the original question...yes, there are others
who (by their own choice or by corporate mandate) adhere to such standards
:)­

----- Original Message -----
From: "JediHomer" <jedihomer@gmail.co­m>
To: "CF-Community" <cf-community@house­offusion.com>
Sent: Thursday, June 24, 2004 8:48 AM
Subject: Re: database naming conventions

The only prefixes in that respect that I use would be spr_ for sprocs...>
but even then the exec usually gives away the fact its a sproc



~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=11

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117328
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Deanna Schneider 24 June 2004 19:16:23 permanent link ]
 I hate that naming convention. In fact, in many cases, you want your
developers to be unaware if they're querying a table or view -
particularly when it's select only access. Why should they know if
you're giving them just the part of the data that they need? All they
should need to know is that the data that they need is in object X.


----- Original Message -----
From: Marlon Moyer <marlon.moyer@gmail­.com>
Date: Thu, 24 Jun 2004 10:37:40 -0500
Subject: database naming conventions
To: CF-Community <cf-community@house­offusion.com>


I just got told that I have to go back and put a vw prefix on all my
views and tbl prefix on my tables so that people know when they're a
table or a view when writing queries. Jeez, that just seems a little
silly to me. If you don't know if you're writing against a table or a
view should you be writing queries anyway? :)­

Anyone else have to follow silly rules like this?

Marlon_____________­___________________


~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=35

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117329
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Marlon Moyer 24 June 2004 19:32:09 permanent link ]
 I guess I just see it as a wasted effort. Why would you need to know
if it's a table vs a view. Afterall, they're supposed to behave the
same way. The views should be transparent to the end user.

Say you have a situation where a table tbl_employees
has....welll...empl­oyee info in it. HR has access to the whole table.
Payroll has access to only certain fields in the table. You create
vw_employees now and update your code. Supervisors decide they need
info out of the table, but they're limited to even less data
available. You create vw_employees_superv­isor_view and update your
code.

Now, if you didn't have the prefixes, you could just create a view
called employees in the dbo schema for HR, one in the accounting
schema, and one in the supervisor schema. That way, all of your code
references employees and you know that each group only gets to see
their information.

Marlon
my $.02 (which isn't worth that much)


On Thu, 24 Jun 2004 09:06:03 -0700, Charlie Griefer <hof@griefer.com> wrote:>
IMO it's not about anything being 'given away'...it's about> self-documentation (Mike D. already made that point tho).>
Some people prefix arrays with arr_ or ar_, structures with st_, etc. well,> when you see:>
<cfscript>> arr_myArray = arrayNew(1);> </cfscript>>
you kind of know that myArray is an array when you see the arrayNew()> function after it :)­>
It's just good habit so that you (or whoever comes after you once you get> hit by the proverbial bus or meteorite) can more easily understand your code> at any given point in the page, rather than have to trace the code back to a> variable declaration to determine its type.>
That convention, I actually don't follow...but the tbl_ prefix on database> tables I do.>
Different strokes. Not 'wrong' or 'right' to do either, neither, or a> little of both. But to answer the original question...yes, there are others> who (by their own choice or by corporate mandate) adhere to such standards> :)­>
----- Original Message -----> From: "JediHomer" <jedihomer@gmail.co­m>> To: "CF-Community" <cf-community@house­offusion.com>> Sent: Thursday, June 24, 2004 8:48 AM> Subject: Re: database naming conventions>
The only prefixes in that respect that I use would be spr_ for sprocs...> >
but even then the exec usually gives away the fact its a sproc>

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=37

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117331
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Tony Weeg 24 June 2004 19:47:45 permanent link ]
 id keep my resume up to date...anytime a company wants you to start
documenting all of your work or changing things like this for all of your
work, dontcha just kinda get the feeling someone else may be coming along,
and might just get ur job?

or am I just paranoid?

tw

-----Original Message-----
From: Marlon Moyer [mailto:marlon.moyer@gmail.com]
Sent: Thursday, June 24, 2004 12:32 PM
To: CF-Community
Subject: Re: database naming conventions

I guess I just see it as a wasted effort. Why would you need to know
if it's a table vs a view. Afterall, they're supposed to behave the
same way. The views should be transparent to the end user.

Say you have a situation where a table tbl_employees
has....welll...empl­oyee info in it. HR has access to the whole table.
Payroll has access to only certain fields in the table. You create
vw_employees now and update your code. Supervisors decide they need
info out of the table, but they're limited to even less data
available. You create vw_employees_superv­isor_view and update your
code.

Now, if you didn't have the prefixes, you could just create a view
called employees in the dbo schema for HR, one in the accounting
schema, and one in the supervisor schema. That way, all of your code
references employees and you know that each group only gets to see
their information.

Marlon
my $.02 (which isn't worth that much)


On Thu, 24 Jun 2004 09:06:03 -0700, Charlie Griefer <hof@griefer.com> wrote:>
IMO it's not about anything being 'given away'...it's about> self-documentation (Mike D. already made that point tho).>
Some people prefix arrays with arr_ or ar_, structures with st_, etc.
well,> when you see:>
<cfscript>> arr_myArray = arrayNew(1);> </cfscript>>
you kind of know that myArray is an array when you see the arrayNew()> function after it :)­>
It's just good habit so that you (or whoever comes after you once you get> hit by the proverbial bus or meteorite) can more easily understand your
code> at any given point in the page, rather than have to trace the code back to
variable declaration to determine its type.>
That convention, I actually don't follow...but the tbl_ prefix on database> tables I do.>
Different strokes. Not 'wrong' or 'right' to do either, neither, or a> little of both. But to answer the original question...yes, there are
others> who (by their own choice or by corporate mandate) adhere to such standards> :)­>
----- Original Message -----> From: "JediHomer" <jedihomer@gmail.co­m>> To: "CF-Community" <cf-community@house­offusion.com>> Sent: Thursday, June 24, 2004 8:48 AM> Subject: Re: database naming conventions>
The only prefixes in that respect that I use would be spr_ for sprocs...> >
but even then the exec usually gives away the fact its a sproc>



~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=11

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117332
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Won Lee 24 June 2004 19:56:20 permanent link ]
 At 12:47 6/24/2004 -0400, you wrote:>id keep my resume up to date...anytime a company wants you to start>documenting all of your work or changing things like this for all of your>work, dontcha just kinda get the feeling someone else may be coming along,>and might just get ur job?

Depends. Did they ask you to write two copies; one in English and the
other in Indian?



~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=11

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117333
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Marlon Moyer 24 June 2004 19:59:35 permanent link ]
 I didn't ask where he's from yet, buy my new cube mate sure smells
like curry. :)­




On Thu, 24 Jun 2004 12:56:20 -0400, Won Lee <won@quovad.com> wrote:>
At 12:47 6/24/2004 -0400, you wrote:> >id keep my resume up to date...anytime a company wants you to start> >documenting all of your work or changing things like this for all of your> >work, dontcha just kinda get the feeling someone else may be coming along,> >and might just get ur job?>
Depends. Did they ask you to write two copies; one in English and the> other in Indian?>

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=34

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117334
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Chunshen Li 24 June 2004 20:33:46 permanent link ]
 
I guess I just see it as a wasted effort. Why would you need to know>if it's a table vs a view. Afterall, they're supposed to behave the>same way. The views should be transparent to the end user.

I agree adding the Hungary notation is simply stupid and a waste of time. No relationl database textbook dictates one to add that sort of notation, and as a matter of fact, it sort of standing in the way of reading/understandi­ng an ERD, for instance,

has
product -------> part
is made of

also, entity needs to use singular.
...

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Sams Teach Yourself Regular Expressions in 10 Minutes by Ben Forta
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=40

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117349
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Patrick Harkins 24 June 2004 20:35:31 permanent link ]
 I was thinking of attending but they don't sound half as interesting as
CFUN!



Outbound email scanned for viruses. (e232)


~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Protect your mail server with built in anti-virus protection. It's not only good for you, it's good for everybody.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=39

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117353
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Jochem van Dieten 24 June 2004 23:10:06 permanent link ]
 Marlon Moyer wrote:> I guess I just see it as a wasted effort. Why would you need to know> if it's a table vs a view.

For inserts/updates.

Jochem

~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community.
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=36

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117406
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
Tony Weeg 24 June 2004 23:56:36 permanent link ]
 unless is a DPV and then it doesn't matter.

:)­ me

-----Original Message-----
From: Jochem van Dieten [mailto:jochemd@oli.tudelft.nl]
Sent: Thursday, June 24, 2004 4:10 PM
To: CF-Community
Subject: Re: database naming conventions

Marlon Moyer wrote:> I guess I just see it as a wasted effort. Why would you need to know> if it's a table vs a view.

For inserts/updates.

Jochem



~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~~~~~~~~~~~­~~~~~~~~~~|
Get the mailserver that powers this list at
http://www.houseoff­usion.com/banners/vi­ew.cfm?bannerid=17

Message: http://www.houseoff­usion.com/lists.cfm/­link=i:5:117412
Archives: http://www.houseoff­usion.com/cf_lists/t­hreads.cfm/5
Subscription: http://www.houseoff­usion.com/lists.cfm/­link=s:5
Unsubscribe: http://www.houseoff­usion.com/cf_lists/u­nsubscribe.cfm?user=­13124.11887.5
Donations & Support: http://www.houseoff­usion.com/tiny.cfm/5­4
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ColdFusion > database naming conventions 24 June 2004 23:56:36

see also:
RES: [PHP] URL redirect or rewrite
Make error in php
Signio / VeriSign Payflow Pro
пройди тесты:
see also:
Watch out the network trap
Trifle Matters
Change Means...

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .