Oracle Data types, ROWID, PLS_INTEGER vs INTEGER

Data Types

Ref: https://docs.oracle.com/cd/A97630_01/server.920/a96524/c13datyp.htm

(Click on the image to see it properly)

Why PLS_Integer:

https://docs.oracle.com/cd/B13789_01/appdev.101/b10807/03_types.htm

“You use the PLS_INTEGER datatype to store signed integers. Its magnitude range is -231 .. 231. PLS_INTEGER values require less storage than NUMBER values. Also, PLS_INTEGER operations use machine arithmetic, so they are faster than NUMBER and BINARY_INTEGER operations, which use library arithmetic. For efficiency, use PLS_INTEGER for all calculations that fall within its magnitude range.”

ROWID vs ROWNUM

ROWID is useful when you need to refer to a specific row in a table without using a primary key or unique constraint. Hence, ROWNUM is a pseudocolumn that assigns a unique row number to each row in a result set, while ROWID is a physical address that identifies a specific row in a table

https://www.c-sharpcorner.com/interview-question/what-is-the-difference-between-rownum-and-rowed

Simple Integer vs PLS_integer

https://docs.oracle.com/en/database/oracle/oracle-database/19/lnpls/plsql-data-types.html

“SIMPLE_INTEGER has the same range as PLS_INTEGER and has a NOT NULL constraint. It differs significantly from PLS_INTEGER in its overflow semantics. If you know that a variable will never have the value NULL or need overflow checking, declare it as SIMPLE_INTEGER rather than PLS_INTEGER .”