It all depends on the taste of the team and whether or not there is a pattern in the company.
Since there is no standard 100% I will give you the tips of the rules I follow, after a few years of tinkering with the database, and especially because you say you want to program for multibank.
Let's go, first of all, Oracle does not have Lower Case
, it's all Upper Case
. So starting this way I use the rules for all banks:
- Tables - All in Upper Case
- Use CamelCase
- I do not use compound PK
- Name of tables all in Portuguese or English, nothing to mix
- Standard for PK, FK, CK, UK and related use:
- Name of the XXyy table, where the XX is the type and yy a sequential number. So it's much easier to find the problem, and also if you search the benchmark constraints they come in order and organized
- Always use single PK, even on N x N tables. This allows for a lot of simplification of FK and also the use of ORM. In addition, the
joins
are much easier
- In the query, I always use select, from, and similar commands in lower case, tables in Upper Case and fields in CamelCase, making visual queries easy to understand querys
With these rules you can select
this way:
select
UsuarioID, Nome, Login
from
USUARIO
order by
Login
Example with join
select
a.UsuarioID, a.Nome, a.Login, a.EmpresaID
from
USUARIO a
inner join EMPRESA b on b.EmpresaID = a.EmpresaID
order by
a.Login
I hope I have helped.