Oracle Datatypes ================= ==> Datatypes are used to specify the type of the data which required to write the column of the table. ==> In the oracle, the datatypes are represented with different types: 1) Number type 2) Text type 3) Date type 4) Timestamp 5) Other special datatypes or Miscellaneous types Number Types: ============= byte, short, int and long ==> whole numbers float and double ==> fractional numbers char and boolean => Any number like: whole number, zero value, +eve value and -eve values along with these we can also represent floating-point and double values using "number" type. Ex: 1.23, 12, -123 etc. ==> The number type can be used in different ways: 1) number(size): ---------------- -> this can be used to assign only the whole numbers. here: size ==> the number of digits. Ex: studentRoll number; studentRoll ==> 1234567890; Note: when we are not specifying the size, then the number of digits are completely based on the system configuration. In general we can allow to write up to 24-digits for any system configuration. Ex: employeeId number(5); employeeId = 93457; employeeId = 123 Here: the length of the number should not be exceeded the given size. And we allowed to define the length of the number up to the size. 2) number(precision, size): --------------------------- -> this can be used to define the "fractional values" or "decimal point vales". Here: precision ==> describing the total decimal literals of the fractional number. size ==> the total digits after the decimal point. Ex: 1234.50 ==> number(6,2) Ex: Salary number(8,2); Salary = 100000.50 2) Text type: ============= => three different types of text types: 1) char(size) 2) varchar(size) 3) varchar2(size) 1) char(size): -------------- Ex: grade char(1); emploeeName char(30); employeeName = 'ravi'; => here, the oracle assign the memory based on the size. If the size = 30 ==> memory ==> 30-bytes and the value ==> "ravi" out of the 30-bytes only 4-bytes can be used to write the above value and remaining 26 are wasted. ==> The memory representation for char(size) is "static way". ==> The maximum capacity ==> 2000 characters 2) varchar(size): ----------------- ==> introduced by "SQL". ==> maximum capacity ==> 4000 characters ==> the memory assignment for varchar is always in dynamic nature. Ex: employeeName varchar(40); employeeName = "ravi"; ==> 4-bytes 3) varchar2(size): ------------------ ==> is same as "varchar" ==> is introduced by "oracle corporation". 3) Date type: ============= -> default format for the date is: "dd-Mon-yy" Ex: employeeDateOfJoin date; employeeDateOfJoin = "15-May-25"; => to get the system date, we can use the below query: "select sysdate from dual" 4) Timestamp: ============= ==> default representation for the timestamp is: "dd-Mon-YY HH:MM:SS" 5) Special Datatypes: ===================== 1) clob ==> Character Large Object => when we need to handle the data above 4k capacity Ex: employee History, Student Data etc. => capacity: 1 G to 4 G 2) blob ==> Binary Large Object => to deal with files like: audio files and or video files ==> blob is used. ==> capacity : 1 to 4G 3) BFile ==> Binary File same as blob