ERDPLUS

One tool I generally use when working on a projects, mini tasks and exploration is the ERDPLUS tool . It is quite simple and easy to use.

It is a Free tool as well.

Below are some diagrams I generated when i first got in contact with with tool.

ERD DIAGRAMS:

1.

erdplus-diagram-1

2.  A simple HealthCare Organisation Entity Relationship Diagram (ERD)

healthcare-organisation-erd

healthcare

RELATIONAL SCHEMAS

  1. customer_facility_location-relational-schema

Associated Generated SQL code from ERDPlus

CREATE TABLE Customer
(
  Custno VARCHAR(10) NOT NULL,
  custname VARCHAR(255) NOT NULL,
  address VARCHAR(255) NOT NULL,
  Internal CHAR(1) NOT NULL,
  phone INT NOT NULL,
  contact VARCHAR(255) NOT NULL,
  city VARCHAR(255) NOT NULL,
  state CHAR(2) NOT NULL,
  zip CHAR(6) NOT NULL,
  PRIMARY KEY (Custno)
);

CREATE TABLE Facility
(
  facno VARCHAR(20) NOT NULL,
  facname VARCHAR(255) NOT NULL,
  PRIMARY KEY (facno)
);

CREATE TABLE Location
(
  locno VARCHAR(20) NOT NULL,
  locname VARCHAR(255) NOT NULL,
  facno VARCHAR(20) NOT NULL,
  PRIMARY KEY (locno),
  FOREIGN KEY (facno) REFERENCES Facility(facno)
);

 

2.erdplus-diagram

Associated Generated SQL code from ERDPlus

CREATE TABLE LOCATION
(
  LID INT NOT NULL,
  LNAME INT NOT NULL,
  PRIMARY KEY (LID)
);

CREATE TABLE PROJECT
(
  PID INT NOT NULL,
  PNAME INT NOT NULL,
  LID INT NOT NULL,
  PRIMARY KEY (PID),
  FOREIGN KEY (LID) REFERENCES LOCATION(LID)
);

CREATE TABLE EMPLOYEE
(
  EID INT NOT NULL,
  ENAME INT NOT NULL,
  PRIMARY KEY (EID)
);

CREATE TABLE works_on
(
  NumOfHours INT NOT NULL,
  PID INT NOT NULL,
  EID INT NOT NULL,
  PRIMARY KEY (PID, EID),
  FOREIGN KEY (PID) REFERENCES PROJECT(PID),
  FOREIGN KEY (EID) REFERENCES EMPLOYEE(EID)
);

 

3. sales_transaction

Associated Generated SQL code from ERDPlus

CREATE TABLE VENDOR
(
  VENDORID INT NOT NULL,
  VENDORNAME INT NOT NULL,
  PRIMARY KEY (VENDORID)
);

CREATE TABLE PRODUCT
(
  PRODUCTID INT NOT NULL,
  PRODUCTNAME INT NOT NULL,
  PRODUCTPRICE INT NOT NULL,
  VENDORID INT NOT NULL,
  PRIMARY KEY (PRODUCTID),
  FOREIGN KEY (VENDORID) REFERENCES VENDOR(VENDORID)
);

CREATE TABLE SALES_TRANSACTION
(
  TID INT NOT NULL,
  TDATE INT NOT NULL,
  PRIMARY KEY (TID)
);

CREATE TABLE SOLDVIA
(
  NoOfItems INT NOT NULL,
  PRODUCTID INT NOT NULL,
  TID INT NOT NULL,
  PRIMARY KEY (PRODUCTID, TID),
  FOREIGN KEY (PRODUCTID) REFERENCES PRODUCT(PRODUCTID),
  FOREIGN KEY (TID) REFERENCES SALES_TRANSACTION(TID)
);

This tool can really help make your work straightforward and it is good for practicing too.

 

ER ASSISTANT

A second tool which is also powerful is ER ASSISTANT. This is a downloadable and installable software and once you get your way round it, it is very powerful.

It can check for errors in your ER Diagram and let you know what errors there are so you can fix them.

It is also very handy. Check the tutorial on using ER Assistant here

Below is a screenshot of ER Diagram using ER Assistant

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *