One to Many Relationship (1:M) A single entity instance in one entity class (parent) is related to multiple entity instances in another entity class (child) For example: One instructor can teach many courses, but one course can only be taught by one instructor. One instructor may teach many students in one class, ...
For storing records or data sets, the CS215 labs use Hercules to work with a MySQL database . The following provides instructions to create your first MySQL database account.
Data modeling is a technique to document a software system using diagrams and symbols. It is used to represent communication of data. The highest level of abstraction for the data model is called the Entity Relationship Diagram (ERD). It is a graphical representation of data requirements for a database.
Entities are the basic objects of ERDs. These are the tables of your database. Entity are nouns and the types usually fall into five classes: concepts, locations, roles, events or things.#N#For example: students, courses, books, campus, employees, payment, projects.
Attributes are facts or description of entities. They are also often nouns and become the columns of the table. For example, for entity student, the attributes can be first name, last name, email, address and phone numbers.
Primary Key. Primary Key* or identifier is an attribute or a set of attributes that uniquely identifies an instance of the entity. For example, for a student entity, student number is the primary key since no two students have the same student number. We can have only one primary key in a table.
Foreign key. A foreign key+ (sometimes called a referencing key) is a key used to link two tables together. Typically you take the primary key field from one table and insert it into the other table where it becomes a foreign key (it remains a primary key in the original table).