Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Wednesday, 6 August 2014

Data Types in Oracle

What are the different types of data types in oracle?


Above, I have classified the oracle data type in two different parts,

1)     Scalar data types and
2)     Composite data types.

 Scalar data type includes number, char, varchar, varchar2, date, pls_integer etc. composite data type includes records and collections. Collection again divided into three parts, index by tables this also called as associative array, varray and nested tables.

What scalar data type is?

Scalar data type can hold single value at a time with no internal component.

Let’s look at the category and description of the various scalar data types:-

Category
Data Description
Numeric
Numeric values, on which you can perform arithmetic operations.
Character
Alphanumeric values that represent single characters or strings of characters, which you can manipulate.
BOOLEAN
Logical values, on which you can perform logical operations.
Datetime
Dates and times, which you can manipulate.
Interval
Time intervals, which you can manipulate.


Let’s look at the data type family and data type name of scalar data type:-

Data type family
Data type name
NUMERIC
NUMBER
PLS_INTEGER
BINARY_FLOAT
BINARY_DOUBLE
CHARACTER
CHAR
VARCHAR2
NCHAR
NVARCHAR2
BOOLEAN
BOOLEAN
DATETIME
DATE
TIMESTAMP
INTERVAL
INTERVAL YEAR TO MONTH
INTERVAL DAY TO SECONDS

What is difference between CHAR, VARCHAR2 and VARCHAR2 scalar data types?

Char and varchar are similar but differ in the way that they store and retrieve. The char and varchar type are declared with the length that indicates maximum number of characters you want to store. Like char (10) or varchar2 (10).

CHAR: - CHAR should be used for storing fix length character strings. String values will be space/blank padded before stored on disk. If this type is used to store variable length strings, it will waste a lot of disk space.

VARCHAR: - VARCHAR behaves exactly the same as VARCHAR2.

VARCHAR2:- VARCHAR2 is used to store variable length character strings. The string value's length will be stored on disk with the value itself.
What is difference between INTEGER, PLS_INTEGER and BINARY_INTEGER?
-          
      Pls_integer is a subtype with base type binary integer
-          
      Binary integer is a subtype with base type integer with a range of '-2147483647'...2147483647

-          Integer is a subtype with base type number (38, 0)



    Read Also:-  Data types in MySql

7 comments:

  1. Are you interested in doing Data Science Training in Chennai with a Certification Exam? Catch the best features of Data Science training courses with Infycle Technologies, the best Data Science Training & Placement institutes in and around Chennai. Infycle offers the best hands-on training to the students with the revised curriculum to enhance their knowledge. In addition to the Certification & Training, Infycle offers placement classes for personality tests, interview preparation, and mock interviews for clearing the interviews with the best records. To have all it in your hands, dial 7504633633 for a free demo from the experts.

    ReplyDelete
  2. Learn Oracle PLSQL for making your career towards a sky-high with Infycle Technologies. Infycle Technologies is the top Oracle PLSQL Training Institute in Chennai, offering programs in Oracle such as Oracle PL/SQL, Oracle DBA, etc., in the 200% hands-on practical training with professional specialists in the field. In addition to that, the interviews will be arranged for the candidates, so that, they can set their career without any struggle. Of all that, 100% placement assurance will be given here. To have the best career, call 7502633633 to Infycle Technologies and grab a free demo to know more.Top Oracle PLSQL Training Institute in Chennai | Infycle Technologies

    ReplyDelete
  3. Infycle Technologies, the No.1 software training institute in Chennai offers the No.1 Big Data Hadoop Training in Chennai | Infycle Technologies for students, freshers, and tech professionals. Infycle also offers other professional courses such as DevOps, Artificial Intelligence, Cyber Security, Python, Oracle, Java, Power BI, Selenium Testing, Digital Marketing, Data Science, etc., which will be trained with 200% practical classes. After the completion of training, the trainees will be sent for placement interviews in the top MNC's. Call 7502633633 to get more info and a free demo.

    ReplyDelete
  4. Grab Data Science Certification in Chennai for skyrocketing your career with Infycle Technologies, the best Software Training & Placement institutes in and around Chennai. In addition to the Certification, Infycle also gives the best placement training for personality tests, interview preparation, and mock interviews for leveling up the candidate's grades to a professional level.

    ReplyDelete
  5. Finish the Get Big Data Certification in Chennai from Infycle Technologies, the best software training institute in Chennai which is providing professional software courses such as Data Science, Artificial Intelligence, Java, Hadoop, Selenium, Android, and iOS Development, etc with 100% hands-on practical training. Dial 7502633633 to get more info and a free demo and to grab the certification for having a peak rise in your career.

    ReplyDelete
  6. Grab Data Science Certification in Chennai for skyrocketing your career with Infycle Technologies, the best Software Training & Placement institutes in and around Chennai. In addition to the Certification, Infycle also gives the best placement training for personality tests, interview preparation, and mock interviews for leveling up the candidate's grades to a professional level.

    ReplyDelete

Please provide your feedback in the comments section above. Please don't forget to follow.