week 10 database design. table instance charts create tables for the tables for the sample in the...
TRANSCRIPT
![Page 1: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/1.jpg)
WEEK 10
Database Design
![Page 2: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/2.jpg)
TABLE INSTANCE CHARTS
![Page 3: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/3.jpg)
Create Tables
• For the tables for the sample in the Wk10_TableInstanceChart.xlsx
![Page 4: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/4.jpg)
TYPES OF DATA
![Page 5: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/5.jpg)
Common Data Types in Access
• Autonumber• Text• Memo• Number• Currency• Date/Time• Yes/No
![Page 6: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/6.jpg)
Autonumber
• Use for unique sequential numbering• Commonly used for PK (Primary Key)• Increments by 1• Automatically inserted when a record is added.
![Page 7: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/7.jpg)
Text
• Used for text or combinations of text and numbers, such as addresses, or for numbers that do not require calculations, such as phone numbers, part numbers, or postal codes.
• Stores up to 255 characters.
![Page 8: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/8.jpg)
Memo
• Use for lengthy text and numbers, such as notes or descriptions.
• Should be used “sparingly”, because it takes up too much room in database
• Stores up to 65,536 characters (if not more)
![Page 9: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/9.jpg)
Number
• Use for data to be included in mathematical calculations, except calculations involving money (use “Currency” type). • When you are creating a RELATIONSHIP with an
“AUTOnumber” field with the “PARENT” table
![Page 10: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/10.jpg)
Yes/No
• Use for data that can be only 1 of 2 possible values, such as • Yes/No, • True/False, • On/Off.
• Null values are NOT allowed
![Page 11: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/11.jpg)
Rule
• One chart completed for each table
• Wk10_TableInstanceChart.xlsx
![Page 12: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/12.jpg)
Review Relationship Essentials• Need a primary key• EVERY TABLE NEEDS A PRIMARY KEY• Should be 1st field
• Need a foreign key• a Foreign Key is a column in a table used to reference a
Primary Key in another table.• A table does NOT necessarily have to have a Foreign Key• Whenever you see: “MANY”—this will be the Foreign
Key
• Primary key and foreign keys are essential when you create relationships that join together multiple tables in a database
![Page 13: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/13.jpg)
Build Time
• For each of the following scenarios:• Create and write out a business narrative • Create list of ENTITIES/tables• Create the attributes for the table• Create the ERD and the relationship rules• Create a table instance chart
![Page 14: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/14.jpg)
HUMAN RESOURCES 2
![Page 15: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/15.jpg)
HUMAN RESOURCES 3
![Page 16: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/16.jpg)
CREATE TABLES IN MS ACCESS
![Page 17: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/17.jpg)
Table Design View• Exercise:• Create table for gender
![Page 18: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/18.jpg)
Datasheet View
• Exercise:• Add data to the gender table
![Page 19: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/19.jpg)
Table Design View
• Exercise:• Create Ribbon > Table Design in the Tables
grouping• Identify your own PK• Moving the order of the rows
![Page 20: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/20.jpg)
Create Table with Lookups
• Exercise:• Add data to the city entity using a look up
wizard as the data type for the province
![Page 21: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/21.jpg)
Add Data to an Entity
• Based on another entity• Exercise:• Create the students table (studentID, fname,
lname and gender fields only)
![Page 22: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/22.jpg)
Edit an Entity
• Exercise:• Complete the Students table• Go back and look at your default value (note it
was not added to previous records entered)
![Page 23: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/23.jpg)
Edit Data in Datasheet View
• Exercise: • Go back and add the age group and city for
each of the students previously entered
• Datasheet view• Record count• Add a new record• Search for a record• Sort the records
![Page 24: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/24.jpg)
COMPACTING & REPAIRING A DATABASE
• DATABASE TOOLS > COMPACT & REPAIR button• •As you add, edit, & delete objects, a
database changes in size• •To minimize the size of a database & improve
performance should be done on a regular basis• •Rearranges how a fragmented database is
stored on disk
![Page 25: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/25.jpg)
Want More Information
• Visit the following site. http://www.functionx.com/access/index.htm
![Page 26: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/26.jpg)
QUERIES
![Page 27: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/27.jpg)
• Is a QUESTION to the database-asking for a “set of records” from 1 or more Tables/QueriesMS Access responds by displaying the requested datais a stored question, rather than a stored responseresults automatically update,IF table is edited, it allows you to view & operate on “selected subsets” of your data
QUERIES: DEFINITION
![Page 28: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/28.jpg)
Northwind Database
![Page 29: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/29.jpg)
Single Table Queries
• Select fields to display• Sort by?• Simple Conditions• When you enter text into the criteria cell your
text should be enclosed in quotes ("") to distinguish it from other expressions and operators that you may need to add.
![Page 30: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/30.jpg)
WORKING WITH TEXT
![Page 31: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/31.jpg)
Matching Text
![Page 32: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/32.jpg)
OR Statement
![Page 33: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/33.jpg)
IN Statement
![Page 34: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/34.jpg)
NOT Statement
![Page 35: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/35.jpg)
NOT IN Statement
![Page 36: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/36.jpg)
LIKE “Text*” Statement
![Page 37: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/37.jpg)
LIKE “*Text” Statement
![Page 38: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/38.jpg)
Hybrid / Homework
• Read Calculating in Access Queries• Read Calculating Totals in Access• Read Working out Someone’s Age• Watch Multi-Table Queries Part 1 & 2
• Database Assignment Part 2
![Page 39: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/39.jpg)
HYBRID: MYITLAB
HYBRID: MYITLAB• MYITLAB HOMEWORK:
![Page 40: WEEK 10 Database Design. TABLE INSTANCE CHARTS Create Tables For the tables for the sample in the Wk10_TableInstanceChart.xlsx](https://reader036.vdocuments.net/reader036/viewer/2022081417/5519b4c75503465b578b474a/html5/thumbnails/40.jpg)
Quiz Time