Overview of Database Systems

Slides:



Advertisements
Similar presentations
Overview of Database Systems CPSC 315 – Programming Studio Spring 2009 Team Project 1, Lecture 1.
Advertisements

System Concepts and Architecture Rose-Hulman Institute of Technology Curt Clifton.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Week 3 Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Spring 2008 Project 1, Lecture 3 Slides adapted from those used by Jeffrey Ullman, via Jennifer.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes 1.
Introduction to Data bases concepts
SQL Overview Defining a Schema CPSC 315 – Programming Studio Slides adapted from those used by Jeffrey Ullman, via Jennifer Welch Via Yoonsuck Choe.
Relational Databases CPSC 315 – Programming Studio Spring 2013 Project 1, Lecture 2 Slides adapted from those used by Jeffrey Ullman, via Jennifer Welch.
CS 405G: Introduction to Database Systems Lecture 2 : Database Design I.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
Entity-Relationship Model
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles.
A short revision on entity- relationship modelling.
A short review on entity- relationship modelling.
CS422 Principles of Database Systems Entity-Relationship Model Chengyu Sun California State University, Los Angeles Adapted from Jeffrey Ullman’s lecture.
CS422 Principles of Database Systems Entity-Relationship Model
COP Introduction to Database Structures
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Comp 1100 Entity-Relationship (ER) Model
Data Modeling Using the Entity- Relationship (ER) Model
CPSC-310 Database Systems
Databases (CS507) CHAPTER 7.
CS4222 Principles of Database System
Data Modeling Using the Entity- Relationship (ER) Model
Lecture 5: Conceptual Database Design
Entity-Relationship Model
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
Entity Relationship Model
COP4710 Database Systems E-R Model.
Datab ase Systems Week 1 by Zohaib Jan.
MODELS OF DATABASE AND DATABASE DESIGN
Storage and Indexes Chapter 8 & 9
Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Constraints in Entity-Relationship Models
CPSC-310 Database Systems
CPSC-608 Database Systems
Relational Algebra Chapter 4, Part A
The Entity-Relationship Model
Modeling Your Data Chapter 2 cs542
Instructor: Zhe He Department of Computer Science
Instructor: Elke Rundensteiner
CPSC 315 – Programming Studio Fall 2009 Project 1, Lecture 2
CSCE 315, Fall 2017 Project 1, Lecture 2
CPSC-310 Database Systems
From ER to Relational Model
Overview of Database Systems
The Entity-Relationship Model
Database Fundamentals
Lecture 4: Database Modeling (continued)
Overview of Database Systems
The Entity-Relationship Model
Entity Relationship Diagrams
SQL OVERVIEW DEFINING A SCHEMA
Entity-Relationship Model
Relational Algebra Chapter 4, Sections 4.1 – 4.2
name category name price makes Company Product stockprice buys employs
The Entity-Relationship Model
Session 2 Welcome: The fifth learning sequence
Overview of Database Systems
Lecture 9: The E/R Model II
Chapter 1: Introduction
MIS2502: Data Analytics Relational Data Modeling
CS4433 Database Systems E-R Model.
The Entity-Relationship Model
The Entity-Relationship Model
Session 5: Weak Entity Sets and ER Model to Relational ( )
The Entity-Relationship (ER) Model
Presentation transcript:

Overview of Database Systems CPSC 315 – Programming Studio Spring 2017 Project 1, Lecture 1

Project Your first project (next week) will involve putting together a very basic database system There will be a few lectures to give you an overview of database systems This is nowhere close to what you would get in a full database course Slides adapted from Jennifer Welch (some of hers were from Jeffrey Ullman)

Database Systems Systems designed to manage very large amounts of data, and to query that data to pull out useful information Often, key considerations include: Efficiency Reliability Ease of access (querying, distributed)

Databases A critical part of most IT operations Accessing database information can be as common as accessing any variable/object stored in memory But, the process for accessing it is different This can be good in that it helps highlight the difference with data in memory.

Creating a Database A database schema determines what will be represented in the database This should be tightly controlled by a database manager Specified through a data definition language

Querying Databases Once database has been populated, users can query the data A data manipulation language controls how the user can specify queries, (and thus what types of queries are allowed) SQL is probably the most well-known

Other Database Topics “Real” database courses include lots of other things that we’ll be ignoring here More complete theory behind design Query optimization Efficient storage Processing Transactions – grouped queries that provide atomic operations Scheduling, logging, recovery

Entity-Relationship Model Way of expressing (in diagrammatic form) a database design Kinds of data and how they connect Easy first way to think about databases Later, relational model described Relational model is the foundation of most databases

Entities and Attributes Entities are things Entity sets are collections of those things Attributes are properties of entity sets

Entity Sets and Attributes Name Party Senator Bill State Text Name Years

Relationships Connect two or more entity sets Name Contributed Party Organization Senator Lobbyist State Sponsored Name Years Wrote Bill Name Text

Values of Relationships The “value” of an entity set is the entities it contains The “value” of a relationship is a list of currently related entities (one from each entity set) Senator Bill Smith Tax Bill Defense Bill Jones

Multi-Way Relationships E.g. Lobbyist lobbied Senator about Bill Name Party Organization Senator Lobbied Lobbyist State Name Years Bill Name Text

Relationship Types Consider binary relationships (two entity groups in a relationship) One-to-one Each entity can have at most one in the other category e.g. entity groups: Baseball player, Team relationship: Team MVP A team can only have one MVP, and a player can only be MVP for one team.

Relationship Types Consider binary relationships (two entity groups in a relationship) One-to-one Many-to-one Each entity of first set can go to at most one of the second set e.g. entity groups: Person, Town relationship: BornIn A person can is born in only one town, but a town can have many people born there

Relationship Types Consider binary relationships (two entity groups in a relationship) One-to-one Many-to-one Many-to-many Any number from one set to the other e.g. Senators can sponsor many bills, and each bill can be sponsored by many Senators

Diagrams of Relationships Arrow shows “to one” Lived In Born In Person Town MVP Baseball Player Team

Attributes on Relationships Can be converted to multi-way diagrams Born In Person Town Hospital

Attributes on Relationships Can be converted to multi-way diagrams Born In Person Town Hospitals Hospital

Attributes on Relationships Note arrows Injured Person Date Hospitals Hospital

Roles If multiple references to same entity set, label edges by roles Team Lead Team Programmer Students Tester

Subclass Fewer entities, more properties Name Elected Official Party isa U.S. Representative District

Subclass Entity in all subclasses Elected Official Name isa isa U.S. Representative Republican District Years in Party

Keys A key is a set of attributes for an entity set such that no two entities agree on all the attributes. We must have a key for every entity set Elected Official Name For an isa hierarchy, only root can have a key. Party isa U.S. Representative District

Key for multiple attributes Must choose one set of attributes First Name Last Name Number Baseball Player Position Birthdate Nationality Salary Team

Key for multiple attributes Must choose one set of attributes First Name Last Name Number Baseball Player Position Birthdate Nationality Salary Team

Key for multiple attributes Must choose one set of attributes First Name Last Name Number Baseball Player Position Birthdate Nationality Salary Team

Weak entity sets Need “help” to determine key First Name Last Name Number Note arrrow: indicates many to one. Baseball Player Position Birthdate Plays On Team Nationality Salary Name City

Design Techniques Avoid redundancy Say the same thing two ways First Name Last Name Number Baseball Player Position Birthdate Plays On Team Team Name Salary Name City

Design Techniques Avoid redundancy Say the same thing two ways First Name Last Name Number Baseball Player Position Birthdate Team Name Team Town

Design Techniques Don’t use entity set if attribute will do Entity lists should either Have some non-key attribute Be the “many” in a many-one/many-many relationship Plays On Name Baseball Player Team Name City

Design Techniques Don’t use entity set if attribute will do Entity lists should either Have some non-key attribute Be the “many” in a many-one/many-many relationship Name Baseball Player Team

Design Techniques Don’t overuse weak entity sets Usually use unique key for each entity set (e.g. UIN, SSN, VIN) Not always possible, though