What is composite data type?
A composite data type could be a record, table, nested table, varray. This is so because all of them are composed of multiple data types. For instance, a RECORD has fields, its values etc. Each field has a name and a different data type. A RECORD can have multiple fields whose initial values can be NOT NULL.
Example :Creating a record to store name and id of student:
TYPE student_data IS RECORD
(
First_name VARCHAR(20),
Id NUMBER(2),
);
Create a record type to hold the values declared above:
Student_record student_data;
To access a field: Student_record.id
Assign a value: Student_record.id=1
What is composite data type?
Collections are usually referred to as Composite Data types. Composite type is one that has components in it. A variable of a composite type contains one or more scalar types.