I was exploring the new hype today, I found Facebook Developers Documentation very interesting. Facebook API can be queries using FQL – Facebook Query Language, which is similar to SQL.
Facebook list following advantages of FQL:
- Condensed XML reduces bandwidth and parsing costs.
- More complex requests can reduce the number of requests necessary.
- Provides a single, consistent, unified interface for all of your data.
- It’s fun!
A sample query in FQL looks like
SELECT concat(first_name, substr(last_name, 0, 1), " is from " UPPER(hometown_location.city), ", yo", status FROM USER WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = [uid]) AND strlen(hometown_location.city) > 0 AND status.time > now() - 3600*6
Refer the FQL documentation for table list, which can be used in FROM clause for query as well functions and operators allowed in FQL. FQL does not support complex tables, joins yet. I am quite impressed with the new attempt to have SQL like query in Facebook.
UPDATE (As per Facebook): On August 17, 2016, FQL will no longer be available and cannot be queried. To migrate your app, use theAPI Upgrade Tool to see the Graph API calls you can make instead.
Reference : Pinal Dave (http://blog.SQLAuthority.com)