Relationships are as follows:

Gene-(gene_id)<-GeneInstance?-(na_feature_id)->GeneFeature?-(parent_id)<-ExonFeature? (features have NAlocation)

parent_id is a reference to the primary key

RNA-(RNA_id)<-RNAInstance-(na_feature_id)->RNAFeature-(rna_feature_id)<-RNAFeatureExon->(exon_feature_id) ExonFeature?

RNAFeature points to GeneFeature? through its parent id

RNA-(rna_id)->gene(gene_id)

SQL

query for retrieving all exons for a gene

select e.na_feature_id from dots.exonfeature e, dots.genefeature gf, dots.geneinstance gi, dots.gene g where e.parent_id = gf.na_feature_id and gi.na_feature_id = gf.na_feature_id and gi.gene_id = g.gene_id and g.gene_id = (primary key of gene table)

query for retrieving all exons for an RNA

select e.na_feature_id from dots.exonfeature e, dots.rnafeature rnaf, dots.RNAFeatureExon rfe, dots.rnainstance rnai, dots.rna rna where e.na_feature_id = rfe.exon_feature_id and rfe.rna_feature_id = rnaf.rna_feature_id and rnai.na_feature_id = rnaf.na_feature_id and rnai.rna_id = rna.rna_id and rna.rna_id = (primary key of rna table)

query for retrieving all RNA Features for a GeneFeature?:

select rnaf.rna_feature_id from dots.rnafeature rnaf, dots.geneFeature gf where rnaf.parent_id = gf.na_feature_id