In Salesforce, RecordTypes allow us to group records of the same type for an object. It will enable the customization of page layouts, fields, required fields, and picklist values for different user profiles, as well as restrict field access for layouts and the creation of records.
For example, you can create record types to ensure that a team only sees customer accounts, not partner ones.
Each RecordType in Salesforce is represented by the RecordType object and is associated with standard or custom objects, such as accounts, opportunities, or custom objects.
SOQL Queries to Get RecordType
In the examples below, we will discuss scenarios where we execute SOQL to retrieve the record type names, IDs, and developer names of different objects.
Get Recordtype Name and ID Using SOQL Query
In the SOQL query below, we will retrieve the name and ID of the record type from the account object.
SOQL query:
SELECT Id, Name FROM RecordType WHERE SobjectType = 'Account'
Output:

Get Specific RecordType Details in SOQL query
In the SOQL query below, we retrieve active record types for the Case object, including their name, ID, and developer name, from the active record types.
SOQL query:
SELECT Id, Name, DeveloperName FROM RecordType WHERE SobjectType = 'Case' AND IsActive = true
Output:

Get Salesforce Object Records Assigned to a Record Type using SOQL
Using the SOQL query, we can also retrieve the records related to a specific record type in the Sobject.
Using the SOQL query below, we have retrieved Case records assigned to a specific record type by filtering the records by DeveloperName.
SOQL query:
SELECT id, Priority FROM Case WHERE RecordTypeId IN (SELECT Id FROM RecordType WHERE DeveloperName = 'Sales_Support')