Module 5 Databases Astro Computer Training Page 1
1. Database Terminologies What is a Database? A database is a collection of data related to a particular topic organised and stored for easy retrieval. Some of the common uses of large-scale databases include airline booking systems, government records, bank account records and hospital patient details. Data and Information Data refers to raw facts, while Information is data processed in a way that has meaning and value. How Databases are Organised A database is organised into tables, queries, forms and reports, a table is the primary object in a database and is organised into Fields and records, and in the image CategoryID is a field while all the details relating to CategoryID 4 is a record. Table Design Tables should contain a single subject only for example member s details. Fields should be used for separate entities for example a field should be used for first name and a different field should be used for the second name likewise Address1, Address2 etc this supports easier searching at a later stage What is the Primary Key? Each table in a database should include a field that uniquely identifies each record; this field is called the primary key field of the table. Once you designate a primary key for a table, Microsoft Access will prevent you from entering duplicate values in that field. A typical primary field is a person s PPS number. What is an Index? An index helps Microsoft Access to find and sort records faster, field/s you index should be the ones you search frequently. The primary key is indexed automatically. Relationships The main purpose of relating tables in a database is to minimise duplication of data. Importance of Maintaining the Integrity of Relationships Referential integrity is a system of rules that ensure relationships between records in related tables are valid and that you do not accidentally delete or change related data. Database Operation A database administrator allocates access rights to users, so records can be changed only by authorised people. The administrator will also recover the database after a crash or loss of data. Database specialists are responsible for the accuracy of data, design and maintenance of the database, while database users input data Astro Computer Training Page 2
2. Using the Program Starting Access Like other Office applications, there are two ways to start access, using the Start Button select Programs/Microsoft Office/Microsoft Office Access 2007 A second method is to double click on the Access shortcut Icon on the Desktop Creating a Blank Database When Access opens, the Getting Started Dialog Box appears Click the Blank Database Icon Enter a File Name Use the Navigation Icon to locate the location where you wish to save the Database Then Click Create Now close the default table that opens For the purpose of this manual, we will name the Database Kelly Auctioneers and save it to the Student Folder. If you are creating the Database at home then save it to a folder of your choice 3. Customising Access Changing User Information Click on the Office Button and select Access Options Using the Popular Tab options and under the Personalize your copy of Microsoft Office enter your name as the User name and then your Initials Astro Computer Training Page 3
Minimize the Ribbon Sometimes it happens that you need more working space and the ribbon is taking up too much space, you may want to minimize the ribbon There are two ways to do this click on the drop-down arrow at the right side of the quick access toolbar and then select Minimize Ribbon. To Maximise the ribbon use the Quick Access Toolbar Ribbon and select Minimize Ribbon Using Help Click the Help Icon In the Search Field type the information you are looking for Click the Search Button Access Returns a list of search items Click on the required information 4. Tables What are Tables? A table is the building block in access; you can do nothing in access until you create a table. Tables are similar to excel spreadsheets, consisting of rows. Columns and cells columns are referred to as fields and rows as records Creating a Table When you create a Database you are provided with a default table called Table1, we will close this table. Click on the bottom close control button to close this table and stay in Access Astro Computer Training Page 4
To create a table use the Create Tab and in the Tables Group click the Table Design Icon The Table Design Dialog Box appears We will enter PropertyID as the first field name and use as the Data Type. Leave all other settings as default and we will change these later The different Data Types are changed using the drop-down arrow and then selecting the type you wish to use. More on Data Types later.. We will add the following Fields and Data Types to our table Saving a Table Use the Office Button and select Save As Enter Property Details as the Name for the Table, ensure you are saving the table as a table and click OK Astro Computer Training Page 5
When prompted about a Primary Key select No we will come back to Primary Keys later You must be in the Data Sheet view to enter records, click on the Home icon and then the Datasheet view icon to switch to the Datasheet View The Datasheet View The datasheet view allows you to enter records we will enter records later. At this stage will close the table as we are going to modify this table later. Close all open documents and return to the Desktop Astro Computer Training Page 6
Database Class Exercise No 1 1. Open Microsoft Access 2. Create a Blank Database called Sky Travel and save it to your folder. 3. Create a table using the following Field Names and Data Types, leave all other properties at default Field Name Name Agent Destination Ref No Departure Price Data Type 4. Save the Table as Daily Bookings 5. Do not assign a Primary Key 6. Switch to the Datasheet View 7. Close and Exit Access Astro Computer Training Page 7