Hi Manisha,
I don't think that way data is stored, the NSQL queries are stored in table CMN_GG_NSQL_queries and portlet details are stored in CMN_portlets.
Here is a an example but this will only work if you have portlet code and query code same which is in case for out of box portlets and queries.
select * from CMN_portlets a, CMN_GG_NSQL_queries b
where a.portlet_code = b.query_code
Regards
Suman Pramanik