Build a database I: Design tables for a new Access database

Slides:



Advertisements
Similar presentations
Database Relationships in Access As you recall, the data in a database is stored in tables. In a relational database like Access, you can have multiple.
Advertisements

Microsoft® Access® 2010 Training
Designing MS-Access Tables
Microsoft ® Office Access ® 2007 Training Build a database II: Create tables for a new Access database GPC presents:
Microsoft ® Access ® 2010 Training Design the tables for a new database.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Relationships Relational Database. Identifying Entities… In the previous tutorial you learnt about identifying entities in a flat file database. Also.
CHAPTER OBJECTIVE: NORMALIZATION THE SNOWFLAKE SCHEMA.
Microsoft ® Access ® 2010 Training Create queries for a new database.
Microsoft® Office Access® 2007 Training
Access Tutorial 1 Creating a Database
Table design screen Field name Data type Field size Other properties.
WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Access Lecture 1 Database Overview and Creating Tables Create an Employee Table.
Database Design Overview. 2 Database DBMS File Record Field Cardinality Keys Index Pointer Referential Integrity Normalization Data Definition Language.
Build a database IV: Create queries for a new Access database Overview: Ask your data — create queries It’s time to create queries, one of the most powerful.
Get to know Access 2007 Access does data Access does data. All kinds of data. From customer contacts, billing hours and inventory to diet and exercise.
Databases. Objectives Define what a database is. Understand the difference between a flat and relational database Design and create a relational database.
Microsoft ® Office Access ® 2007 Training Build a database III: Build relationships for a new Access database ICT Staff Development presents:
Database Tables two order-entry scenarios: A customer wants to cancel an order that she's placed. If her address is in a separate table from her.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Microsoft ® Office Access ™ 2007 Training Choose between Access and Excel ICT Staff Development presents:
Choose between Access and Excel Right questions, right program If you’re having trouble choosing between Access and Excel, take a moment to answer an important.
BUS1MIS Management Information Systems Semester 1, 2012 Access: Creating a Database Week 6 Lecture 2.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
Microsoft ® Office Access ® 2007 Training Build a database I: Design tables for a new Access database ICT Staff Development presents:
CSC 240 (Blum)1 Introduction to Database. CSC 240 (Blum)2 Data versus Information When people distinguish between data and information, –Data is simply.
Microsoft ® Access ® 2010 Training Create Queries for a New Database If a yellow security bar appears at the top of the screen in PowerPoint, click Enable.
Access 2013 Microsoft Access 2013 is a database application that is ideal for gathering and understanding data that’s been collected on just about anything.
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
1 Outline  What is a Primary Key?  AutoNumber primary keys  Single-field primary keys  Composite-field primary key  About Foreign Keys  Database.
(Spring 2015) Instructor: Craig Duckett Lecture 10: Tuesday, May 12, 2015 Mere Mortals Chap. 7 Summary, Team Work Time 1.
Microsoft Access Designing and creating tables and populating data.
DATABASE What exactly is a database How do databases work? What's the difference between a spreadsheet database and a "real" database?
MS Access. Access is a DBMS/RDMS DBMS = Database Management System RDMS = Relational Database Management System.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
M1G Introduction to Database Development 4. Improving the database design.
Microsoft ® Office Access 2003 Training Get to know Access CGI presents:
Build a database III: Build relationships for a new Access database Overview: You can relate This course teaches you how to build relationships between.
Quiz questions. 1 A data structure that is made up of fields and records? Table.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
Build a database V: Create forms for a new Access database Overview: A window into your data So far in this series of courses, you’ve built tables, relationships,
Introduction to Databases. What is a database?  A database program is nothing more than an electronic version of a 3x5 card file  A database is defined.
Introduction to Access Chapter 13 pages 1-4. What is a database??? Related information is stored in databases  All SC student information is stored in.
Planning & Creating a Database By Ms. Naira Microsoft Access.
Access Lessons 1, 2 and 3 ©2009 M and K Solutions, LLC – All Rights Reserved.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Connecting (relating) Data Tables to get Custom Records (Queries) Database Basics.
CSCI 6962: Server-side Design and Programming Shopping Carts and Databases.
Build a database II: Create tables for a new Access database Create your tables In a relational database, tables store your data. Your data doesn’t “live”
MICROSOFT OFFICE ACCESS 2007 TRAINING Intro to building a database.
Course Contents Overview: Database basics Lesson 1: Benefits of using a database Lesson 2: Table that data Lesson 3: Analyzing, viewing, and reporting.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
2b. Create an Access Database Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis with Spreadsheets 1.
Databases: What they are and how they work
Microsoft Office Access 2010 Lab 1
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
and Defining Table Relationships
CIS 155 Table Relationship
Database Relationships
Database Management  .
What is a Database? A collection of data organized in a manner that allows access, retrieval, and use of that data.
Advanced Database Concepts: Reports & Views
ICT Database Lesson 2 Designing a Database.
Presentation transcript:

Build a database I: Design tables for a new Access database Start with a plan Before you start planning, remember a key fact: Databases organize your information into separate tables, and each table contains unique data. The database then uses relationships to join the data in the tables in a meaningful way. That set of tables and relationships is called a relational structure, which the picture shows. Here’s an example of the key fact: a table of asset data shouldn’t contain sales information, and a table of employee data shouldn’t contain medical records. As the picture shows, the original spreadsheet places the data in one long list, while the database divides it into tables. In turn, the tables are related together in a way that lets you find information and extract meaning from your data. Relational structures have several advantages over simple lists: They reduce the amount of data that you enter and manage because you only store a piece of data once. Reducing the amount of repeated data helps ensure accuracy, because you know you’re not counting an item more than once. Relational structures make it easier to extract answers from your data. For example, you can find out which company supplies most of your furniture, or which computers have had the fewest support calls. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database Decide on a purpose The first step in planning a new database is to write down its purpose. In this case, you need to enter and manage your company’s asset data. But don’t stop there. Ask yourself who will use the database and how they’ll use it. For example, the technician who fixes a defective machine has different information needs than the accountant who tracks costs. Make sure your purpose statement addresses those different needs and uses. Keep your purpose statement handy and refer to it as you design your tables. And don’t try to make the statement perfect, you can always change it. Build a database I: Design tables for a new Access database

List the data you want to store A good database design helps ensure your data is complete, and most importantly, that it’s accurate. To reach those goals, start by listing the data you want to capture. You can start with your existing data — in this case, your spreadsheet. Or, if you use paper ledgers or forms, gather examples of those. And don’t hesitate to ask your coworkers what they need. Build a database I: Design tables for a new Access database

List the data you want to store Another way to identify the information you need to store is to create a flowchart of the tasks associated with your data. And while you’re at it, think about the reports or mailings you want to produce from the database. Looking at the data you need to enter and consume can help you decide which data to store. What tasks are associated with the data? For example, who will enter the data, and how? What kinds of forms will they need? Reports or mailings: For example, do you want to know when desks and chairs need to be replaced? Who needs that information? Build a database I: Design tables for a new Access database

Group your data by subject As you list the data you want to capture, you’ll see it naturally falls into one or more subject matter categories or groups. For example, your information may group itself like this: Asset data, such as models, purchase dates, and costs. Support data — who you call for help or spare parts. This category will probably include company names, addresses, phone numbers, and contact names. Build a database I: Design tables for a new Access database

Group your data by subject As you list the data you want to capture, you’ll see it naturally falls into one or more subject matter categories or groups. For example, your information may group itself like this: Supplier data, which looks a lot like support data because it includes companies and contact names. Grouping is important because each category can correspond to a table, such as Assets, Support, Suppliers. Build a database I: Design tables for a new Access database

Group your data by subject Your groups may not result in a complete list of tables, but they’re a good starting point. Just make sure each group contains unique data — just the asset information in one group, only the supplier data in another, and so on. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database From groups, fields The next step in your design is to list the fields for each table. In an Access table, columns are called fields and individual records are called rows. You plan your fields by deciding the specific information each of your groups should capture. Again, you can refer to your existing data — the spreadsheet, a ledger, or even your card file. You can also open an existing database, such as one of the Access database templates, and see which fields it uses. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database From groups, fields For your asset database, you’ll probably want to list each item and information about each item, such as purchase dates and costs. As part of this, try to reduce each field to its smallest logical component. In a good design, a field represents a single piece of data, and the name of the field clearly identifies that data. For example, your tables should have separate fields for first and last names because that makes it easier to find and sort your information. Also, ask yourself if you need to record international data. If you do, you’ll need fields for Country, plus Region instead of State, and Postal Code instead of Zip Code. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database From groups, fields As you work, you may find yourself wanting to use data from one table in another. For example, the picture shows that the Assets group includes fields for suppliers and support. That’s natural — you’re seeing how you need to relate your tables, and we’ll discuss those relationships in just a bit. For now, include all the fields you think each table should have. Note: If a field name contains more than one word, you can separate each word with spaces, but that may not be a good idea. Spaces can make it harder to create other components, such as Microsoft Visual Basic® for Applications code and a type of formula called an expression. If you need to use multiple words in a field name, you can eliminate spaces altogether, or separate each word with an underscore. The Quick Reference Card that’s linked to at the end of this course provides more information about characters you can use in field names. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database From groups, fields As you work, you may find yourself wanting to use data from one table in another. Finally, in case you’re wondering, you don’t plan rows. Those come naturally as you enter data in your fields. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database Plan your primary keys A final step in your plan is to add a primary key field to each of your tables. A primary key is a field, or a combination of fields, with a value that makes each row in a table unique. Primary keys are another way to avoid duplicating your data, because you can never duplicate a value in a primary key field. Primary keys also enable relationships among your tables. That’s what makes your data powerful, because relationships allow you to ask questions and extract meaning from your data. We’ll look at relationships in the next section. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database Plan your primary keys Access provides several ways to create primary keys. You can use existing values such as part numbers, but only if each value will always be unique. Once you define a field as a primary key, Access never lets you enter duplicate values in that field. Also, your key values should never change, because if they do your tables may become out of synch. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database Plan your primary keys Access provides several ways to create primary keys. If your existing data won’t work as a primary key, you can use an AutoNumber field. Access simply increments the value in that field by one whenever you add a new record. Build a database I: Design tables for a new Access database

Build a database I: Design tables for a new Access database Plan your primary keys So how do you plan primary keys? Start by adding an “ID” field, such as “Asset_ID”, to each of your tables. Or, if you want to use multiple columns of data to create a composite key, make a note next to each column you want to use. The next course in this series, titled, “Build a database II: Create tables for a new Access 2007 database,” shows you how to create a primary key. Build a database I: Design tables for a new Access database

A quick look at relationships So, you’ve divided your data into tables and listed the fields and primary keys. How do you relate your data back together? You create relationships by using the primary key field from one table as a field in another table. The picture shows this. You can see how the primary keys in the Suppliers and Support tables have become fields in the Assets table. Those duplicate fields in the Assets table are called foreign keys. This is a basic explanation of relationships; they’re covered in detail a later course in this series. Check back in the coming weeks. Build a database I: Design tables for a new Access database

A quick look at relationships At this point, you may be thinking, “Hang on, I’ve just duplicated some data!” Don’t worry, this kind of duplication is okay. Primary key values are small, and you can’t extract meaningful information from your database unless you use them in relationships. So, as a final step in your design, indicate your foreign key fields. For example, the relationships in the picture allow you to answer questions such as, “Who supplied the monitors that we bought two years ago?” If you need more information about keys, relationships, or database design, see the Quick Reference Card that’s linked to at the end of this course. Build a database I: Design tables for a new Access database