Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating a Database in Access Creating a database involves 1.Logical design of tables and relationships 2.Physical design of tables and relationships 3.Populating.

Similar presentations


Presentation on theme: "Creating a Database in Access Creating a database involves 1.Logical design of tables and relationships 2.Physical design of tables and relationships 3.Populating."— Presentation transcript:

1 Creating a Database in Access Creating a database involves 1.Logical design of tables and relationships 2.Physical design of tables and relationships 3.Populating tables

2 Logical Design of Library DB DB consists of these tables –Books (bkID, bkTitle, bkPrice) –Authors (auID, auName, auPhone) –Publishers (pubID, pubName, pubPhone)

3 Logical Design of Library DB Table Relationships Publishers pubID pubName pubPhone Books bkID bkTitle bkPrice pubID auID Authors auID auName auPhone

4 Physical Design of DB (Access) Create a new Database (e.g., myLibrary) Create tables Create fields –Go to design view –Insert fields –Select field types –Determine field properties Create more tables and their fields

5 Physical Design of DB (Access) Relate tables –Design  Relationships –Connect key fields

6 Input Table Data Open a DB in Access (e.g., myLibrary) Open a table (e.g., publishers) Enter field data

7 Queries One table –Display publisher names and their phone numbers –Display book titles and their prices –Display author names and their phone numbers Two tables –Display book titles, their prices, and their publishers –Display book titles, their prices, and author names Three tables –Display book titles, their authors, and their publishers

8 Queries Which books are $25 or less? What is the phone number of publisher Big House? What is the phone number of Shakespeare? Who publishes the book Hamlet? All books published by Big House over $10.00 All books written by Shakespeare and their publisher

9 Additional Queries List all copywritten materials used in Illiad. List all special photographs used in Balloon. Display the author, publisher, and ISBN of Emma, and owners of all copywritten material What is the name of author Spencer’s wife? How many children does author Shakespeare have?

10 Modifying Database The current design allows only 1 author for each book. How can we allow more than 1 author for one book (e.g., co-authors)? Books bkID bkTitle bkPrice pubID auID Authors auID auName auPhone 1 ∞ Publishers pubID pubName pubPhone 1 ∞

11 Modifying Database Remember, every relationship between two tables must be 1-to-∞ or ∞-to-1. Solution: Introduce an artificial linking table between Books a ∞ nd Authors. Books bkID bkTitle bkPrice pubID auID Authors auID auName auPhone 1 ∞ BooksAuthors bkauID bkID auID ∞ 1 Publishers pubID pubName pubPhone

12 Logical Design of Library DB Table Relationships Publishers pubID pubName pubPhone Books bkID bkTitle bkPrice pubID auID Authors auID auName auPhone

13 Access Exercises Tables –Books –Authors –Publishers –BooksAuthors


Download ppt "Creating a Database in Access Creating a database involves 1.Logical design of tables and relationships 2.Physical design of tables and relationships 3.Populating."

Similar presentations


Ads by Google