There is no PageID, there are TabIDs, if you're doing it in the database you would use
select tabId from tabs where tabname = 'pagename'
If you're developing modules, your module should inherit from PortalModuleBase and you will have direct access to the TabId property.