Is it good practice to use a table prefix when designing a database?

Is it good to use a table prefix when designing a database?

For a table like " user_detail "
I use column names like ud_name , ud_email etc.

I do this because I want to keep a unique name for each column (in each table) so that later there are no problems with a conflicting column name when joining.

Although some of my colleagues have problems with reading column names (I don’t know why), and they suggest that the name is as simple and readable as possible, so I should not use any prefix.

What is the standard nomenclature used for database design? is it bad to have prefixes? Please support your answer with any link.

Thanks, Enjoy Made :)

+3
source share
5 answers

Better go with what you did

column name e.g. tableprefix_column - reason

  • it makes a unique column name and you have no conflict with another table column name.

  • if you use a simple name, for example columnname - name, than you need to be careful, and you need to write tablename.columnnamewhen writing a query, and also assign an alias for this column in the query of typetablename.columnname as xyzname

0
source

, , , . : ? , . dBase . , , , .

, " ", , , ..

, SQL. , , , .

, , ( ) ? , . , SQL.

this post SQL Mag.

- , . , . , , , , , , .

+5

...

, .

, , . , , , , ..:

select ud.name as ud_name,
       ud.email as ud_email
from user_detail as ud;

, / , ORM, , , , .

+1

- , , , ! , (. ), : . : , , , "", "", "" "". , , .

Here are some of our examples where the field name is built from the nature of the data (date, time, code, identifier) ​​+ table description, de facto each unique column is unique:

Tbl_Attendance        contains attendance data
    id_Attendance     is the identifier
    id_Person         is the foreign key to Tbl_person.id_Person
    id_Zone           is the foreign key to Tbl_Zone.id_Zone
    dateAttendance    is the attendance date
    timeInAttendance  is the check in time
    timeOutAttendance is the check out time

Tbl_PaySlip           contains informations about Payslips
    id_Payslip        is the identifier
    id_Person         is the foreign key to Tbl_person.id_Person
    id_Company        is the foreign key to Tbl_Company.id_Company
    dateStartPayslip  is the starting date of the payslip
    dateEndPayslip    is the ending date of the payslip
    codePayslip       is the unique code of the payslip, built out from company code, person code, period code 
0
source

All Articles