Keys Chapter 8 Database Design for Mere Mortals. Why Keys Are Important They ensure that each record in a table can be properly identified. They help.

Slides:



Advertisements
Similar presentations
Advanced Data Modeling
Advertisements

Chapter 6 Advanced Data Modelling
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Concepts of Database Management Sixth Edition
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
Views Chapter 12. What Are Views? A virtual table that comprises the fields of one or more tables in the database It is a virtual table since it does.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Concepts of Database Management Seventh Edition
CS424 PK, FK, FD Normalization Primary and Foreign Keys Primary and foreign keys are the most basic components on which relational theory is based. Primary.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Conceptual Overview 7 step design Chapter 4 Database Design for Mere Mortals.
Establishing Table Structures Chapter 7 Database Design for Mere Mortals.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
CSC271 Database Systems Lecture # 6. Summary: Previous Lecture  Relational model terminology  Mathematical relations  Database relations  Properties.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Concepts and Terminology Introduction to Database.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
Fundamentals of Relational Database Yong Choi School of Business CSUB, Bakersfield.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
1 n 1 n 1 1 n n Schema for part of a business application relational database.
Concepts of Database Management Sixth Edition Chapter 6 Database Design 2: Design Method.
(Spring 2015) Instructor: Craig Duckett Lecture 10: Tuesday, May 12, 2015 Mere Mortals Chap. 7 Summary, Team Work Time 1.
System Design System Design - Mr. Ahmad Al-Ghoul System Analysis and Design.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
1 CSE 2337 Introduction to Data Management Access Book – Ch 1.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
In this session, you will learn to: Map an ER diagram to a table Objectives.
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
Chapter 9 Constraints. Chapter Objectives  Explain the purpose of constraints in a table  Distinguish among PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK,
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 3 The Relational Database Model.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 3 The Relational Database Model.
Database Terms Hernandez, Chapter 3. Data/Information The values you store in the database are data. Pieces of Data in and of themselves is not particularly.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
(Winter 2016) Instructor: Craig Duckett Lecture 15: Thursday, February 25 th Visual Studio Walk-Through 1.
D1 FMA Review. Many-to-Many Relationships - Examples Car Hire –A customer may hire one or more cars –A car may be hired by one or more customers Gym Club.
(Winter 2016) Instructor: Craig Duckett Lecture 13: Thursday, February 18 th Mere Mortals: Chap. 9 Summary, Team Work 1.
Conceptual Design to Logical Design Lecture 4. Aims  To introduce Business Rules  To identify what a Business Rule is  To Introduce Business Operations.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Chapter 3: Relational Databases
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Methodology - Logical Database Design. 2 Step 2 Build and Validate Local Logical Data Model To build a local logical data model from a local conceptual.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. A database is a collection of information organized to provide efficient retrieval. The collected information.
1 Microsoft Access 2002 Tutorial 2 – Creating And Maintaining A Database.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
(Winter 2017) Instructor: Craig Duckett
Introducing Databases
Database Constraints Ashima Wadhwa.
Methodology Logical Database Design for the Relational Model
(Winter 2017) Instructor: Craig Duckett
(Winter 2017) Instructor: Craig Duckett
and Defining Table Relationships
Relational Databases.
CIS 155 Table Relationship
CSCI-100 Introduction to Computing
Data Modelling Introduction
Normalization Referential Integrity
Chapter 3 The Relational Model.
(Winter 2017) Instructor: Craig Duckett
Instructor: Craig Duckett
Chapter 3 The Relational Model
Presentation transcript:

Keys Chapter 8 Database Design for Mere Mortals

Why Keys Are Important They ensure that each record in a table can be properly identified. They help establish and enforce various types of integrity. They are used to establish table relationships.

Establishing Keys for Each Table Candidate keys –It must uniquely identify each record in the table –It must contain unique values –It cannot be null –It cannot be a multipart field –It comprises a minimum number of fields necessary to define uniqueness

–Its value is not optional in whole or in part –It must directly identify the value of each field in the table. –Its value can only be modified in rare or extreme cases. Artificial candidate keys –creating a new field that conforms to the rules of the candidate key and add it to the table

Primary Keys Guidelines: –If you have a “simple” (single field) Candidate key and a Composite Candidate key, choose the simple candidate key. Its always best to use a candidate key that contains the least number of fields. –Choose the candidate key that uses a field that incorporates part of the table name within its name.

Elements of a Primary Key –It must uniquely identify each record in the table –It must contain unique values –It cannot be null –It cannot be multipart field –It should contain the minimum number of fields necessary to define uniqueness

–It is not optional in whole or in part –It must directly identify the value of each field in the table –Its value can only be modified in rare or extreme cases Final test for primary key –It must directly identify the value of each field in the table

Rules for establishing a Primary key –Each table must have one - and only one primary key –Each primary key within the database should be unique - no two tables should have the same primary key unless one of them is a subset table Alternate keys –Once you’ve selected a candidate key to serve as the primary key for a particular table, the remaining candidate keys become alternate keys

Non-Keys –does not serve as a candidate, primary, alternate, or foreign key. Table level integrity –there are no duplicate records in a table –every record in a table is identified by a primary key value –every primary key value is unique –primary key values are not null

Reviewing the Initial Table Structures Conduct interviews with users and management for review or work done so far Interview: –ensure that the appropriate subjects are represented in the database –make certain that the table names and table descriptions are suitable and meaningful to everyone

Make certain that the field names are suitable and meaningful to everyone Verify that all the appropriate fields are assigned to each table Case Study