I have Three questions 1.) Can you please let me know how to write a SOQL query to get the contact based on a specific record

2.)What is common column name between acount and contact table

3.)How Can i find out how many columns are there in each table in Salesforce so that i can figure out above two questions on my own without troubling u for silly questions


2 Answers 2

  1. You can write a query like :

    Contact con = [Select id,name from Contact where id = 'contactId'];
    Contact con = [Select id,name from Contact where Name = 'contactName'];
  2. For all the fields(columns) for Objects(tables), you can go to following steps:

    -> Click you name at top right

    -> Click Setup from dropdown

    -> In setup panel under 'Customize' you can find various objects including account & contact as well. Under these objects you can find 'Fields' link which shows all the standard fields for that object as well as the custom fields.

For your second Q, I need more clarification what exactly you want to ask.

Hope this may help.


If you use eclipse IDE and create your Project you can see schema of salesforce

enter image description here

Once you expand each row there you will see list of all fields in salesforce .In salesforce you have lookups and master detail relationship to fine common connecting Id .Contact will have a field known as AccountId which is a commont field between Account and Contact.

If you are looking for cloud based solution would recommend to use workbench and login

You will have to use your credential for login to below link


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .