SlideShare a Scribd company logo
1 of 10
Download to read offline
Database Use & Design 
Database Use & Design 
1 Important Terms and Definitions 
Database 
A collection of information organized in such a way that a computer program can quickly select desired pieces of data. 
Field 
A category of information. E.g. First name or last name. 
Form 
Used in databases to make it easier to enter and modify information. 
Primary Key 
A field that can uniquely identify each record. 
Query 
A query uses a set of rules (criteria) to select specific records from the database. 
Record 
A complete set of information in a database. E.g. details about a particular person 
Relationship 
A link between two database tables that have related information. E.g. A link between student details and the results for each student. 
Report 
Reports are used to present data in a neat, ready to print format. 
Table 
Data arranged in rows and columns. All database information is stored in tables. 
2 Possible uses for a Database 
• Store student details and marks. 
• Keep track of books and book loans. 
• (Write some other database ideas) 
• 
• 
• 
© Steve O’Neil 2005 Page 1 of 10 http://www.oneil.com.au/pc/ 
•
Database Use & Design 
3 Steps in creating a database 
1. Clearly define the purpose of the database. 
2. Decide what information you want to get out of the database. E.g. weekly printout of book loans. 
3. Decide what information the database will need to store in order to generate the desired output. 
4. Plan tables to store the information in the database and decide what fields will be in each table. 
5. Create a database file in Access and create the tables in the database. 
6. Create forms to assist in entering information. 
7. Create queries to generate the required output. 
8. Create reports to present the output neatly, ready for printing. 
Each of these steps is described in the following sections. 
1.1 Clearly Define the Purpose of the Database 
The most important step in creating a database is to have a clear idea of why you want to create a database. 
1.2 Decide what information you want to get out of the database 
Once you have established the purpose of the database, you then need to determine what the output will be. E.g. you may decide that your database will need to do the following: 
• Generate weekly reports of student results. 
• Produce a report showing details of a particular student whenever needed. 
1.3 Decide what information the database will need to store 
© Steve O’Neil 2005 Page 2 of 10 http://www.oneil.com.au/pc/ 
Decide what information will need to go in to the database in order to get the information you want out of the database. E.g. if you would like your database to create weekly reports showing specific details about each student, then those details will become the basis for the tables in your database. At this point it can be useful to create a list of all the information you think you may need to store in the database.
Database Use & Design 
1.4 Plan tables 
Now the information can be arranged in to one or more tables. It helps to draw up a sample on paper with some sample data. When you have done that, it may be apparent that the table will need to be divided in to more than one table. In more complex databases, this is accomplished by a structured process called Normalisation. The following simple example of student marks illustrates where more than one table may be needed. 
Student Number 
Name 
Address 
Date of Birth 
Subject 
Mark 
1 
Brain E. 
1 Smart St Kalgoorlie WA 6430 
1/6/86 
Maths 
90 
1 
Brain E. 
1 Smart St Kalgoorlie WA 6430 
1/6/86 
English 
84 
1 
Brain E. 
1 Smart St Kalgoorlie WA 6430 
1/6/86 
Human Biology 
92 
2 
Dumb O. 
40 Dunce Way Kalgoorlie WA 6430 
6/3/86 
Maths 
54 
2 
Dumb O. 
40 Dunce Way Kalgoorlie WA 6430 
6/3/86 
English 
38 
2 
Dumb O. 
40 Dunce Way Kalgoorlie WA 6430 
6/3/86 
Physics 
42 
From looking at the above example, it is apparent that a lot of information is being repeated unnecessarily. Every time you enter a student’s results, you have to repeat the student details such as address and date of birth. This means more typing, more data for your computer to store and more chance of making errors. This problem can be avoided by dividing the information in to two tables. One to store the student details and a separate table to store the grades for each student. The following example shows these two tables, with student number being used as a link (relationship) between the tables. 
In addition to breaking a table in to more than one table, it is also often a good idea to break up a field. For example, the address field can be divided in to address, suburb, state and postcode. This will enable you to sort in order of state and suburb etc, which wouldn’t be possible otherwise. 
© Steve O’Neil 2005 Page 3 of 10 http://www.oneil.com.au/pc/ 
Student Table 
Student Number 
Name 
Address 
Date of Birth 
Grades Table 
Grade Number 
Subject 
Mark 
Student Number
Database Use & Design 
1.5 Create a Database File in Access and Create the Tables 
When you create a new file in access, all of the tables, queries, forms and reports will be stored in that one file. Once a new file is created, you will see a window like the following. 
This is the database window and it can be used to get to the important sections of your database. If this window is not visible, you can display it by pressing the F11 key. 
From the database window, choose Create table in Design view to create a new table. A window like the one on the following page will appear. 
© Steve O’Neil 2005 Page 4 of 10 http://www.oneil.com.au/pc/
Database Use & Design 
The top part of the window is for entering field names. For each field, you can specify a filed type such as text, number or date/time. An optional field description may also be entered. Each table needs to have a primary key. This is a field that can uniquely identify each record in the table. In the example above, last name could not be used as a primary key because there may be more than one student with the same last name. The same is true for each of the other fields that follow so a new field, Student Number, is used to give each student record a unique identifier. This field has been set as an auto number field, which means that each new record will have a unique number entered in to that field automatically, rather than the user having to think up a new number for each one. When a field is selected, it can be designated as the primary key by clicking the key icon on the toolbar. 
The bottom part of the window allows you to provide additional information for each field using a range of properties. The properties you can change will vary depending on what field type is chosen. The above example shows the properties for a Date/Time field. To learn about any of the properties, click in it and press the F1 key. This will take you directly to a comprehensive explanation of the purpose and use of that particular property, often with examples. 
© Steve O’Neil 2005 Page 5 of 10 http://www.oneil.com.au/pc/ 
When a table is created, you can choose the save option, which will save the table as part of the database file, rather than as a separate file.
Database Use & Design 
If more than one table has been created and the tables need to be linked, this can be done through the relationships window. When you are in the main Database window, you can get to it by clicking the Relationships icon on the toolbar. 
From the relationships window, you can add the tables that are needed and then link the tables by dragging one related field on to the other. In the example shown below, the relationship was created by dragging Student number from the STUDENTS table to Student Number on the GRADES table, since this is the field that both tables have in common. This relationship will ensure that each grade record will be linked to a related student record. 
Once the relationship(s) is created, you can save and close the relationships window. 
1.6 Create Forms to Assist in Entering Information 
Although you can use the tables to enter information in to the database, most people find it easier to enter and edit records using a form. Forms can be easily created using a form wizard. 
To create a form using the tables in the example above you can follow the steps below. 
1 From the Database window, choose Forms from the options on the left. 
2 Double-click Create form by using the wizard. 
3 The first step in the wizard allows you to choose what information will be used in the form. For this example you can choose all of the fields from the STUDENT table followed by the fields from the GRADES table. 
4 The next step allows you to choose a form layout that will show the student details at the top and each of the grades for the student at the bottom. 
5 The next two steps allow you to decide the layout and format of the form while that last step allows you to choose a name that the form will be saved as. 
© Steve O’Neil 2005 Page 6 of 10 http://www.oneil.com.au/pc/ 
The resulting form will look similar to the one on the following page.
Database Use & Design 
In this example, the top half of the form is used to enter information about the student. The bottom half is used to enter the marks for each subject the student does. This is actually two forms, with one form being displayed inside the other form. The relationship between the STUDENT table and the MARKS table makes this form/subform arrangement possible. 
When you are entering records in to a database there are a few things to keep in mind. 
• If a field is an auto number such as the Student Number above, then you don’t need to enter anything in to that field. As soon as you enter information in the other fields, a number will be filled in automatically (normally the number following the one in previous record). 
• You can use the Tab key to go to the next field and Shift Tab to go back to the previous field. 
• In addition to using the navigation buttons at the bottom of the form, you can also use the Page Up and Page Down keys to move between records in a form. 
• If you go past the last record, you will be given a new blank record to fill in. 
• If you want enter the same information as the previous record in the same field, there is an easy way to do it. E.g. If you are entering an address where the suburb is Kalgoorlie, and the previous record also had Kalgoorlie in the same field, you can press Ctrl ‘ to fill in the same entry as the previous record. 
© Steve O’Neil 2005 Page 7 of 10 http://www.oneil.com.au/pc/ 
• You don’t need to save records. As soon as you move on to the next record, or close the form/table, the record you just entered will be saved. The only time anything in access needs to be saved is when you changed the structure of the database. I.e. adding or editing the design of objects such as database and forms. Changes and additions to data are saved automatically.
Database Use & Design 
1.7 Create Queries to Generate the Required Output 
Queries allow you to manipulate information in your database in a number of different ways. The most common type of query is the select query, which uses criteria to select certain data from the database. In the database that the previous examples have referred to, the following steps could be used to create a query that uses criteria to show which students are doing a particular subject. 
1. From the database window, choose the Queries option from the left. 
2. Double-click Create a query in Design view. 
3. The first thing you will see is a window which allows you to select which tables the information in the query will come from. In this example we will add both the STUDENTS table and the MARKS table. 
4. A lot of the areas in the Query Design window, such as the tables you’ve added, can be resized to make them easier to work with. 
5. The next step is to select which fields will be used in the query results. There are several ways to do this but one way is to double click on the fields in the lists at the top. For our example, the fields chosen are the student details (Last Name, First Name, Address, Suburb, State, Postcode and Date of Birth) and the subject name (Subject field from the grades table). 
6. Once you have selected the fields to use you can then add your criteria. Criteria can be added to as many fields you like. The more criteria you add, the more specific the results will be. This usually means fewer results. Since we want to see student who are doing a particular subject, we can type the name of a subject (E.g. English) under the subject field in the Criteria row. The query should look similar to the following picture. 
7. To see the results of the query you can click the Datasheet view icon. 
8. The result should be a table showing the details of students who are doing the specified subject (English). You can use the same icon to return to the design view, though it will now appear as the Design View icon. 
© Steve O’Neil 2005 Page 8 of 10 http://www.oneil.com.au/pc/ 
9. You can save the query with an appropriate name so that it can be re-used.
Database Use & Design 
You can make the query more versatile by turning it in to a “Parameter Query”. In its current state, the query will only show the results for one subject. If you want a different subject shown, you need to go back in to design view and change the criteria. A parameter Query allows you to specify different criteria each time you view the query, without having to change the query design. 
To change the above query in to a parameter query, all you would need to do is change the criteria for the Subject field to the following. 
[Enter a subject] 
The square brackets specify that the criteria will be entered when the query is viewed. The text inside the brackets provides the text for the message that will prompt the user for the criteria when the query runs. Once that change has been made, when the query is viewed, a dialog like the following will appear. 
The user can type the name of a subject in to the box provided and whatever they type will be used as the criteria for the query. Different criteria can be entered each time the query is run. 
Tips for queries 
• Query results are dynamic. They will always show the most current data. If you add or change records in a database, these changes will affect query results. 
• Give your queries descriptive names which describe their purpose. When you have a lot of queries in a database (especially created by different people using the same database), it can be very difficult to tell which is which unless they have descriptive names. 
• If you want to view records where a certain field is empty, use “null” for the criteria in that field. 
• Use wildcards if you want your queries to be less specific. E.g. Entering “Smith” for the last name criteria will only give you records where the last name is exactly “Smith”. Entering “Sm*” for the criteria in last name will give you any record where the last name begins with the letters Sm (Smyth, Smart, Smith). 
• Use =Date() to represent the current date. E.g. if =Date() is used as the criteria for a query then the results will be all records with the current date. 
• To find records above, below or between two amounts use “and”. E.g. 
o >100 = Amounts greater than 100 
o >=1/1/03 and <=date() = all dates from the beginning of the year 2003 to the current date. 
© Steve O’Neil 2005 Page 9 of 10 http://www.oneil.com.au/pc/ 
o >=M and <S = “M” through to “R”
Database Use & Design 
1.8 Create Reports 
We’ve seen that queries can be used to select the information you need from a database but reports can be used to present that information neatly. Reports can be based directly on a table to show the entire contents of that table but it is more common to create a report based on query output. 
In the example below, we’ll create a report based on the query from the previous section using the report wizard. 
1 From the Database window, select Reports from the left. 
2 Double-click Create reports by using wizard. 
3 The first step in the wizard allows you to specify where the information in the report is coming from. From Tables/Queries, select the name of the query created earlier for the student grades. To select all of the fields listed, click the button. All of the fields will now be placed on the right hand side. Click next to continue. 
4 The next step of the wizard asks how you want the results grouped. By default it will list the details of each student followed by the subject details for each student. Since the query will only show the records for one subject, there’s no need to have the report grouped in this way so choose the “by GRADES” option and click next. 
5 You can choose to group by additional fields (such as group records by suburb) but that won’t be necessary here so click next. 
6 You can now choose the sort order for your report. If your report included numerical fields (such as the student mark), there would also be a summary options button that can be used for automatically adding totals. 
7 The next two steps allow you to specify the layout and format of the report. 
8 The last step allows you to specify a name for the report to be saved as. This will also be used as the main heading on the report so choose carefully unless you don’t mind venturing in to design view afterwards. 
9 When complete, the form will display in print preview view ready for printing. Because this report was based on a parameter query, the parameter asking for the subject will appear before the report results are displayed. 
10 After the wizard is finished it will automatically be saved under the name you specified. It may be necessary to go in to the report’s design view to change the width of headings etc. Be careful in design view. The wizard makes the report just the right size to fit on a page. Moving or resizing things too close to the edge of the page can make the report too big to fit if you’re not careful. 
© Steve O’Neil 2005 Page 10 of 10 http://www.oneil.com.au/pc/

More Related Content

What's hot

Access introduction
Access introductionAccess introduction
Access introductionJithin Zcs
 
Access 2007-Datasheets 1-Create a table by entering data
Access 2007-Datasheets 1-Create a table by entering dataAccess 2007-Datasheets 1-Create a table by entering data
Access 2007-Datasheets 1-Create a table by entering dataOklahoma Dept. Mental Health
 
Using microsoftaccess1 gettingstarted
Using microsoftaccess1 gettingstartedUsing microsoftaccess1 gettingstarted
Using microsoftaccess1 gettingstartedjcjo05
 
Ms access tutorial
Ms access tutorialMs access tutorial
Ms access tutorialminga48
 
Basic Access Notes
Basic Access NotesBasic Access Notes
Basic Access NotesPyi Soe
 
Microsoft Access 2007
Microsoft Access 2007Microsoft Access 2007
Microsoft Access 2007Reshma Arun
 
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasksMS Access teaching powerpoint tasks
MS Access teaching powerpoint tasksskomadina
 
Access lesson 03 Creating Queries
Access lesson 03 Creating QueriesAccess lesson 03 Creating Queries
Access lesson 03 Creating QueriesAram SE
 
PPT On MS-Access 2007 | Full Concepts |
PPT On MS-Access 2007 | Full Concepts |PPT On MS-Access 2007 | Full Concepts |
PPT On MS-Access 2007 | Full Concepts |Umesh Kumar
 
Class viii ch-4 working with queries
Class  viii ch-4 working with queriesClass  viii ch-4 working with queries
Class viii ch-4 working with queriesjessandy
 
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAccess lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAram SE
 
Tutorial for using SQL in Microsoft Access
Tutorial for using SQL in Microsoft AccessTutorial for using SQL in Microsoft Access
Tutorial for using SQL in Microsoft Accessmcclellm
 
MS Office Access Tutorial
MS Office Access TutorialMS Office Access Tutorial
MS Office Access TutorialvirtualMaryam
 
Access lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAccess lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAram SE
 
MICROSOFT ACCESS (ICTL)
MICROSOFT ACCESS (ICTL)MICROSOFT ACCESS (ICTL)
MICROSOFT ACCESS (ICTL)Nad0209
 
Access lesson 06 Integrating Access
Access lesson 06  Integrating AccessAccess lesson 06  Integrating Access
Access lesson 06 Integrating AccessAram SE
 
Class viii ch-3 working with tables
Class  viii ch-3 working with tablesClass  viii ch-3 working with tables
Class viii ch-3 working with tablesjessandy
 

What's hot (19)

Access introduction
Access introductionAccess introduction
Access introduction
 
Access 2007-Datasheets 1-Create a table by entering data
Access 2007-Datasheets 1-Create a table by entering dataAccess 2007-Datasheets 1-Create a table by entering data
Access 2007-Datasheets 1-Create a table by entering data
 
Using microsoftaccess1 gettingstarted
Using microsoftaccess1 gettingstartedUsing microsoftaccess1 gettingstarted
Using microsoftaccess1 gettingstarted
 
Ms access tutorial
Ms access tutorialMs access tutorial
Ms access tutorial
 
Basic Access Notes
Basic Access NotesBasic Access Notes
Basic Access Notes
 
Microsoft Access 2007
Microsoft Access 2007Microsoft Access 2007
Microsoft Access 2007
 
MS Access teaching powerpoint tasks
MS Access teaching powerpoint tasksMS Access teaching powerpoint tasks
MS Access teaching powerpoint tasks
 
Access 2007
Access 2007Access 2007
Access 2007
 
Access lesson 03 Creating Queries
Access lesson 03 Creating QueriesAccess lesson 03 Creating Queries
Access lesson 03 Creating Queries
 
PPT On MS-Access 2007 | Full Concepts |
PPT On MS-Access 2007 | Full Concepts |PPT On MS-Access 2007 | Full Concepts |
PPT On MS-Access 2007 | Full Concepts |
 
Class viii ch-4 working with queries
Class  viii ch-4 working with queriesClass  viii ch-4 working with queries
Class viii ch-4 working with queries
 
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying FormsAccess lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying Forms
 
Tutorial for using SQL in Microsoft Access
Tutorial for using SQL in Microsoft AccessTutorial for using SQL in Microsoft Access
Tutorial for using SQL in Microsoft Access
 
Access 2010
Access 2010Access 2010
Access 2010
 
MS Office Access Tutorial
MS Office Access TutorialMS Office Access Tutorial
MS Office Access Tutorial
 
Access lesson 02 Creating a Database
Access lesson 02 Creating a DatabaseAccess lesson 02 Creating a Database
Access lesson 02 Creating a Database
 
MICROSOFT ACCESS (ICTL)
MICROSOFT ACCESS (ICTL)MICROSOFT ACCESS (ICTL)
MICROSOFT ACCESS (ICTL)
 
Access lesson 06 Integrating Access
Access lesson 06  Integrating AccessAccess lesson 06  Integrating Access
Access lesson 06 Integrating Access
 
Class viii ch-3 working with tables
Class  viii ch-3 working with tablesClass  viii ch-3 working with tables
Class viii ch-3 working with tables
 

Viewers also liked

Planning booklet
Planning bookletPlanning booklet
Planning bookletEmma Wells
 
KevinThet_Resume_2016
KevinThet_Resume_2016KevinThet_Resume_2016
KevinThet_Resume_2016Kevin Thet
 
5651 sayılı kanun
5651 sayılı kanun5651 sayılı kanun
5651 sayılı kanunAhmet Soylu
 
WATCH - MA15 - Cote de Pablo feature
WATCH - MA15 - Cote de Pablo featureWATCH - MA15 - Cote de Pablo feature
WATCH - MA15 - Cote de Pablo featureMichele Shapiro
 
σχεδιο υποβολης 2015 ανθρωπινα δικαιωματα
σχεδιο υποβολης 2015 ανθρωπινα δικαιωματασχεδιο υποβολης 2015 ανθρωπινα δικαιωματα
σχεδιο υποβολης 2015 ανθρωπινα δικαιωματαEvi Kamariotaki
 
Arctic monkeys’ brainstorm music video analysis
Arctic monkeys’ brainstorm music video analysisArctic monkeys’ brainstorm music video analysis
Arctic monkeys’ brainstorm music video analysisHajar Abdo
 
Graphics 32 bit
Graphics 32 bitGraphics 32 bit
Graphics 32 bitAsjad Ali
 
Thriller/Drama codes and conventions
Thriller/Drama codes and conventionsThriller/Drama codes and conventions
Thriller/Drama codes and conventionsjworgan
 
recreational activities by SW students in disaster affected area
recreational activities by SW students in disaster affected arearecreational activities by SW students in disaster affected area
recreational activities by SW students in disaster affected areaAChing May
 
HOW TO HACK FACEBOOK BY MOBILE
HOW TO HACK FACEBOOK BY MOBILE HOW TO HACK FACEBOOK BY MOBILE
HOW TO HACK FACEBOOK BY MOBILE June_Johnson
 
Planning for my magazine
Planning for my magazinePlanning for my magazine
Planning for my magazineHollieBadrock
 
My lastvations
My lastvationsMy lastvations
My lastvationsLuciaCo
 
Israr_Ahmed CV New
Israr_Ahmed CV NewIsrar_Ahmed CV New
Israr_Ahmed CV NewIsrar Ahmed
 

Viewers also liked (16)

Planning booklet
Planning bookletPlanning booklet
Planning booklet
 
KevinThet_Resume_2016
KevinThet_Resume_2016KevinThet_Resume_2016
KevinThet_Resume_2016
 
5651 sayılı kanun
5651 sayılı kanun5651 sayılı kanun
5651 sayılı kanun
 
WATCH - MA15 - Cote de Pablo feature
WATCH - MA15 - Cote de Pablo featureWATCH - MA15 - Cote de Pablo feature
WATCH - MA15 - Cote de Pablo feature
 
σχεδιο υποβολης 2015 ανθρωπινα δικαιωματα
σχεδιο υποβολης 2015 ανθρωπινα δικαιωματασχεδιο υποβολης 2015 ανθρωπινα δικαιωματα
σχεδιο υποβολης 2015 ανθρωπινα δικαιωματα
 
Session 4
Session 4Session 4
Session 4
 
Arctic monkeys’ brainstorm music video analysis
Arctic monkeys’ brainstorm music video analysisArctic monkeys’ brainstorm music video analysis
Arctic monkeys’ brainstorm music video analysis
 
Graphics 32 bit
Graphics 32 bitGraphics 32 bit
Graphics 32 bit
 
Biologi-Sel
Biologi-SelBiologi-Sel
Biologi-Sel
 
Thriller/Drama codes and conventions
Thriller/Drama codes and conventionsThriller/Drama codes and conventions
Thriller/Drama codes and conventions
 
recreational activities by SW students in disaster affected area
recreational activities by SW students in disaster affected arearecreational activities by SW students in disaster affected area
recreational activities by SW students in disaster affected area
 
HOW TO HACK FACEBOOK BY MOBILE
HOW TO HACK FACEBOOK BY MOBILE HOW TO HACK FACEBOOK BY MOBILE
HOW TO HACK FACEBOOK BY MOBILE
 
ComColor-X1-7110-Brochure
ComColor-X1-7110-BrochureComColor-X1-7110-Brochure
ComColor-X1-7110-Brochure
 
Planning for my magazine
Planning for my magazinePlanning for my magazine
Planning for my magazine
 
My lastvations
My lastvationsMy lastvations
My lastvations
 
Israr_Ahmed CV New
Israr_Ahmed CV NewIsrar_Ahmed CV New
Israr_Ahmed CV New
 

Similar to Database Design & Use Guide

MS Access and Database Fundamentals
MS Access and Database FundamentalsMS Access and Database Fundamentals
MS Access and Database FundamentalsAnanda Gupta
 
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docxhyacinthshackley2629
 
MS ACCESS Tutorials
MS ACCESS TutorialsMS ACCESS Tutorials
MS ACCESS TutorialsDuj Law
 
final home work for database.DS_Store__MACOSXfinal home wo.docx
final home work for database.DS_Store__MACOSXfinal home wo.docxfinal home work for database.DS_Store__MACOSXfinal home wo.docx
final home work for database.DS_Store__MACOSXfinal home wo.docxmydrynan
 
DeVry UniversityStudent Lab ActivityBIS245 Database Essentials.docx
DeVry UniversityStudent Lab ActivityBIS245 Database Essentials.docxDeVry UniversityStudent Lab ActivityBIS245 Database Essentials.docx
DeVry UniversityStudent Lab ActivityBIS245 Database Essentials.docxduketjoy27252
 
INTRODUCTION TO ACCESSOBJECTIVESDefine th.docx
INTRODUCTION TO ACCESSOBJECTIVESDefine th.docxINTRODUCTION TO ACCESSOBJECTIVESDefine th.docx
INTRODUCTION TO ACCESSOBJECTIVESDefine th.docxmariuse18nolet
 
Advanced database
Advanced databaseAdvanced database
Advanced databasenasir1024
 
Operate Spreadsheet applications ppt.pptx
Operate Spreadsheet applications ppt.pptxOperate Spreadsheet applications ppt.pptx
Operate Spreadsheet applications ppt.pptxEsubalew21
 
Module 08 Access & Use Database Application.pptx
Module 08 Access & Use Database Application.pptxModule 08 Access & Use Database Application.pptx
Module 08 Access & Use Database Application.pptxEsubalew21
 
Creating and editing a database
Creating and editing a databaseCreating and editing a database
Creating and editing a databasecrystalpullen
 
WK8_A2 OverviewAssignment 2 Excelling with ExcelDue Week 8 an.docx
WK8_A2 OverviewAssignment 2 Excelling with ExcelDue Week 8 an.docxWK8_A2 OverviewAssignment 2 Excelling with ExcelDue Week 8 an.docx
WK8_A2 OverviewAssignment 2 Excelling with ExcelDue Week 8 an.docxambersalomon88660
 
Page 1 of 11 A. Lab # BSBA BIS245A-5B B.docx
  Page 1 of 11     A. Lab #  BSBA BIS245A-5B  B.docx  Page 1 of 11     A. Lab #  BSBA BIS245A-5B  B.docx
Page 1 of 11 A. Lab # BSBA BIS245A-5B B.docxjoyjonna282
 
Working with Star Office CALC - R.D.Sivakumar
Working with Star Office CALC - R.D.SivakumarWorking with Star Office CALC - R.D.Sivakumar
Working with Star Office CALC - R.D.SivakumarSivakumar R D .
 
10359485
1035948510359485
10359485kavumo
 
Unit 1.3 Introduction to Programming (Part 2)
Unit 1.3 Introduction to Programming (Part 2)Unit 1.3 Introduction to Programming (Part 2)
Unit 1.3 Introduction to Programming (Part 2)Intan Jameel
 
Office productivity tools (part ii) (5.71 mb)
Office productivity tools (part ii) (5.71 mb)Office productivity tools (part ii) (5.71 mb)
Office productivity tools (part ii) (5.71 mb)IMRAN KHAN
 
Splitter Student version Tutorial June 2020 - English
Splitter Student version Tutorial June 2020 - EnglishSplitter Student version Tutorial June 2020 - English
Splitter Student version Tutorial June 2020 - EnglishAdhi Wikantyoso
 

Similar to Database Design & Use Guide (20)

MS Access and Database Fundamentals
MS Access and Database FundamentalsMS Access and Database Fundamentals
MS Access and Database Fundamentals
 
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
1Copyright © 2014 Pearson Education, Inc. Publishing as Pren.docx
 
MS ACCESS Tutorials
MS ACCESS TutorialsMS ACCESS Tutorials
MS ACCESS Tutorials
 
final home work for database.DS_Store__MACOSXfinal home wo.docx
final home work for database.DS_Store__MACOSXfinal home wo.docxfinal home work for database.DS_Store__MACOSXfinal home wo.docx
final home work for database.DS_Store__MACOSXfinal home wo.docx
 
DeVry UniversityStudent Lab ActivityBIS245 Database Essentials.docx
DeVry UniversityStudent Lab ActivityBIS245 Database Essentials.docxDeVry UniversityStudent Lab ActivityBIS245 Database Essentials.docx
DeVry UniversityStudent Lab ActivityBIS245 Database Essentials.docx
 
INTRODUCTION TO ACCESSOBJECTIVESDefine th.docx
INTRODUCTION TO ACCESSOBJECTIVESDefine th.docxINTRODUCTION TO ACCESSOBJECTIVESDefine th.docx
INTRODUCTION TO ACCESSOBJECTIVESDefine th.docx
 
Advanced database
Advanced databaseAdvanced database
Advanced database
 
Operate Spreadsheet applications ppt.pptx
Operate Spreadsheet applications ppt.pptxOperate Spreadsheet applications ppt.pptx
Operate Spreadsheet applications ppt.pptx
 
Module 08 Access & Use Database Application.pptx
Module 08 Access & Use Database Application.pptxModule 08 Access & Use Database Application.pptx
Module 08 Access & Use Database Application.pptx
 
Creating and editing a database
Creating and editing a databaseCreating and editing a database
Creating and editing a database
 
Nota ms access 2007
Nota ms access 2007Nota ms access 2007
Nota ms access 2007
 
WK8_A2 OverviewAssignment 2 Excelling with ExcelDue Week 8 an.docx
WK8_A2 OverviewAssignment 2 Excelling with ExcelDue Week 8 an.docxWK8_A2 OverviewAssignment 2 Excelling with ExcelDue Week 8 an.docx
WK8_A2 OverviewAssignment 2 Excelling with ExcelDue Week 8 an.docx
 
Page 1 of 11 A. Lab # BSBA BIS245A-5B B.docx
  Page 1 of 11     A. Lab #  BSBA BIS245A-5B  B.docx  Page 1 of 11     A. Lab #  BSBA BIS245A-5B  B.docx
Page 1 of 11 A. Lab # BSBA BIS245A-5B B.docx
 
Working with Star Office CALC - R.D.Sivakumar
Working with Star Office CALC - R.D.SivakumarWorking with Star Office CALC - R.D.Sivakumar
Working with Star Office CALC - R.D.Sivakumar
 
10359485
1035948510359485
10359485
 
Unit 1.3 Introduction to Programming (Part 2)
Unit 1.3 Introduction to Programming (Part 2)Unit 1.3 Introduction to Programming (Part 2)
Unit 1.3 Introduction to Programming (Part 2)
 
Office productivity tools (part ii) (5.71 mb)
Office productivity tools (part ii) (5.71 mb)Office productivity tools (part ii) (5.71 mb)
Office productivity tools (part ii) (5.71 mb)
 
1. access
1. access1. access
1. access
 
Splitter Student version Tutorial June 2020 - English
Splitter Student version Tutorial June 2020 - EnglishSplitter Student version Tutorial June 2020 - English
Splitter Student version Tutorial June 2020 - English
 
Access4
Access4Access4
Access4
 

Recently uploaded

Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 

Recently uploaded (20)

Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 

Database Design & Use Guide

  • 1. Database Use & Design Database Use & Design 1 Important Terms and Definitions Database A collection of information organized in such a way that a computer program can quickly select desired pieces of data. Field A category of information. E.g. First name or last name. Form Used in databases to make it easier to enter and modify information. Primary Key A field that can uniquely identify each record. Query A query uses a set of rules (criteria) to select specific records from the database. Record A complete set of information in a database. E.g. details about a particular person Relationship A link between two database tables that have related information. E.g. A link between student details and the results for each student. Report Reports are used to present data in a neat, ready to print format. Table Data arranged in rows and columns. All database information is stored in tables. 2 Possible uses for a Database • Store student details and marks. • Keep track of books and book loans. • (Write some other database ideas) • • • © Steve O’Neil 2005 Page 1 of 10 http://www.oneil.com.au/pc/ •
  • 2. Database Use & Design 3 Steps in creating a database 1. Clearly define the purpose of the database. 2. Decide what information you want to get out of the database. E.g. weekly printout of book loans. 3. Decide what information the database will need to store in order to generate the desired output. 4. Plan tables to store the information in the database and decide what fields will be in each table. 5. Create a database file in Access and create the tables in the database. 6. Create forms to assist in entering information. 7. Create queries to generate the required output. 8. Create reports to present the output neatly, ready for printing. Each of these steps is described in the following sections. 1.1 Clearly Define the Purpose of the Database The most important step in creating a database is to have a clear idea of why you want to create a database. 1.2 Decide what information you want to get out of the database Once you have established the purpose of the database, you then need to determine what the output will be. E.g. you may decide that your database will need to do the following: • Generate weekly reports of student results. • Produce a report showing details of a particular student whenever needed. 1.3 Decide what information the database will need to store © Steve O’Neil 2005 Page 2 of 10 http://www.oneil.com.au/pc/ Decide what information will need to go in to the database in order to get the information you want out of the database. E.g. if you would like your database to create weekly reports showing specific details about each student, then those details will become the basis for the tables in your database. At this point it can be useful to create a list of all the information you think you may need to store in the database.
  • 3. Database Use & Design 1.4 Plan tables Now the information can be arranged in to one or more tables. It helps to draw up a sample on paper with some sample data. When you have done that, it may be apparent that the table will need to be divided in to more than one table. In more complex databases, this is accomplished by a structured process called Normalisation. The following simple example of student marks illustrates where more than one table may be needed. Student Number Name Address Date of Birth Subject Mark 1 Brain E. 1 Smart St Kalgoorlie WA 6430 1/6/86 Maths 90 1 Brain E. 1 Smart St Kalgoorlie WA 6430 1/6/86 English 84 1 Brain E. 1 Smart St Kalgoorlie WA 6430 1/6/86 Human Biology 92 2 Dumb O. 40 Dunce Way Kalgoorlie WA 6430 6/3/86 Maths 54 2 Dumb O. 40 Dunce Way Kalgoorlie WA 6430 6/3/86 English 38 2 Dumb O. 40 Dunce Way Kalgoorlie WA 6430 6/3/86 Physics 42 From looking at the above example, it is apparent that a lot of information is being repeated unnecessarily. Every time you enter a student’s results, you have to repeat the student details such as address and date of birth. This means more typing, more data for your computer to store and more chance of making errors. This problem can be avoided by dividing the information in to two tables. One to store the student details and a separate table to store the grades for each student. The following example shows these two tables, with student number being used as a link (relationship) between the tables. In addition to breaking a table in to more than one table, it is also often a good idea to break up a field. For example, the address field can be divided in to address, suburb, state and postcode. This will enable you to sort in order of state and suburb etc, which wouldn’t be possible otherwise. © Steve O’Neil 2005 Page 3 of 10 http://www.oneil.com.au/pc/ Student Table Student Number Name Address Date of Birth Grades Table Grade Number Subject Mark Student Number
  • 4. Database Use & Design 1.5 Create a Database File in Access and Create the Tables When you create a new file in access, all of the tables, queries, forms and reports will be stored in that one file. Once a new file is created, you will see a window like the following. This is the database window and it can be used to get to the important sections of your database. If this window is not visible, you can display it by pressing the F11 key. From the database window, choose Create table in Design view to create a new table. A window like the one on the following page will appear. © Steve O’Neil 2005 Page 4 of 10 http://www.oneil.com.au/pc/
  • 5. Database Use & Design The top part of the window is for entering field names. For each field, you can specify a filed type such as text, number or date/time. An optional field description may also be entered. Each table needs to have a primary key. This is a field that can uniquely identify each record in the table. In the example above, last name could not be used as a primary key because there may be more than one student with the same last name. The same is true for each of the other fields that follow so a new field, Student Number, is used to give each student record a unique identifier. This field has been set as an auto number field, which means that each new record will have a unique number entered in to that field automatically, rather than the user having to think up a new number for each one. When a field is selected, it can be designated as the primary key by clicking the key icon on the toolbar. The bottom part of the window allows you to provide additional information for each field using a range of properties. The properties you can change will vary depending on what field type is chosen. The above example shows the properties for a Date/Time field. To learn about any of the properties, click in it and press the F1 key. This will take you directly to a comprehensive explanation of the purpose and use of that particular property, often with examples. © Steve O’Neil 2005 Page 5 of 10 http://www.oneil.com.au/pc/ When a table is created, you can choose the save option, which will save the table as part of the database file, rather than as a separate file.
  • 6. Database Use & Design If more than one table has been created and the tables need to be linked, this can be done through the relationships window. When you are in the main Database window, you can get to it by clicking the Relationships icon on the toolbar. From the relationships window, you can add the tables that are needed and then link the tables by dragging one related field on to the other. In the example shown below, the relationship was created by dragging Student number from the STUDENTS table to Student Number on the GRADES table, since this is the field that both tables have in common. This relationship will ensure that each grade record will be linked to a related student record. Once the relationship(s) is created, you can save and close the relationships window. 1.6 Create Forms to Assist in Entering Information Although you can use the tables to enter information in to the database, most people find it easier to enter and edit records using a form. Forms can be easily created using a form wizard. To create a form using the tables in the example above you can follow the steps below. 1 From the Database window, choose Forms from the options on the left. 2 Double-click Create form by using the wizard. 3 The first step in the wizard allows you to choose what information will be used in the form. For this example you can choose all of the fields from the STUDENT table followed by the fields from the GRADES table. 4 The next step allows you to choose a form layout that will show the student details at the top and each of the grades for the student at the bottom. 5 The next two steps allow you to decide the layout and format of the form while that last step allows you to choose a name that the form will be saved as. © Steve O’Neil 2005 Page 6 of 10 http://www.oneil.com.au/pc/ The resulting form will look similar to the one on the following page.
  • 7. Database Use & Design In this example, the top half of the form is used to enter information about the student. The bottom half is used to enter the marks for each subject the student does. This is actually two forms, with one form being displayed inside the other form. The relationship between the STUDENT table and the MARKS table makes this form/subform arrangement possible. When you are entering records in to a database there are a few things to keep in mind. • If a field is an auto number such as the Student Number above, then you don’t need to enter anything in to that field. As soon as you enter information in the other fields, a number will be filled in automatically (normally the number following the one in previous record). • You can use the Tab key to go to the next field and Shift Tab to go back to the previous field. • In addition to using the navigation buttons at the bottom of the form, you can also use the Page Up and Page Down keys to move between records in a form. • If you go past the last record, you will be given a new blank record to fill in. • If you want enter the same information as the previous record in the same field, there is an easy way to do it. E.g. If you are entering an address where the suburb is Kalgoorlie, and the previous record also had Kalgoorlie in the same field, you can press Ctrl ‘ to fill in the same entry as the previous record. © Steve O’Neil 2005 Page 7 of 10 http://www.oneil.com.au/pc/ • You don’t need to save records. As soon as you move on to the next record, or close the form/table, the record you just entered will be saved. The only time anything in access needs to be saved is when you changed the structure of the database. I.e. adding or editing the design of objects such as database and forms. Changes and additions to data are saved automatically.
  • 8. Database Use & Design 1.7 Create Queries to Generate the Required Output Queries allow you to manipulate information in your database in a number of different ways. The most common type of query is the select query, which uses criteria to select certain data from the database. In the database that the previous examples have referred to, the following steps could be used to create a query that uses criteria to show which students are doing a particular subject. 1. From the database window, choose the Queries option from the left. 2. Double-click Create a query in Design view. 3. The first thing you will see is a window which allows you to select which tables the information in the query will come from. In this example we will add both the STUDENTS table and the MARKS table. 4. A lot of the areas in the Query Design window, such as the tables you’ve added, can be resized to make them easier to work with. 5. The next step is to select which fields will be used in the query results. There are several ways to do this but one way is to double click on the fields in the lists at the top. For our example, the fields chosen are the student details (Last Name, First Name, Address, Suburb, State, Postcode and Date of Birth) and the subject name (Subject field from the grades table). 6. Once you have selected the fields to use you can then add your criteria. Criteria can be added to as many fields you like. The more criteria you add, the more specific the results will be. This usually means fewer results. Since we want to see student who are doing a particular subject, we can type the name of a subject (E.g. English) under the subject field in the Criteria row. The query should look similar to the following picture. 7. To see the results of the query you can click the Datasheet view icon. 8. The result should be a table showing the details of students who are doing the specified subject (English). You can use the same icon to return to the design view, though it will now appear as the Design View icon. © Steve O’Neil 2005 Page 8 of 10 http://www.oneil.com.au/pc/ 9. You can save the query with an appropriate name so that it can be re-used.
  • 9. Database Use & Design You can make the query more versatile by turning it in to a “Parameter Query”. In its current state, the query will only show the results for one subject. If you want a different subject shown, you need to go back in to design view and change the criteria. A parameter Query allows you to specify different criteria each time you view the query, without having to change the query design. To change the above query in to a parameter query, all you would need to do is change the criteria for the Subject field to the following. [Enter a subject] The square brackets specify that the criteria will be entered when the query is viewed. The text inside the brackets provides the text for the message that will prompt the user for the criteria when the query runs. Once that change has been made, when the query is viewed, a dialog like the following will appear. The user can type the name of a subject in to the box provided and whatever they type will be used as the criteria for the query. Different criteria can be entered each time the query is run. Tips for queries • Query results are dynamic. They will always show the most current data. If you add or change records in a database, these changes will affect query results. • Give your queries descriptive names which describe their purpose. When you have a lot of queries in a database (especially created by different people using the same database), it can be very difficult to tell which is which unless they have descriptive names. • If you want to view records where a certain field is empty, use “null” for the criteria in that field. • Use wildcards if you want your queries to be less specific. E.g. Entering “Smith” for the last name criteria will only give you records where the last name is exactly “Smith”. Entering “Sm*” for the criteria in last name will give you any record where the last name begins with the letters Sm (Smyth, Smart, Smith). • Use =Date() to represent the current date. E.g. if =Date() is used as the criteria for a query then the results will be all records with the current date. • To find records above, below or between two amounts use “and”. E.g. o >100 = Amounts greater than 100 o >=1/1/03 and <=date() = all dates from the beginning of the year 2003 to the current date. © Steve O’Neil 2005 Page 9 of 10 http://www.oneil.com.au/pc/ o >=M and <S = “M” through to “R”
  • 10. Database Use & Design 1.8 Create Reports We’ve seen that queries can be used to select the information you need from a database but reports can be used to present that information neatly. Reports can be based directly on a table to show the entire contents of that table but it is more common to create a report based on query output. In the example below, we’ll create a report based on the query from the previous section using the report wizard. 1 From the Database window, select Reports from the left. 2 Double-click Create reports by using wizard. 3 The first step in the wizard allows you to specify where the information in the report is coming from. From Tables/Queries, select the name of the query created earlier for the student grades. To select all of the fields listed, click the button. All of the fields will now be placed on the right hand side. Click next to continue. 4 The next step of the wizard asks how you want the results grouped. By default it will list the details of each student followed by the subject details for each student. Since the query will only show the records for one subject, there’s no need to have the report grouped in this way so choose the “by GRADES” option and click next. 5 You can choose to group by additional fields (such as group records by suburb) but that won’t be necessary here so click next. 6 You can now choose the sort order for your report. If your report included numerical fields (such as the student mark), there would also be a summary options button that can be used for automatically adding totals. 7 The next two steps allow you to specify the layout and format of the report. 8 The last step allows you to specify a name for the report to be saved as. This will also be used as the main heading on the report so choose carefully unless you don’t mind venturing in to design view afterwards. 9 When complete, the form will display in print preview view ready for printing. Because this report was based on a parameter query, the parameter asking for the subject will appear before the report results are displayed. 10 After the wizard is finished it will automatically be saved under the name you specified. It may be necessary to go in to the report’s design view to change the width of headings etc. Be careful in design view. The wizard makes the report just the right size to fit on a page. Moving or resizing things too close to the edge of the page can make the report too big to fit if you’re not careful. © Steve O’Neil 2005 Page 10 of 10 http://www.oneil.com.au/pc/