Generating shop URL


I am writing a PHP script, which would do the exporting of the OXID database to a specific format based purely on Database SQL queries, and need to supply the URLs to the products. Is there a set of rules how to generate the URL for a specific language based purely on the information contained in the database?

you can join seo urls from oxseo table

Thanks! Works!