You are on page 1of 55

CS 623 – Database Management Systems

Session 1 Agenda

 Introductions
 Syllabus Review/Team Assignments/Questions
 Review of Week 1 Team Assignment
 Review of the Oracle Database installation
 Chapter 1: Introductory Database Concepts

 This Week’s Assignments (due by the end of Week 1):


 Team Charters
 Chapter 1: Team Project due
CS 623 – Database Management Systems

Introductions

 About Me
 Name: Dr. William J. Buttigieg
 Contact: wbuttigieg@pace.edu (Preferred contact method)
 Phone: 646-220-4734 (Voicemail/Text)
 Office: By Appointment Only

 Introductions
 Name
 Major
 Occupation
 IT Background/Experience
 Student Expectations
CS 623 – Database Management Systems

Syllabus Review

 Textbook
 Databases Illuminated, Third Edition, Hardcover, by Catherine M.
Ricardo and Susan D. Urban, Jones and Barlett Publishers, 2015,
(ISBN-13:9781284056945, ISBN-10:1284056945).

 Required Software:
 Microsoft Project, download from:
https://www.pace.edu/seidenberg/seidenberg-resources
 Microsoft Visio, download from:
https://www.pace.edu/seidenberg/seidenberg-resources
 Oracle Database Express Edition XE 18c, download from:
https://www.oracle.com/database/technologies/xe-downloads.html
CS 623 – Database Management Systems

Syllabus Review (Con’t)

 Course Grade Calculation


 Laboratory Exercises 25%
 Team Project 25%
 Midterm Exam 25%
 Final Exam 25%
CS 623 – Database Management Systems

Syllabus Review (Con’t)

Laboratory Exercises (25% of Grade)


 Laboratory Exercises are individual assignments that allow students
to apply concepts learned from the chapters.
 Laboratory Exercise details may be obtained through Navigate 2
Advantage Access, which is included with the Databases
Illuminated, Third Edition textbook.
 Laboratory Exercises have also be posted in Pace Classes.
 Laboratory Exercises have submissions throughout the semester.
 Laboratory Exercise submissions are due by the end of each week.
Check class schedule for details.
 Laboratory Exercise assignments must be submitted through the
assignment capability in Pace Classes.
CS 623 – Database Management Systems

Syllabus Review (Con’t)

Team Project (25% of Grade)


 Each team is assigned a Team Project (check syllabus)
 Sample Project and Team Project details may be obtained through
Navigate 2 Advantage Access, which is included with the Databases
Illuminated, Third Edition textbook.
 Sample Project and Team Project details have also be posted to the
content section in Pace Classes.
 Team Projects are described in narrative form for each team to
develop a functioning relational database for one of these projects by
the end of the semester.
 Team Projects have submissions throughout the semester.
 Team Projects assignments must be submitted through the
Assignment section in Pace Classes.
CS 623 – Database Management Systems

Syllabus Review (Con’t)

Midterm Exam (25% of Grade)


 The Midterm Exam is a reflection of classroom and book theory,
general concepts, and personal understanding of the material.
 The Midterm Exam will consist of 50 multiple choice questions and will
cover Chapter 1 - Chapter 7 (approximately 7 questions per chapter).
 The Midterm Exam is scheduled for Tuesday, November 2.
 Midterm Exam duration: 90 minutes.
 Students will use Respondus LockDown Browser and
Respondus Monitor to take the exam.
 More guidelines and details on the midterm exam will be posted on
Pace Classes.
 Midterm study guide will be provided.
CS 623 – Database Management Systems

Syllabus Review (Con’t)

Final Exam (25% of Grade)


 The Final Exam is a reflection of classroom and book theory, general
concepts, and personal understanding of the material.
 The Final Exam will consist of 50 multiple choice questions and will
cover Chapter 8 - Chapter 15 (approximately 6 questions per chapter).
 The Final Exam will be available from Tuesday, December 14.
 Final Exam duration: 90 minutes.
 Students will use Respondus LockDown Browser and
Respondus Monitor to take the exam.
 More guidelines and details on the final exam will be posted on Pace
Classes.
 Final Exam study guide will be provided.
CS 623 – Database Management Systems

Team Assignments

 There will be 10 teams: Team 1 – Team 10

If you would like to form your own teams, kindly let me know within
24 hours; otherwise, I will randomly assign the teams.

Note: I will make an announcement in Pace Classes once the teams


have been confirmed.

Note: If you decide to withdraw from the class, kindly let me know so
I can inform your team members and/or make team adjustments.

Note: If there are any class roster changes during the withdraw
period, I will inform the team and update the team assignment
announcement in Pace Classes.
CS 623 – Database Management Systems

Team Charter

Each team will prepare a Team Charter.


Team Charters can be downloaded from the Content section of
Pace Classes.
Teams should elect a Team Leader and it is suggested that
teams have a backup to this role.
Team leader is responsible for making sure that team deadlines
are met.
Team leader should submit on behalf of the team. Only one
submission per team.
Team Charter must be submitted via Pace Classes.

Note: Team Charters are due by the end of Week 1.


CS 623 – Database Management Systems

A note on Team Participation and Participation Points

 Team members are expected to contribute equally on team


assignments.
 Of course there may be times when team members cannot
contribute equally on a particular week. If that is the case, then I
would expect that the team member makes up the time on other
weeks.
 If you are not participating equally, kindly work with your team to
resolve any participation/communication issues as I cannot award
participation points for any weeks where team members have not
participated.
CS 623 – Database Management Systems

Team Peer Evaluations

 Team peer evaluation survey can be downloaded from the Content


section in Pace Classes.
 Each student will submit a team peer evaluation survey where you
will rate the performance of each member of your team and yourself.
 The performance ratings will be used as a factor in determining your
grade.
 Team peer evaluation survey must be submitted by the last day of
class.
CS 623 – Database Management Systems

Note on Submitting Assignments

 Be sure that when you submit your individual and team assignments,
you show your work so that I know that you completed each
exercise. 
 One way to do this is to take a screenshot of your output and paste
your screenshot into the appropriate section of the weekly instruction
doc(s) and submit the instruction doc(s) that contain all of your
screenshots.
 Kindly save all assignments as a .doc or docx.
 Do not compress files.
 Do not submit a pdf files.
CS 623 – Database Management Systems

A note on Late Assignments

 Assignments are due by the end of the week for the weeks specified
in this syllabus.
 All assignments must be submitted through Pace Classes.
 Please ensure that individual and team assignments are submitted
on time so weekly assignments do not conflict with each other and
you have enough time to complete each assignment.
 Late assignments will be penalized with a five (5) point deduction for
each day late unless arrangements are made prior to the due date.
 Any assignments submitted after last day of class will not be
accepted.
CS 623 – Database Management Systems

A note on Academic Honesty

 Students are required to be honest and ethical in satisfying their academic


assignments and requirements.
 Details on Academic Integrity can be found in the syllabus and on the
University website: http://www.pace.edu/student-handbook/university-
policies-disciplinary-and-grievance-procedures
 Laboratory Assignments are individual assignments; therefore, you are to
work on them individually not as a group.
 Any students involved in plagiarism receive no credit for those
assignment(s).
 If there are multiple occurrences of plagiarism, I am suppose to inform the
Chair.


CS 623 – Database Management Systems

Introduction Forum and Question Forum

 Introduction Forum - I created an Introductions Forum in


Activities/Discussions section of Pace Classes so that you can
introduce yourselves to the classroom with the goal of creating a
sense of community among students in the class.

 Question Forum - I created a Questions Forum in


Activities/Discussions section of Pace Classes for any general
questions that may be beneficial to the class; otherwise, you may
contact me directly.
Syllabus Questions?
CS 623 – Database Management Systems

Chapter 1: Team Assignment (due end of week 1)

Step 1.1 - Write out the format of every input document that provides
information to be stored in the database.
Examples: member’s information, sales invoice, mailing list

Step 1.2 - Write out the format of every routine report to be produced
using the database.
Examples: customer report, inventory report, sales report

Step 1.3 - Describe or sketch the input and output screens for routine
transactions to be performed using the database.
Examples: making an appointment, product lookup, bill of sale.
CS 623 – Database Management Systems

Chapter 1: Team Assignment (due end of week 1) – Con’t

Step 1.4 - Write out an initial list of assumptions for the project.
Examples: Determine whether:
 Are donors unique?
 Are play titles unique?
 How many performances are there per day?
 Can a student have more than one degree?
 Can a donor be an alumni?
 What does the address info consist of?
 What do telephone numbers consist of?
 What are the types of payments accepted?
 Can an automobile be financed?
CS 623 – Database Management Systems

Review of Oracle Database Installation

The most recent installation of Oracle 18c Express Edition (XE)


automatically creates a container database as default database.
Prior installations of Oracle provided an option on whether to create
a container or non-container database.

For this class we are going to use a non-container database. To do


this, we need to run the Oracle Database Configuration Assistant to
drop the container database and recreate a non-container database.

Note: We will review this in class and will provide instructions on Pace
Classes
CS 623 – Database Management Systems

Review of MS Project and MS Visio Installation

To download MS Project and MS Visio, do the following:


 Click on the following link, which will take you to the Pace
Seidenberg Resources page:
https://www.pace.edu/seidenberg/seidenberg-resources
 Then click on Microsoft Azure / Accounts
 That will take you to a new page. Under the Azure Dev Tools
Account Information, click on the following link:
https://aka.ms/devtoolsforteaching
 Then click on the Sign In button to login to your account or to create
a new account.
CS 623 – Database Management Systems

Review of MS Project and MS Visio Installation (Con’t)

 Use the search bar to search for Project and Visio (separately).
 If you need to enter the Product Key, you can click on View Key button
before downloading software.
 To download the software, click on the Generate URL button to
generate the download URL.
 Then click on the Copy to Clipboard button (to the right of the URL) to
copy the URL.
 Then open a new Window tab and paste the URL into the address bar
to download the iso file.
 Once the iso file has been downloaded, click on the iso file to open and
unzip the files.
 Once the files have been unzipped, click on setup.exe to install the
software.
CS 623 – Database Management Systems

MacOS

Since Microsoft and Oracle does not run on MacOS, the easiest option
would be to run a Windows emulator on Mac such as Parallels
Desktop and then install your Microsoft/Oracle software inside your
virtual machine.

Oracle alternatives:
 For Oracle, you could install Oracle VM VirtualBox on Mac and then
install Oracle Developer VM inside your virtual machine to get the
Oracle Database.
 Another alternative for Oracle is to sign up for Oracle Database
Cloud service.
CS 623 – Database Management Systems

MacOS (Con’t)

Microsoft alternatives:
 For Microsoft Visio, you can sign up for Visio Plan 1 subscription to
get the web version of Visio to view, create, and edit diagrams in the
Safari or Chrome browser on your Mac.
 For Microsoft Project, you can sign up for Project Plan 1 subscription
to get the web version of Project.
Chapter 1: Introductory Database Concepts

History of Information Systems

1890s:
Punched cards – data was collected and stored on punched
cards. Used for US census data.

1940s:
Punched paper tape – Used to store both data and computer
programs.

1950s:
Magnetic tape – Used for input for early computers including first
commercially available computer: UNIVAC 1.

Note: punched cards, paper tape, magnetic tape are sequential access
devices.
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

1950s (late):
Magnetic disk storage became available which allowed direct
access (non-sequential) access of records possible.

1960s:
Hierarchical database model - Assumes data relationships are
hierarchical (upside down tree structure).
Supports One-to-Many relationships - Each parent can have many
children but a child can only have one parent.
IBM developed this DBMS on an IBM 360 and was called
Information Management System (IMS) written for the Apollo space
mission.
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

1960s (Con’t):
 Network model - allows many-to-many relationships and
appears in the form of a network.
Charles Bachman developed this DBMS known as the Integrated
Database Store (IDS) at Honeywell. The system was
standardized by CODASYL.

1970s:
 Relational model - the database relationships are treated in the
form of a table (columns and rows).
The data can be related to other data in the same table or other
tables which has to be correctly managed by joining one or more
tables. Developed by Edgar F. Codd.
Ex: Oracle, Microsoft SQL Server, IBM DB2, MySQL
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

1970s (Con’t):
Entity Relationship is an example of a semantic model, one that
attempts to capture the meaning of the data it represents.
Developed by Peter Chen in 1976. Mostly used during the design
phase for databases.

1980s:
Spreadsheet like (Lotus 1-2-3) and desktop databases like
dBase, FoxPro
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

1990s:
Object-oriented databases – These databases were designed to
handle the data required for advanced applications such as geographical
information systems, multimedia, computer-aided design and computer-
aided manufacturing (CAD/CAM), and other complex environments.
Object-oriented database examples: ObjectStore, Gemstone, Versant
Object Database, Objectivity/DB, and Caché

Data warehouses – is used to capture data (usually historical data)


consolidated from many databases for the purpose of data mining, which
is a process of analyzing data to find trends in data. Bill Inmon is
considered the father of data warehousing concept and described data
warehousing as “subject-oriented, integrated, time-variant, and non-
volatile collection of data in support of management’s decision-making
process,”
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

2000s:
Extensible Markup Language (XML) is a flexible way to create
information formats and electronically share structured data via the
Internet. XML databases provide a system for storing the data in
XML format.

 Big Data refers to capturing, organizing, and analyzing massive


amounts of data generated by a wide variety of sources (structured
and unstructured data).
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

The 5 Vs of Big Data


 Volume - huge amount of data from wide array of sources
 Velocity - refers to the speed at which the data is being
generated and, therefore, the speed at which it must be
organized, stored, and processed in order to find useful
information.
 Variety – many different formats of the data being generated
 Veracity – refers to the correctness of data; therefore,
measures need to be taken to ensure correctness.
 Value – refers to the competitive advantage that successful
 analysis of big data can bring to a business or organization.
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

Big Data Technologies


 Hadoop – is used to store and process Big Data. Hadoop works by
distributing large data sets and analytics jobs across nodes in a
computing cluster breaking them down into smaller workloads that can
be run in parallel. Hadoop can process structured and unstructured
data and scale up from a single server to thousands of machines.
The core components include Hadoop Distributed File System (HDFS)
and MapReduce parallel programming.
 The Hadoop Distributed File System (HDFS) provides fault tolerance
by dividing large files into blocks and then replicating the blocks within
clusters of nodes and racks.
 The map step of the MapReduce model is used to filter and/or
transform input data into a more appropriate form in preparation for the
Reduce step. The Reduce step is used to perform calculations or
aggregation over the data it receives from the Map steps.
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

Big Data Technologies


 NewSQL is a class of modern relational databases that aims to provide the
same scalable performance of NoSQL systems for online transaction
processing (read-write) workloads while still using SQL and maintaining the
Atomicity, Consistency, Isolation, Durability (ACID) guarantees of a
traditional database system. Ex: VoltDB, Clustrix, MemSQL, and Translattice

 NoSQL databases - designed to process large amounts of data for real-time


query processing and row-level inserts, updates, and deletes. NoSQL
systems provide horizontal scaling with replication and distribution over
servers.
Features include: flexible schema structure, Weaker concurrency model (lax
enforcement of ACID), simple call-level interface for data access, and
support for parallel processing
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

Four basic types of NoSQL databases:


 Document-oriented - designed for storing, retrieving, and managing
document-oriented (semi-structured) information.
Ex: MongoDB, Amazon Dynamo DB

 Column-oriented - designed for storing data as portions of columns,


instead of as rows.
Ex: Cloudera, Cassandra, and HBase (Hadoop based).

 Key-value - is useful for shopping cart data or storing user profiles. All
access to the database is done using a primary key. Ex: Riak, Berkeley
DB, and Aerospike

 Graph - is useful for managing relationships between entities. Ex:


Neo4j, GraphBase, and Titan.
Chapter 1: Introductory Database Concepts

History of Information Systems (Con’t)

 Cloud Databases - A database that has been optimized or built for


virtualized environment in a public cloud, hybrid cloud, or private
cloud. Cloud databases provide benefits such as the ability to pay for
storage capacity and bandwidth on a per-use basis, and they provide
scalability on demand, along with high availability.
Ex: AWS, Oracle Cloud, Microsoft Azure, Rackspace
Chapter 1: Introductory Database Concepts

Database Fundamentals

Database is a collection of data that is organized so that it can be easily


accessed, managed and updated.

Data is organized into rows, columns and tables, and it is indexed to


make it quicker and easier to find and retrieve relevant information.

Databases are used in small, medium, and large organizations. Database


Application examples include:
 Consumer websites
 Travel reservations
 Banking
 Health care
 Manufacturing
 Human Resources
Chapter 1: Introductory Database Concepts

Databases and Information Management

Database Management System (DBMS) is the system software for


creating and managing databases.

The DBMS essentially serves as the interface between applications


and database to define, manipulate, retrieve, and manage data
stored in the database.

Structured Query Language (SQL) is the standard user and


application program interface to add, change, delete, retrieve data
from database.
Chapter 1: Introductory Database Concepts

Designing Databases

When designing databases, you must understand:


 the relationships among the data
 the type of data that will be maintained in the database
 how the data will be used
 how the organization will need to change to manage data from a
company-wide perspective.

The database requires both a logical design and a physical design:


 The logical design of a database is an abstract model of the
database from a business perspective.
 The physical design shows how the database is actually arranged
on direct-access storage devices.
Chapter 1: Introductory Database Concepts

Advantages of Database Management Systems

 Controlling redundancy in data storage


 Enforcing data integrity on the database
 Sharing of data among multiple users
 Potential for enforcing standards
 Flexibility to change data structures
 Availability of up-to-date information
 Restricting unauthorized access to data
 Providing backup and recovery services
 Data Security (encryption, auditing)
Chapter 1: Introductory Database Concepts

Disadvantages of Database Management Systems

 Costs – Hardware, software, ongoing licensing costs.


 Extremely complex software.
 Highly technical staff.
 Frequent upgrades, patches.
 Availability of up-to-date information.
 Performance Tuning
Chapter 1: Introductory Database Concepts

People involved in Database Management Systems

 End Users are the people who use the data/database to perform
their jobs.
 Naïve Users – access the database through the applications.
 Casual (sophisticated) Users not only access the database through
the application but also have enough knowledge to use query
language to access the data.
 Application Programmers are the people who write the
applications for the end users to use.
 Database Administrator is the individual or group that is
responsible for designing, implementing, administrating, and
maintaining the database.
Chapter 1: Introductory Database Concepts

Responsibilities of Database Administrator

 Installation and configuration of database software.


 Create tablespaces and datafiles
 Create and manage user accounts
 Granting and revoking table/user access
 Encryption, masking, database security
 Performance Tuning
 Configure Backups and Restore Database (as needed)
 Work with Developers (database design / optimal SQL code)
 Stay Current (New Features)
 Initiate Service Requests
 Liaise with System Administrators (disk space, processing power)
Chapter 1: Introductory Database Concepts

Object Privileges (Usually performed by DBA)

SELECT – this privilege allows users to select (retrieve) data from


tables. Ex: SQL> grant select on student to <username>;

INSERT – this privilege allows users to insert (create) rows in tables.


Ex: SQL> grant insert on student to <username>;

DELETE – this privilege allows users to delete data from tables.


Ex: SQL> grant delete on student to <username>;

UPDATE – this privilege allows users to select (retrieve) your data.


Ex: SQL> grant update on student to <username>;

WITH GRANT OPTION – An owner of an object can grant the


privilege(s) to another user who can grant the same level of access
to another user.
Chapter 1: Introductory Database Concepts

System Privileges (Usually performed by DBA)

ALTER SYSTEM is used to dynamically alter database.


Ex: database parameters, killing sessions

CREATE USER: this privilege creates user.


Ex: SQL> create user <username> identified by <password>;

ALTER USER: this privilege is used for authentication or database


resource characteristics. Ex: changing password / tablespace.

GRANT CONNECT: Allows user to connect to database.

GRANT RESOURCE: Allows user to create objects in their schema

GRANT ROLE: Instead of granting individual grants to user you can


grant to the role and then just grant the role to the user.
Chapter 1: Introductory Database Concepts

Database Terms

Tables is a logical structure made up of rows and columns.


 Rows are the individual records. They have no fixed order so would
need to sorted (indexed) when retrieving.
 Columns correspond to the attributes. The order of the columns are
specified when creating the tables.

Data Types:
 CHAR – Fixed length character string.
 VARCHAR2 – Variable length character string.
 NUMBER - Allows storing of an integer and integer/decimal.
 DATE - stores the date and time information.
 CLOB - stores storage of very large objects > 4 gigabytes.
 BLOB - stores unstructured binary data. Ex: sound and video.
Chapter 1: Introductory Database Concepts

Database Terms (Con’t)

Primary keys is what makes a row of data unique in a table.


Ex: StuID. Table can only have 1 primary key.

Unique keys is a different unique key on the table.


Ex: SocialSecurity#

Foreign keys is the primary key of one table that is stored inside another
table. The foreign key connects the two tables together.
Ex: student table (StuID) and enroll table (StuID)

Constraint enforces certain aspects of data integrity within a databases.


Ex: NOT NULL constraint enforces a value.
Check Constraint enforces: YES or NO / TRUE or FALSE

Index is an ordered set of pointers to rows on the table.


Chapter 1: Introductory Database Concepts

Database Terms (Con’t)

Views is a predefined subset of one or more tables.

Triggers is a stored object that executes based on the execution of a


database event. Ex: Capturing the date and time of a transaction.

Procedure takes a set of inputs and performs an action based on


those inputs.

Function is a subprogram that is mainly used to compute and return a


single value.

Package is a group of procedures and functions stored together for


continued use as a unit.
Chapter 1: Introductory Database Concepts

Simple University Database

Keeps information about:


 Students – each row represents one student.
 Classes – each row represents one class.
 Faculty – each row represents on faculty.
 Enrollment – represents the relationship between one student and
one class.
Chapter 1: Introductory Database Concepts

University Sample Database

Student Table Faculty Table

Enroll Table

Class Table
Chapter 1: Introductory Database Concepts

University Sample Database Table DDL


CREATE TABLE Student (
stuId VARCHAR2(6) NOT NULL,
lastName VARCHAR2(20) NOT NULL,
firstName VARCHAR2(20) NOT NULL,
major VARCHAR2(10),
credits NUMBER(3) DEFAULT 0,
CONSTRAINT Student_stuId_pk PRIMARY KEY (stuId),
CONSTRAINT Student_credits_cc CHECK ((credits>=0) AND (credits < 150)));

CREATE TABLE Faculty (


facId VARCHAR2(6) NOT NULL,
name VARCHAR2(20) NOT NULL,
department VARCHAR2(20),
rank VARCHAR2(10),
CONSTRAINT Faculty_facId_pk PRIMARY KEY (facId));
Chapter 1: Introductory Database Concepts

University Sample Database Table DDL (Con’t)


CREATE TABLE Class (
classNumber VARCHAR2(8) NOT NULL,
facId VARCHAR2(6),
Schedule VARCHAR2(8),
room VARCHAR2(6),
CONSTRAINT Class_classNumber_pk PRIMARY KEY (classNumber),
CONSTRAINT Class_schedule_room_uk UNIQUE (schedule, room),
CONSTRAINT class_facId_fk FOREIGN KEY (facid)
REFERENCES Faculty (facId) ON DELETE CASCADE);

CREATE TABLE Enroll (


stuId VARCHAR2(6) NOT NULL,
classNumber VARCHAR2(8) NOT NULL,
Grade VARCHAR2(2),
CONSTRAINT Enroll_classNumber_stuId_pk PRIMARY KEY (classNumber,stuId),
CONSTRAINT Enroll_classNumber_fk FOREIGN KEY (classNumber)
REFERENCES Class (classNumber) ON DELETE CASCADE,
CONSTRAINT Enroll_stuId_fk FOREIGN KEY (stuId)
REFERENCES Student(stuId) ON DELETE CASCADE);
Chapter 1: Introductory Database Concepts

Relationship Types

One-to-one: X:Y is 1:1 is each entity in X is associated with at most one


entity in Y and each entity in Y with at most one entity in X.
Example: Each student has only one student ID, and each student ID is
assigned to only one person.

One-to-many: X:Y is 1:M is each entity in X can be associated with many


entities in Y, but each entity in Y with at most one entity in X.
(many=more than one)
Example: University (primary table) can have many students (dependent
table). A student cannot study in multiple universities at the same time.

Many-to-many: X:Y is M:M if each entity in X can be associated with


many entities in Y, and each entity in Y with many entities in X
Example: A student can register for many classes, and a class can
include many students.
Chapter 1: Introductory Database Concepts

Relationship Types (Con’t)


Chapter 1: Introductory Database Concepts

University Sample Database Table Foreign Constraints

 Enroll (stuId) has a foreign key to Student (stuId)


 Enroll (classNo) has a foreign key to Class (classNo)
 Class (facId) has a foreign key to Faculty (facId)
Chapter 1 Questions?

You might also like