Saturday, March 5, 2011

Working with the Salesforce.com Database

Salesforce.com comes with its own database. Salesforce defines a database as "an organized collection of information". Databases in the real world are used to pile up information about real world objects such as employees, students, account holders, company names, industry related data etc. In a typical database such as an Oracle SQL Server or a  Microsoft SQL Server, a database is a collection of related tables, collectively called a schema. Each table contains information about one subject such as student information, where in the table name will typically be named as 'student' or 'table_student' because student is the main subject of importance in this table. The subject of importance is also known as an entity. When we talk about the same stuff in the world of Salesforce, we call this as an object. So basically we can also say that an object is a category of information.

It is worth to know here that there are pre-built objects in the Salesforce.com platform, that we call as sObjects (a short for Salesforce Objects). Beyond these pre-built objects, developers can create custom objects of their own. Thats the power of Salesforce.

A table is comprised of rows (the records) and columns (the fields). The same way, an object is also comprised of records and fields. 

The Salesforce.com is powered by the Force.com platform, a platform through which applications can be built using in built wizards, or through the combination of Visualforce (the pages) and Apex (the programming language). Apex is leveraged by a query language called SOQL (Salesforce Object Query Language) that allows querying objects in Salesforce.

However, it is important to note that SOQL does allow DML statements (such as insert, update, delete, upsert) but does not allow DDL statements (such as create, drop, alter).

Now that objects have been discussed, lets talk about what are fields. In short, fields are the column headers that signify what data about that object is there in that column. For example, we can have an object by the name "Employee" and we can have fields defined against this object, such as "Employee Name", "Age", "Designation", "DOB", "DOJ", "Department" etc. 

Moving on to the next level, a database comprises of multiple objects. This is to ensure that everything (ie every piece of data) is not packed into one object. For such scenarios, Salesforce.com allows relating tables. For example, we may associate a Manager with an Employee. That means we are talking about two objects here, the Employee object (that will house all the employees information) and the Manager object (that will house all the managers information).

Now to relate objects, we need unique columns in each table. This can be done by marking one column in a table as a primary key, and the corresponding column on the other object as the foreign key. 


In my next posts, I'm going to talk about the different types of relationships that can be created using the Force.com platform. 




1 comment:

  1. The blog gave me idea to work with the database of sales force My sincere thanks for sharing this post and please continue to share this kind of post
    Salesforce Training in Chennai

    ReplyDelete