David Garcia
David Garcia

Reputation: 2696

Data type for database primary key

I am creating a database and in the tables the primary key value is 1 2 3 4 etc. My teacher said i can use number(4) for the primary key data type.

However some suggest that I use 'int(20) unsigned'

I am quite confused, what should i use...

Database is Oracle

Upvotes: 4

Views: 4190

Answers (1)

nvogel
nvogel

Reputation: 25526

There is no single right or wrong type for key attributes. Choose a data type that accurately represents the business domain and fulfils the requirements of whoever or whatever needs to use the key.

Upvotes: 4

Related Questions