Table Design Confution(URGENT) [message #52614] |
Thu, 01 August 2002 01:05 |
kothari Alpesh
Messages: 27 Registered: December 2001
|
Junior Member |
|
|
Here with I giving structure of one table in different manner which is ideal structure in context of Primary key??
FIRST Table is
create table xyz
(
user_id number(5) not null,
terminal_id varchar2(15) not null,
rec_stts char(1) not null,
rec_updton date not null,
sch_cd number(3) primary key,
sch_desc varchar2(50) not null
)
SECOND Table is
create table xyz
(
sch_cd number(3) PRIMARY KEY,
user_id number(5) not null,
terminal_id varchar2(15) not null,
rec_stts char(1) not null,
rec_updton date not null,
sch_desc varchar2(50) not null
)
WHICH TABLE PERFORM WELL DOES IT MAKE ANY DIFFERENCE IF PRIMARY KEY DEFINE IN THE VERY FIRST COLUMN OF THE TABLE.
|
|
|
|
|
Re: Table Design Confution(URGENT) [message #52619 is a reply to message #52614] |
Thu, 01 August 2002 07:51 |
Radek
Messages: 33 Registered: April 2002
|
Member |
|
|
By recommendation from Oracle Docs Primary key should be always first column in a table then not null columns should follow and the null columns. I would also recommend to reconsider data type length for your primary key. I would use generic NUMBER without length specification. Your way you save some storage space and probably will have to increase size of column very soon.
Regards,
Radek
|
|
|