university of houston–clear lakedcm.uhcl.edu/yue/courses/csci4333/spring2019/demo/… · web...

7
2/11/2019 ER Description: A student has a unique student id and can enroll in any number of classes . ER Basic Options: 1. Entity: entity instance: object; has many attributes, form associations, exists by itself,.. 2. Relationship: association between objects 3. Attribute: property of an entity: has a single value, may not exist on its own, may not form associations, … 4. Nothing: no data requirement Secondary constructs: 1. Cardinality 2. PK 3. Unique 4. Null 5. Data types (may include user-defined types) Student : Entity

Upload: others

Post on 23-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: University of Houston–Clear Lakedcm.uhcl.edu/yue/courses/csci4333/spring2019/demo/… · Web viewAn account contains an unique id serving as the key, and an unique username and

2/11/2019

ER

Description: A student has a unique student id and can enroll in any number of classes.ER Basic Options:1. Entity: entity instance: object; has many attributes, form associations, exists by itself,.. 2. Relationship: association between objects3. Attribute: property of an entity: has a single value, may not exist on its own, may not form

associations, …4. Nothing: no data requirement

Secondary constructs:

1. Cardinality2. PK3. Unique4. Null5. Data types (may include user-defined types)

Student: Entity

Page 2: University of Houston–Clear Lakedcm.uhcl.edu/yue/courses/csci4333/spring2019/demo/… · Web viewAn account contains an unique id serving as the key, and an unique username and

student id: has a value; 1234512: attribute (single value, not independently existing)

unique: adjective describing student_id: PY of student

Page 3: University of Houston–Clear Lakedcm.uhcl.edu/yue/courses/csci4333/spring2019/demo/… · Web viewAn account contains an unique id serving as the key, and an unique username and

Class: entity (classes have many properties…)

“can enroll in any number of classes.”:Enroll: relationship between a student and a class.

any number of classes: cardinality.Assume a class can have 0 or more students.

Page 4: University of Houston–Clear Lakedcm.uhcl.edu/yue/courses/csci4333/spring2019/demo/… · Web viewAn account contains an unique id serving as the key, and an unique username and

Some Disadvantages of ER diagrams:

1. Limited expressiveness: only for RDBMS2. Not concise: Chen: Attributes in ovals.3. Can be ambiguous4. No standards: many versions that can be confusing (know your ER version).5. Mostly for relational database only.

Any people can become a member of GG.

Concepts:

1. People: ? Do they have the same functionality? Have the same properties and relationship?

2. Become: wait until 1.3. Member: entity (26 occurrences; important concept)4. GG: entity? Are there many instances? Many properties? …

They will need to provide a first name, a last name, an email address and an optional phone.

Concepts:

1. First name: property of a student, attribute.2. Last name: property of a student, attribute.3. Email: property of a student, attribute.4. Phone: property of a student, attribute.5. Optional: descriptor of phone (allow null).

Specify data type.

Page 5: University of Houston–Clear Lakedcm.uhcl.edu/yue/courses/csci4333/spring2019/demo/… · Web viewAn account contains an unique id serving as the key, and an unique username and

GG stores the time a person joining GG.

Concept:

JoinTime: attribute of Member.

A member has an unique id.

Concept:

Id: attr of member. Unique: PK

A member must have an account to access GG member pages.

Concepts:

1. Account:a. Attribute of members: username, passwordb. Relationship: between a member and a pagec. Entity: d. N/A

2. Pages: input/output requirements.

An account contains an unique id serving as the key, and an unique username and password for logging on. There are many types of users (such as administrators, etc.) of accounts. These other kinds of accounts need not be modeled in this assignment. GG stores the previous old passwords for all accounts and the times these passwords were set. This is used for the purposes that account holders do not reuse old passwords.

For example, the account 1269487 may have the following history of passwords (encrypted when stored):

1. current password: hahasui19$$$90, since 9/12/2017 4:35.27pm2. former old password: $$suihaha2001, since 3/2/2017 11:11.27am3. former old password: hasuiha__65, since 1/3/2016 5:07.64pm

Page 6: University of Houston–Clear Lakedcm.uhcl.edu/yue/courses/csci4333/spring2019/demo/… · Web viewAn account contains an unique id serving as the key, and an unique username and
Page 7: University of Houston–Clear Lakedcm.uhcl.edu/yue/courses/csci4333/spring2019/demo/… · Web viewAn account contains an unique id serving as the key, and an unique username and