[BioSQL-l] Tables without a (composite) primary key
Peter
biopython at maubp.freeserve.co.uk
Thu Nov 6 06:53:13 EST 2008
I've recently been looking into some object-relational mappers which
caused me to look more closely at the BioSQL schema. Many of these
packages require a primary key, but not all can cope with a composite
primary key. However, some BioSQL tables don't have any primary key
at all.
Several BioSQL tables have composite primary keys, for example the
term_dbxref table has a composite key of (term_id, dbxref_id), and
also an index on dbxref_id as well.
However, some BioSQL tables do not have a primary key, for example:
-- corresponds to the names table of the NCBI taxonomy databaase
CREATE TABLE taxon_name (
taxon_id INT(10) UNSIGNED NOT NULL,
name VARCHAR(255) BINARY NOT NULL,
name_class VARCHAR(32) BINARY NOT NULL,
UNIQUE (taxon_id,name,name_class)
) TYPE=INNODB;
CREATE INDEX taxnametaxonid ON taxon_name(taxon_id);
CREATE INDEX taxnamename ON taxon_name(name);
Why don't taxon_name, bioentry_path, term_relationship,
bioentry_qualifier_value, seqfeature_path have a primary key (just a
uniqueness criteria)?
Thanks,
Peter
More information about the BioSQL-l
mailing list