Documente Academic
Documente Profesional
Documente Cultură
Slide 3- 8
Entity Type CAR with two keys and a
corresponding Entity Set
Slide 3- 9
Attributes
• Attributes are facts, • Attributes have
aspects, properties, • A name
or details about an • An associated entity
entity • Domains of possible
• Students have IDs, values
names, courses, • Values from the
addresses, … domain for each
• Modules have codes, instance of the entity
titles, credit weights, they are belong to
levels, …
Slide 3- 12
Relationships
• Relationships are an • Relationships have
association between • A name
two or more entities • A set of entities that
• Each Student takes participate in them
several Modules • A degree - the
• Each Module is taught number of entities
by a Lecturer that participate (most
• Each Employee works have degree 2)
for a single • A cardinality ratio
Department
Slide 3- 15
Many-to-many (M:N)
Relationship
Slide 3- 16
A Recursive Relationship
Supervision`
Slide 3- 17
Diagramming Relationships
• Relationships are Lecturer ID
One Many
Slide 3- 20
Example
A university consists of a number of
departments. Each department offers several
courses. A number of modules make up each
course. Students enrol in a particular course
and take modules towards the completion of
that course. Each module is taught by a
lecturer from the appropriate department, and
each lecturer tutors a group of students
Student
Student
Student
Enrols In Student
Takes
Enrols In Student
Takes
Enrols In Student
Takes
Enrols In Student
Takes
Takes
Description Product
Street address
Description Product
Slide 7- 39
FIGURE 7.2
Result of mapping the COMPANY ER schema into a relational
schema.
Slide 7- 40
Next Lecture
• SQL
• The SQL language
• SQL, the relational model, and E/R diagrams
• CREATE TABLE
• Columns
• Primary Keys
• Foreign Keys