Database Fundamentals

Slides:



Advertisements
Similar presentations
Delta Confidential 1 5/29 – 6/6, 2001 SAP R/3 V4.6c PP Module Order Change Management(OCM)
Advertisements

1 Senn, Information Technology, 3 rd Edition © 2004 Pearson Prentice Hall James A. Senns Information Technology, 3 rd Edition Chapter 7 Enterprise Databases.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to XHTML Programming the World Wide Web Fourth edition.
Chapter 1: The Database Environment
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
BASIC SKILLS AND TOOLS USING ACCESS
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Database Design: Normalization J.G. Zheng June 29 th 2005 DB Chapter 4.
UNITED NATIONS Shipment Details Report – January 2006.
Relational Database and Data Modeling
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Exit a Customer Chapter 8. Exit a Customer 8-2 Objectives Perform exit summary process consisting of the following steps: Review service records Close.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Information Systems Today: Managing in the Digital World
PP Test Review Sections 6-1 to 6-6
EU market situation for eggs and poultry Management Committee 20 October 2011.
Database Design Process
© Paradigm Publishing, Inc Access 2010 Level 1 Unit 1Creating Tables and Queries Chapter 2Creating Relationships between Tables.
Microsoft Access.
Chapter Information Systems Database Management.
Chapter 6 Data Design.
Access Tables 1. Creating a Table Design View Define each field and its properties Data Sheet View Essentially spreadsheet Enter fields You must go to.
2 |SharePoint Saturday New York City
Green Eggs and Ham.
VOORBLAD.
Benchmark Series Microsoft Excel 2013 Level 2
Entity Relationship Diagrams
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Functional Dependencies and Normalization for Relational Databases
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
25 seconds left…...
Analyzing Genes and Genomes
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Chapter 12: Designing Databases
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
1 Chapter 13 Nuclear Magnetic Resonance Spectroscopy.
Energy Generation in Mitochondria and Chlorplasts
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 2Advanced Reports, Access Tools, and Customizing Access Chapter 8Integrating Access Data.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
ECE 8443 – Pattern Recognition ECE 3822 – Software Tools For Engineers Topics: Definitions and Terminology Abstraction Schema Tables Types of Databases.
Avoiding Database Anomalies
Module Coordinator Tan Szu Tak School of Information and Communication Technology, Politeknik Brunei Semester
Database, tables and normal forms
INFM 603: Session 5 Introduction to Databases and Database Design
Paul Jacobs The iSchool University of Maryland Thursday, Oct. 6, 2016
LECTURE 34: Database Introduction
Paul Jacobs The iSchool University of Maryland Thursday, Oct. 5, 2017
LECTURE 33: Database Introduction
Presentation transcript:

Database Fundamentals

A Database Schema Tables Indexes Procedures Views Constraints Schema Owner [1] schema objects 1) Stephens, R.K. and Plew. R.R., 2001. Database Design. SAMS, Indianapolis , IN. (with slight changes by V.G.D.)

Caution about Schema Objects The meaning of “object” here is different than that in UML.

Table “A table is the primary unit of physical storage for data in a database.”1 Usually a database contains more than one table. 1) Stephens, R.K. and Plew. R.R., 2001. Database Design. SAMS, Indianapolis , IN.

Table

A Database with Multiple Tables [1] Publishers Books Customers Authors Inventory Orders 1) Stephens, R.K. and Plew. R.R., 2001. Database Design. SAMS, Indianapolis , IN. (with slight changes by V.G.D.)

Table Customers

Field (Column) Customers a field

Record (Row) Customers a record

Primary Key Customers primary key field Primary key is a unique identifier of records in a table. Primary key values may be generated manually or automatically.

A primary key can consist of more than one field. Roles (Performances) primary key fields A primary key can consist of more than one field.

Foreign Key Directors Movies primary key field parent table relationship child table Movies foreign key field

Relationship Types One-to-one One-to-many Many-to-many

Data Types Alphanumeric (Text, Memo) Numeric (Number, Currency, etc.) Date/Time Boolean (Yes/No)

Entity “An entity is a business object that represents a group, or category of data.”1 Do we know a similar concept? 1) Stephens, R.K. and Plew. R.R., 2001. Database Design, pp. 21. SAMS, Indianapolis , IN.

Instance (Record, Tuple) “A single, specific occurrence of an entity is an instance. Other terms for an instance are record and tuple.”1 Do we know a similar concept? 1) Stephens, R.K. and Plew. R.R., 2001. Database Design, pp. 210. SAMS, Indianapolis , IN.

Attribute “An attribute is a sub-group of information within an entity.”1 Do we know a similar concept? 1) Stephens, R.K. and Plew. R.R., 2001. Database Design, pp. 21. SAMS, Indianapolis , IN.

Relationship A relationship is a link that relates two entities that share one or more attributes. Do we know a similar concept?

OO Design  DB Design Class  Entity (Table) Object  Record Attribute  Attribute (Field) Association  Relationship …

Database Environments Mainframe Client/Server Internet-based

Database Types Flat-file Hierarchical Network Relational Object-oriented Object-relational

Normalization (Advanced – may not be required for LBSC690)

Normalization A method for organizing data elements into tables. Done in order to avoid Duplication of data Insert anomaly Delete anomaly Update anomaly

We will look at First Normal Form Second Normal Form Third Normal Form

Example (Unnormalized) Table: SalesOrders (Un-normalized) SalesOrderNo Date CustomerNo CustomerName CutomerAddress ClerkNo ClerkName Item1Description Item1Quantity Item1UnitPrice Item2Description Item2Quantity Item2UnitPrice Item3Description Item3Quantity Item3UnitPrice Total

Normalize into 1NF Separate repeating groups into new tables. Start a new table for the repeating data. The primary key for the repeating group is usually a composite key.

Example (1NF) Table: SalesOrders Table: OrderItems SalesOrderNo Date CustomerNo CustomerName CustomerAddress ClerkNo ClerkName Total Table: OrderItems SalesOrderNo ItemNo ItemDescription ItemQuantity ItemUnitPrice

Normalize into 2NF Remove partial dependencies. Start a new table for the partially dependent data and the part of the key it depends on. Tables started at this step usually contain descriptions of resources.

Dependencies Functional dependency: The value of one attribute depends entirely on the value of another. Partial dependency: An attribute depends on only part of the primary key. (The primary key must be a composite key.) Transitive dependency: An attribute depends on an attribute other than the primary key.

Example (2NF) Table: OrderItems Table: InventoryItems SalesOrderNo ItemNo ItemQuantity ItemUnitPrice Table: InventoryItems ItemNo ItemDescription

What if we did not do 2NF Duplication of data: ItemDescription would appear for every order. Insert anomaly: To insert an inventory item, you must insert a sales order. Delete anomaly: Information about the items stay with sales order records. Delete a sales order record, delete the item description. Update anomaly: To change an item description, you must change all the sales order records that have the item.

Normalize into 3NF Remove transitive dependencies. Start a new table for the transitively dependent attribute and the attribute it depends on. Keep a copy of the key attribute in the original table.

Example (3NF) Table: SalesOrders Table: Customers Table: Clerks SalesOrderNo Date CustomerNo ClerkNo Total Table: Customers CustomerNo CustomerName CustomerAddress Table: Clerks ClerkNo ClerkName

What if we did not do 3NF Duplication of data: Customer and Clerk details would appear for every order. Insert anomaly: To insert a customer or clerk, you must insert a sales order. Delete anomaly: Information about the customers and clerks stay with sales order records. Delete a sales order record, delete the customer or clerk. Update anomaly: To change the details of a customer or clerk, you must change all the sales order records that involve that customer or clerk.

Example (Final Tables) Table: SalesOrders SalesOrderNo Date CustomerNo ClerkNo Total Table: OrderItems ItemNo ItemQuantity ItemUnitPrice Table: InventoryItems ItemNo ItemDescription Table: Customers CustomerNo CustomerName CustomerAddress Table: Clerks ClerkNo ClerkName