table naming conventions

  • we are creating a new database maintaining address and in the future may have more into the databases.

    I have a question about the nameing convention for database tables.

    We used to have a standard to give a prefix of 3 letters for a table to group them together functionally, like schSchoolProgram, schAssignment, appProcess, secUsers.

    Is this a good way to name tables, I found sometimes it is hard to mention the table, I have to spell out the first 3 characters when I talk to someone about the tables.

    For the new database, when creating tables, shall I just use the plain names, like Address instead of addrAddress, StudentHomeAddress instead of addrStudentHomeAddress?

    Also for domain tables shall I just: City, County instead of domCity, domCounty?

    Thanks

  • sqlfriends (3/19/2013)


    ...when creating tables, shall I just use the plain names, like Address instead of addrAddress, StudentHomeAddress instead of addrStudentHomeAddress?

    Also for domain tables shall I just: City, County instead of domCity, domCounty?

    Thanks

    That is the right decision and very good practice! Don't prefix or suffix your tables.

    If you want to group your tables logically or by any another means - use schemas!

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Eugene Elutin (3/19/2013)


    sqlfriends (3/19/2013)


    ...when creating tables, shall I just use the plain names, like Address instead of addrAddress, StudentHomeAddress instead of addrStudentHomeAddress?

    Also for domain tables shall I just: City, County instead of domCity, domCounty?

    Thanks

    That is the right decision and very good practice! Don't prefix or suffix your tables.

    If you want to group your tables logically or by any another means - use schemas!

    Thanks, besides using schemas, what other options I could use to group them logically?

    Thanks,

  • sqlfriends (3/19/2013)


    Eugene Elutin (3/19/2013)


    sqlfriends (3/19/2013)


    ...when creating tables, shall I just use the plain names, like Address instead of addrAddress, StudentHomeAddress instead of addrStudentHomeAddress?

    Also for domain tables shall I just: City, County instead of domCity, domCounty?

    Thanks

    That is the right decision and very good practice! Don't prefix or suffix your tables.

    If you want to group your tables logically or by any another means - use schemas!

    Thanks, besides using schemas, what other options I could use to group them logically?

    Thanks,

    You can keep your tables in separate databases if you really want to keep them so grouped and separate from each other...

    But in a single database:

    Using schemas is the best way.

    Using prefixes - is the worst one.

    I don't think that there is another way to group tables "logically".

    Keep in mind, that if your common queries will involve tables from multiple "logical" groups, then you better not to group them at all. As your database is a kind of logical group of tables itself...

    Keep it simple, create all your main tables under dbo schema.

    If you have some specific data (let say application configuration) which you want separate logically from your core data, you can create config schema and and make all relevant objects (tables, views and stored procs) part of this schema.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply