120 likes | 297 Views
Introduction to Database and Microsoft Access. What is a database?. A collection of information about one subject (ex. contacts, customer information, sports team information) Managed by a Database Management System aka DBMS (ex. Access)
E N D
What is a database? • A collection of information about one subject (ex. contacts, customer information, sports team information) • Managed by a Database Management System aka DBMS (ex. Access) • A DBMS contains tools for sorting, analyzing, extracting, and summarizing data in a database
Terminology • Table: a collection of- • Fields: the columns in the table • Example: Name, Address, Postal Code, Phone • Records: the rows in a table • Example: Pat McQuaidinfo, Rosemary Wild info • Data values: the actual data in each record (row) • Example: Pat McQuaid, 12 Any Street, 93407, 756-7833
A Flat File vs. a Database An Excel spreadsheet stores data in a “flat file” with all data values in single row
An Example of a flat file in Excel Customer Orders
Relational Database A database consists of a set of tables with each table formed to contain only data related to a single aspect of a problem. This is why a database is termed “relational.”
Relational Database Concepts • Primary KeyA unique identifier needed to get to a particular record in a database (ex. customer number, item number, order number) • Foreign KeyA key in a table that is also a primary key in another table. Used to link related tables.
Breaking a flat file into a set of tables- Customers Orders Items (Products) *Foreign Key *Primary Key in Red
More Database Concepts • Tables in a relational database are connected to each other via keys • A key is a unique identifier (ex. Social Security Number, Drivers License Number, Customer Number, Order Number, Product Number)
A few additional points • All tables in a relational database should have a primary key • A primary key may consist of more than 1 field • A primary key/foreign key relationship is used to logically connect tables to enable navigation through stored data