CPSC 203 Introduction to Computers Lab 23 By Jie Gao Introduction to Database  What is a database?  A database is a collection of information related.

Download Report

Transcript CPSC 203 Introduction to Computers Lab 23 By Jie Gao Introduction to Database  What is a database?  A database is a collection of information related.

CPSC 203 Introduction to Computers

Lab 23 By Jie Gao

Introduction to Database

 What is a database?

 A database is a collection of information related to a particular subject or purpose.

 Why database?

 Keep consistent information altogether  Easy to manage and find useful information  Easy to manage related information 3 June 2003 CPSC 203 by Jie Gao

An Example

ID F. Name 232398 Andy 134764 Jie 324509 Peter 254389 John 342532 Bill 112543 Helen L. Name Program Start Date Chu Gao Smith Smith Lee James CPSC CPSC MATH CHEM CPSC MATH 01/09/00 01/09/02 01/01/02 01/05/01 01/01/03 01/07/00 3 June 2003 CPSC 203 by Jie Gao

Terminology (1)

Field Table

ID F. Name 232398 Andy L. Name Program Start Date Chu 134764 Jie

Record

324509 Peter 254389 John 342532 Bill 112543 Helen Smith Smith Lee James CPSC CPSC MATH CHEM CPSC MATH 01/09/00 01/09/02 01/01/02 01/05/01 01/01/03 01/07/00 3 June 2003 CPSC 203 by Jie Gao

Terminology (2)

 DBMS  Database Management System  Database Objects in Access  Table   Query Form  Report  Pages …… 3 June 2003 CPSC 203 by Jie Gao

Plan for the Lab

 First part  Basic operation in Access: create table, alter table, input data, append or insert data, sort records, forms, …  Second part  Advanced operation in Access: queries, reports, …  Assignment requirements 3 June 2003 CPSC 203 by Jie Gao

Creating A Table

 Design table structure  Add fields  Select data type for fields  Set input mask for fields   Set primary key Give the table a name 3 June 2003 CPSC 203 by Jie Gao

Alter A Table

 Change in design view  Everything could be changed  If delete a field, the data in that field will be deleted 3 June 2003 CPSC 203 by Jie Gao

Edit Data

   Input data in datasheet view The format should conform to the mask Move insert point among records using the navigator at the bottom of the datasheet view 3 June 2003 CPSC 203 by Jie Gao

A Little More Work

 Sort  By a field  Ascending or descending 3 June 2003 CPSC 203 by Jie Gao

Forms in Access

 A form in Access is used to provide a friendly interface to the user  The user can input data into a table through a form created on that table  The user can also navigate data by using the form 3 June 2003 CPSC 203 by Jie Gao

Create a Form

  Two methods: Wizard or Design View Form Wizard is easy to use. You can create a form for a table on the fly!

 Design View can provide you more power. You can implement advanced features!

3 June 2003 CPSC 203 by Jie Gao

Form Wizard

  Select  Which fields will appear in the form You can select fields from multiple tables  Form type  Background  Name You can click “Finish” when you accept the defaults for the following steps.

3 June 2003 CPSC 203 by Jie Gao

Form Design View

 You can  Add controls to the form  Drag fields into the form  Adjust the form layout  Add header or footer  Even do something like programming 3 June 2003 CPSC 203 by Jie Gao