Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2003 Addison-Wesley Defining Relational Databases What is an Access database? How do you create an Access database? How do you create and modify.

Similar presentations


Presentation on theme: "Copyright © 2003 Addison-Wesley Defining Relational Databases What is an Access database? How do you create an Access database? How do you create and modify."— Presentation transcript:

1 Copyright © 2003 Addison-Wesley Defining Relational Databases What is an Access database? How do you create an Access database? How do you create and modify tables in Access? How do you add data to Access tables? How do users interact with Access databases? How do you create user interfaces? How are relationship types represented in Access?

2 Copyright © 2003 Addison-Wesley What is an Access Database? An Access database is a relational database –Collection of tables –Each table is defined by a relation schema –The whole database is defined by a database schema –The information content of the database is the rows of the tables An Access database is also a collection of user interfaces and tools –Forms for creating and modifying tables and other database objects –Wizards that help users create objects –Forms created by users that allow access and modification of the contents of tables Chapter 7 will focus on additional topics in manipulating content –Queries that collect and display the contents of one or more tables –Forms created by users that support complex data operations

3 Copyright © 2003 Addison-Wesley Sample Access Database Display

4 Copyright © 2003 Addison-Wesley Creating Access Databases An Access database is a file –E.g. mydatabase.mdb –Create a database by telling Access to create a file Screen shot is Access with new (empty) database –3 options for creating tables

5 Copyright © 2003 Addison-Wesley Creating Tables Create table in design view –New table is ready for adding columns

6 Copyright © 2003 Addison-Wesley Customer Table Design View Schema: Customer (accountId string, lastName string, firstName string, street string, city string, state string, zipcode string, balance number) –Many characteristics specified including: name, type, description and key

7 Copyright © 2003 Addison-Wesley Defining Multi-attribute Keys Select all key attributes and click key symbol

8 Copyright © 2003 Addison-Wesley Creating and Modifying Table Contents Datasheet view shows contents of table –Simply click and type to enter and modify data –Add new rows by typing in last row Updates to database become permanent when cursor moves off row –Move cursor by click or tab –Close window –Change focus to other window

9 Copyright © 2003 Addison-Wesley Creating Forms for Tables Select “Create form by using wizard” from Forms tab Select source table from drop-down control Move attributes from left to right panel

10 Copyright © 2003 Addison-Wesley Selecting Form Layout and Style Types of forms –Datasheet, seen previously rows and columns 1 st row is column names –Columnar label and value for each attribute arranged in columns One row per page –Tabular, like datasheet, but with separation of values –Justified, like columnar, but arranged in rows

11 Copyright © 2003 Addison-Wesley Specifying Relationship Types Relationship tool is used to specify relationship types –Add tables to display –Drag and drop attribute names to create connections Schema: Rental: (videoId references Video, dateDue date, dateRented date, cost currency, accountId number references Customer)

12 Copyright © 2003 Addison-Wesley Specifying Relationship Types To open properties dialog for relationship type –Right click on connection, select “Properties” Set “Enforce Referential Integrity” to specify relationship type –“Cascade” fields refer to what happens when key values are modified or deleted

13 Copyright © 2003 Addison-Wesley Viewing Relationship Types The Relationship tool shows characteristics of relationship types and roles –To-one relationship role has a 1 –To-many relationship role has a ∞ (infinity symbol) –What about many-to- many relationships?

14 Copyright © 2003 Addison-Wesley Case in Point Creating an Access database for BigHit Online –Review database schema for BigHit Online Figure 5.27, repeated as Fig. 6.26 –Create Access database –Define tables –Specify relationship types –Create forms to add and modify table data –Add sample data –Evaluate resulting database for clarity, accuracy, and completeness

15 Copyright © 2003 Addison-Wesley Database Schema for BigHit Online Customer: (accountId number, lastName string, firstName string) Sale: (saleId number, dateSold date, totalCost number, creditCardType string, creditCardExpiration date, creditCardAccountNumber number, accountId number references Customer) Movie: (movieId number, title string, genre string) ShoppingCart: (cartId number, dateCreated date, accountId number references Customer) SaleItem: (saleId number references Sale, movieId references Movie, quantity number) CartItem: (cartId number references ShoppingCart, movieId references Movie, quantity number) CreditCards: (accountId number references Customer, accountNumber number, type string, expiration date) ShippingAddresses: (accountId number references Customer, street string, city string, state string, zipcode string) DVD: (movieId number references Movie, videoFormat string, languages string, captioning string) Videotape: (movieId number references Movie, format string, soundtrack string)

16 Copyright © 2003 Addison-Wesley Tables and Relationship Types for BigHit Online


Download ppt "Copyright © 2003 Addison-Wesley Defining Relational Databases What is an Access database? How do you create an Access database? How do you create and modify."

Similar presentations


Ads by Google