The Second Lab

ER Diagram

Sepy 11, 2015

(I) Connect to CS Server

        Linux :

  •         (1) Open the Terminal .
  •         (2) Type ssh [username]@csa2.bu.edu .
  •         (3) Enter your password (hidden).

        Mac :

  •         (1) Open the Terminal .
  •         (2) Type ssh [username]@csa2.bu.edu .
  •         (3) Enter your password (hidden).

        Windows :

  •         (1) Download putty.exe
  •         (2) Open the PuTTY .
  •         (3) Type [username]@csa2.bu.edu in Host Name. Leave "Port" as 22 and "Connection type" as SSH.
  •         (4) Enter your password (hidden).

        * You may also connect to csa3 instead of csa2 .


(II) Submit a Text File to gsubmit System

        After logon to csa2 or csa3 server:

  •         (1) Type ls to vew your files.
  •         (2) Type mkdir LAB1 to make a new folder for the submission of this lab.
  •         (3) Type cd LAB1 to enter the folder.
  •         (4) Create a new text file lab1_report.txt (You can use vim to create this file).
    •                 (a) Type vim lab1_report.txt to open the text file.
    •                 (b) Type a to enter the inserting mode.
    •                 (c) Enter your BU ID, Name and Department.
    •                 (d) Press ESC button to escape the inserting mode.
    •                 (e) Type :wq to save and exit.
  •         (5) Type cd ..
  •         (6) Type gsubmit cs460 LAB1 to submit the folder LAB1 and the file LAB1/lab1_report.txt
  •         (7) Type gsubmit cs460 -ls to check the files you just submitted.
  •         (8) Type gsubmit cs460 -cat LAB1/lab1_report.txt to read the file you created.

        * Graduate students use cs660 instead of cs460 .


(III) Entity Relationship Model

  •         (1) Entity Relationship Model:
                            An abstract conceptual data model used in software engineering to represent structured data.
                            More references can be found here

  •         (2) Entity:
                            An entity is a real-world thing.
                            An entity has attributes.

  •         (3) Relationship:
                            A relationship connects two or more entities.
                            A relationship can also have attributes.

  •         (4) Mapping:
                            One-to-One Mapping.
                            Many-to-One Mapping.
                            One-to-Many Mapping.
                            Many-to-Many Mapping.

  •         (5) Key:
                            Primary Key.
                            Super Key.
                            Foreign Key.
                            Candidate Key.

  •         (6) Special Cases:
                            Weak Entity
                            Total Participation

  •         (7) ER Diagram:
                            Remember the symbols

  •         (7) Draw ER Diagram:
                            Windows : Microsoft Office - PowerPonit or Visio
                                            (1) Insert Shapes; (2) Export as JPG or PNG
                            Linux :         LibreOffice           - Draw
                                            (1) Basic Shapes; (2) Export as JPG or PNG
                            Mac :           Keynote
                                            (1) Insert Shapes; (2) Export images as JPG or PNG
                            Web :         Online ER Diagram Drawer


(IV) ER Diagram Example

        Teams, Players and Plays

  •         (1) Player (Entity):
                            Each player has a name, a date of birth and a position.

  •         (2) Team (Entity):
                            Each team has a name and a location.

  •         (3) Play (Relationship):
                            Each play has a date, a time and a result.
                            Each play connects exactly two teams.

  •         (4) Player - Team (Relationship):
                            Each player can only belong to one team; Each team may have multiple players

  •         (5) ER Diagram:

  • ER Diagram Example