What notation is used for the ER Diagram in Sybase Central?
asked 20 May '12, 15:32
It is simply a "Relational Schema Diagram", and I don't think there are any competing notations with fancy names... it is not Not NOT an ER diagram. See http://myweb.lmu.edu/dondi/share/db/relational1.pdf
Sybase Central's use of the term "entity-relationship diagram" is a complete exaggeration because the only information Sybase Central has to go on is the physical relational database... so it can't draw an ER diagram.
In particular, each physical table is represented by an "entity" box in the diagram. For example, the ml_passthrough table implements a many-to-many relationship between the ml_database and the ml_passthrough_script entities, but all three are shown as entities in the diagram.
-- DBA.ml_passthrough (table_id 752) in SQL Anywhere 12 Demo - May 22 2012 1:08:08PM - Print - Foxhound © 2011 RisingRoad CREATE TABLE DBA.ml_passthrough ( -- empty remote_id /* PK FK */ VARCHAR ( 128 ) NOT NULL, run_order /* PK */ INTEGER NOT NULL, script_id /* FK */ INTEGER NOT NULL, last_modified TIMESTAMP NOT NULL DEFAULT current timestamp, CONSTRAINT ASA134 PRIMARY KEY ( remote_id, run_order ) ); -- Parents of DBA.ml_passthrough -- DBA.ml_database -- DBA.ml_passthrough_script -- Children -- none -- ALTER TABLE DBA.ml_passthrough ADD CONSTRAINT ml_database NOT NULL FOREIGN KEY ( remote_id ) REFERENCES DBA.ml_database ( remote_id ) ON UPDATE RESTRICT ON DELETE RESTRICT; ALTER TABLE DBA.ml_passthrough ADD CONSTRAINT ml_passthrough_script NOT NULL FOREIGN KEY ( script_id ) REFERENCES DBA.ml_passthrough_script ( script_id ) ON UPDATE RESTRICT ON DELETE RESTRICT;
In a serious entity-relationship diagram, it is possible to tell entities apart from relationships; e.g., boxes versus diamonds:
Also, the lines in an entity-relationship diagram show cardinality, whereas all the lines in a relational database diagram represent foreign key relationships which are pretty much all 1-to-many. A "foreign key relationship" is NOT the same as a relationship in an entity-relationship diagram (and to confuse matters further "relation" means "table" in the relational model).
When a logical entity-relationship diagram is implemented as a real-world relational database, a lot of information in the diagram is lost; i.e., it is not recorded in the system tables which define the database. Therefore, it is impossible for Sybase Central, or any computer program, or any human being for that matter, to reconstruct the entity relationship diagram from the physical database... more information is required.
...well, in theory, one could write code in check constraints and triggers that would implement the missing features from the entity-relationship diagram, but nobody does that... they do it in application code, if they do it at all.
Have you got an example of something you don't understand from an ER diagram - you might get an answer if you can clarify the question a bit.
answered 22 May '12, 05:37