I am developing a website which uses a back end relational database. There are certain standards, which some people follow and some don’t; some make their own standards for their database.
Should I make the column names verbs and adjectives, like has_permissions
, has_role
and is_located_in
?
Or should I make the column names nouns, like permissions
, role
and location
, respectively?
Are these naming conventions appropriate?
Table Service {
// API or Account
serviceID integer [pk]
name string [not null]
}
Table Privelege {
privelegeID integer [pk]
// Specifies the data or operations accessible
privelege_for string [not null]
}
Table Credential {
credentialID integer [pk]
for_service integer [ref: - Service.serviceID]
has_permissions integer [ref: < Privelege.privelegeID]
}
Table City {
cityID integer [not null]
// Name of the city
city string [not null]
}
Table Globe {
globeID integer [pk]
// Country or region name
country string [not null]
has_cities integer [not null]
}
Table Language {
languageID integer [pk]
// Language name (e.g., English)
dialect string [not null]
// Language abbreviation (e.g., en)
dialect_initials string [not null]
}
Table Channel {
channelID integer [pk]
// Contact method (e.g., phone number, social media)
channel string [not null]
}
Table Contact {
contactID integer [pk]
// Channel used for contact
via integer [ref: - Channel.channelID]
// Contact detail (e.g., xxx-xxx-xxx)
using string [not null]
}
Table Account {
accountID integer [pk]
has_credentials integer [ref: - Credential.credentialID]
// Role of the account holder (e.g., Employer, Manager)
has_role integer [ref: - Employer.employerID]
// Location (e.g., globe or region)
is_located_in integer [ref: - Globe.globeID]
// Preferred communication language
prefers_communication_in integer [ref: < Language.languageID]
// Contact information
can_be_reached integer [ref: < Contact.contactID]
}
Table Employer {
employerID integer [pk]
}
a.single.byte is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.