Database Management: Entities, Relationships, and Primary Keys, Lecture notes of Database Management Systems (DBMS)

An introduction to databases, explaining what they are and why they are used. It covers the basics of database structure, including entities, tables, columns, primary keys, and foreign keys. The document also introduces the concept of Entity Relationship (ER) diagrams and provides guidelines for naming and defining entity types and attributes.

Typology: Lecture notes

2020/2021

Uploaded on 05/18/2021

7ossam
7ossam 🇪🇬

1 document

1 / 26

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction to Database
IS 312
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Database Management: Entities, Relationships, and Primary Keys and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity!

Introduction to Database

IS 312

What Is a Database?

Database is a computer technique that

store and retrieve data effectively(e.g.

ATM)

A database is a collection of tables

Database Structure

. Entity , Table , Relation

. Row , Tuple , Record

. Column, Field , Attribute

. Relationship between Tables

. Primary Key

. Foreign Key

Entity Relationship (ER) Diagram

A detailed, logical representation of the

entities, associations and data

elements for an organization or business

Notation uses three main constructs

Data entities

Relationships

Attributes

Chen Model & Crow’s Foot Model

Entities

: Examples of entities Person: EMPLOYEE, STUDENT, PATIENT Place: STORE, WAREHOUSE Object: MACHINE, PRODUCT, CAR Event: SALE,REGISTRATION, RENEWAL Concept: ACCOUNT, COURSE Guidelines for naming and defining : entity types An entity type name is a singular noun An entity type should be descriptive and specific An entity name should be concise

Attributes

: Example of entity types and associated attributes

STUDENT: Student _ ID, Student _ Name, Home _ Address, Phone _ Number, Major

: Guidelines for naming attributes

. An attribute name is a noun An attribute name should be unique To make an attribute name unique and clear, each attribute name should follow a standard format Similar attributes of different entity types should use similar but distinguishing names

Cardinality and

Connectivity

Relationships can be classified as either

one – to – one
one – to – many
many – to –many

Cardinality : minimum and maximum number of instances of Entity B that can (or must be) associated with each instance of

. entity A

Connectivity

Professor teaches Class 1 M Connectivity )1,1 ( )1,4( Cardinality

Mandatory vs. Optional Cardinalities Specifies whether an instance must exist or can be absent in the relationship

. A Lecturer may handle zero or many classes . A class is handled by one and only one Lecturer MandatoryMandatory Optional Optional Lecturer Class )1,1 ( (N, 0 ) handles (^1) M

Binary

Relationships

relationship 1: A single entity instance in one entity class is related to a single entity instance in another entity class Could indicate that two entities actually belong in the same table

M relationship: 1

Relational modeling ideal

Should be the norm in any relational

database design

The 1: M relationship between PAINTER and PAINTING

M:N relationships Must be avoided because they lead to data

. redundancies Can be implemented by breaking it up to produce a set of 1:M relationships Can avoid problems inherent to M:N relationship by creating a composite entity or bridge entity This will be used to link the tables that were originally related in a M:N relationship The composite entity structure includes-as f oreign keys-at least the primary keys of the . tables that are to be linked