Or if you want GenBank (EMBL) accession numbers instead:
mysql> SELECT transcript.stable_id, xref.display_label
> FROM translation, transcript, object_xref, xref,external_db
> WHERE transcript.transcript_id = translation.transcript_id
> AND translation.translation_id = object_xref.ensembl_id
> AND object_xref.ensembl_object_type = 'Translation'
> AND object_xref.xref_id = xref.xref_id
> AND xref.external_db_id = external_db.external_db_id
> AND external_db.db_name = 'EMBL';
Are you looking to store ENS and NM ids for the same sequence? Or do you wanna store GenBank and ENSEMBL entries?
Hmm, I guess the latter. I've been looking through the GenBank data files, and they have large data files for each chromosome. These files do have ENST -> NM_ mappings for every trancsript on each chromosome, however I feel like using these data files would not be efficient. Not only are they large and take a fairly long time to download, but also parser scripts would take quite a while even though I simply want to create a tab-delimited txt file where the ENST id would be the first tab, and its corresponding NM_ id would be in the second tab.
I'd suggest tinkering with UCSC Genome Browser's mysql database. You should be able to write a query/script that, given ID1, does a bunch of SELECTs for ID2.