Agenda Introduction to Databases & Database Design Recommended Reading Scope of Learning Database Vocabulary Database Characteristics Types of Databases
Welcome to Databases Our goal is to have a basic understanding of databases Resources: ◦ Slides ◦ In Class Activities ◦ No textbook required ◦ Videos
Recommended Reading Only if you want to get a deeper understanding: Database Design for Mere Mortals, Hernandez, 1997, Addison Wesley ISBN: 0-201-69471-9.
Why Learn Databases? Store information Information is a valuable commodity Information is used for marketing and BI (Business Information) Used by all kinds of businesses Access to good information (if properly done)
Question What are some databases that you have seen or used?
Database Terms Dataset According to Dictionary.com, a database is “a comprehensive collection of related data organized for convenient access, generally in a computer.”data
Database Terms Data ◦ From dictionary.reference.com, “Individual facts, statistics, or items of information”. ◦ Never contrived or derived values
Database Terms Database ◦ A comprehensive collection of related data organized for convenient access ◦ Wk9_First_Sample.accdb Wk9_First_Sample.accdb
Database Terms Database Management System (DBMS) Provides tools needed to organize data in a flexible manner. It includes: facilities to add, modify or delete data ask questions (queries) about the data stored produce reports
Question Based on definitions, can you think of some benefits for using databases?
Database Terms Entity Relationship Diagram (ERD) Visual display of tables and their relationships for a database
Many Types of Databases File Maker Pro Oracle Microsoft ◦ Excel ◦ Access
Database Models According to Wikipedia: A database model is the theoretical foundation of a database and fundamentally determines in which manner data can be stored, organized, and manipulated in a database system. It thereby defines the infrastructure offered by a particular database system.database data
Database Model – Relational Relational database model is the most common Composed of tables, each constructed like a flat file Wk9_FlatFile.xlsx (Relational tab (worksheet)) Wk9_FlatFile.xlsx
What are Tables or Entities? Tables (aka “Entities”) in the relational model are used to represent "things" in the real world. Entities are made up of rows and columns. Columns are called fields or attributes. Rows are called records.
What is a Primary Key? A field in the database that guarantees uniqueness Speeds data retrieval ◦ Each record in a table must have a primary key ◦ Each primary key is the first attribute (column) listed ◦ Wk9_FlatFile.xlsx (Relational Tab) Wk9_FlatFile.xlsx
What are Foreign Keys? A foreign key is used to indicate a relationship between 2 or more tables Each foreign key is a primary key in another table
Create Relationships Database Tools ribbon > relationships grouping Exercise: ◦ How to Edit a relationship ◦ How to Create a relationship
“Enforce Referential Integrity” A system of rules that MS Access uses to ensure that relationship data is valid and that you cannot accidentally delete a record in 1 table if a matching record is present in a related table. You cannot set referential integrity unless the matching field from the primary table is a primary key Know that the related fields must have the same data type
Relationships “Report” While in the Relationships Design window, in the TOOLS group, click on the Relationship Report button SAVE CLOSE