Scenario :
- There are two departments namely 'Software' & 'Hardware'.
- They have divisions like 'Cobol', 'Fortran', 'Pascal', 'QBasic' in Software department.
- And 'RAM', 'HardDisk', 'Monitor', 'CPU' in Hardware
department.
- Below are the table formats for both the Department and
Division tables.
Database used : Oracle
Table 1 : Department Table
Table 2 : Division Table for the above Departments (Format 1 - Primary Key / Unique Id Column = Div_id)
Table 2 : Division Table for the above Departments (Format 2 - Primary Key / Unique Id Column = Div_id + Dep_id)
In the above two division table formats, i can't able to find the pros & cons. So in these formats, what is the best practice to create Primary / Unique ID. And why it is best?
Is there any performance difference between both formats when using select query?