5 ms·
Regarding lower-case/hungarian notation etc, the membership table in my database is: tblMember --------- MemberID MemberUsername MemberDateJoined et
by HalfwayToDice 10y ago
Regarding lower-case/hungarian notation etc, the membership table in my database is:
tblMember
---------
MemberID
MemberUsername
MemberDateJoined
etc
Is this very non-standard formatting for SQL?
- ZenoArrow 10y agoThere's nothing wrong with CamelCase if it's readable for you. Readability is the only reason some people prefer using underscores between words.
- wvenable 10y agoWhy prefix your tables with tbl? Do you prefix your functions with "fun" and your variables with "var" and your classes with "cls"? It's completely redundant.
- carterehsmith 10y agoSome people do it to avoid clashes with reserved words. Example: in some DBMSs, you cannot name your table 'user' because it is a reserved word. "user" (double quotes) works, but there may be gotchas as sometimes double quotes suddenly make identifiers case-sensitive... but only if the filesystem is case-sensitive... things like that. So you can either deal with the gotchas or say fuck it, put a prefix "tbl" and call it a day.
- wvenable 10y agoI'd much rather just name that table AppUser than prefix every single other table with "tbl". That's just taking one minor annoyance and multiplying it a thousand times.
- matt4077 10y agoYeah, "tbl" is redundant and so is the prefix "Member". In queries, you can use Member.id / member.name etc. for the same effect. I'd also drop the "date" because the it's repeating the type of data (probably inaccurately b/c it's most often a datetime). Sometimes I use pre- or postfix for disambiguation as in "isRetired" vs. "RetiredOn". The primary column is always id, something like "memberID" would be some id created by an external system.