Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Primary key is Physical Sort Order???

user5393819Mar 22 2015 — edited Mar 22 2015

Team,

How data are stored when creating Primary key on a table? I believe its Physical Order.

I have created a table as below.

CREATE TABLE supplier

(

  supplier_id numeric(10) not null,

  supplier_name varchar2(50) not null,

  contact_name varchar2(50),

  CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)

);

insert into supplier values (1,'abcd','efgh');

insert into supplier values (2,'abcd','efgh');

insert into supplier values (3,'abcd','efgh');

commit;

Retrieving rows,

select rowid, a.* from supplier a order by supplier_id

ROWIDSUPPLIER_IDSUPPLIER_NAMECONTACT_NAME
ACF9/aAAUAAAAFlAAB1abcdefgh
ACF9/aAAUAAAAFlAAC2abcdefgh
ACF9/aAAUAAAAFkAAB3abcdefgh

Deleting supplier_id =2,

delete from supplier where supplier_id =2

ROWIDSUPPLIER_IDSUPPLIER_NAMECONTACT_NAME
ACF9/aAAUAAAAFlAAB1abcdefgh
ACF9/aAAUAAAAFkAAB3abcdefgh

If it is physical sort order, row_id of supplier_id (3) should more to row_id of supplier_id (2), but it didnt happen.

Can anyone explain how to data are stored in blocks?

Regards,

Praveen

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2015
Added on Mar 22 2015
4 comments
2,390 views