0% found this document useful (0 votes)
29 views

Database Applications

This document discusses database applications and Microsoft Access. It defines key database concepts like tables, records, fields, primary keys, and relationships. It provides instructions on how to create tables in Access using design view or by entering data. It also explains how to modify table structures, enter and modify data, sort data, and create relationships between tables in a Microsoft Access database.

Uploaded by

navinthattil111
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Database Applications

This document discusses database applications and Microsoft Access. It defines key database concepts like tables, records, fields, primary keys, and relationships. It provides instructions on how to create tables in Access using design view or by entering data. It also explains how to modify table structures, enter and modify data, sort data, and create relationships between tables in a Microsoft Access database.

Uploaded by

navinthattil111
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

6.

Database Applications
6.1 Introduction ............................................................................................................................................ 2 6.1.1. Definitions ...................................................................................................................................... 2 6.2. Microsoft Access .................................................................................................................................... 3 6.3. Tables ..................................................................................................................................................... 4 6.3.1. Creating Tables................................................................................................................................ 4 6.3.1.1. Creating Tables in Design View ................................................................................................ 4 6.3.1.2. Creating a Table by Entering Data ........................................................................................... 5 6.3.2. Modifying the Table Structure ........................................................................................................ 6 6.3.3. Entering and Modifying Data .......................................................................................................... 6 6.3.4. Sorting the Data .............................................................................................................................. 6 6.4. Relationships .......................................................................................................................................... 7

Database Applications

Database Applications
6.1 Introduction
A simple definition of a database is a structured collection of related data about one or more subjects. Databases generally come in one of two styles: flat file and relational. Flat File Databases are basically used for simple lists and may have duplication of data much like a simple record card system. Relational databases are those where the data is held in a number of cross-referenced files in order to reduce duplication. They make it easier to find, analyze, maintain and protect data because it is all held in one place. Nowadays, relational databases are used widely to store data. Therefore, we will discuss only relational databases from now on.

6.1.1. Definitions
A collection of data relevant to a given subject is held in a Table. A Record is information that is related to a single item. A Field is an individual data item held for each record. Fields can be further defined in terms of size, type of information, possible values etc.
Field (Column)

Table

Employee No
Record (Row)

Employee Name A.B.C Silva G. Gunasekara M. Piyasiri

Date Appointed 10th June 2004 12th May 2003 2nd January 2005

1111 2222 3333

Each table should be allocated a primary key. A Primary Key is a field or combination of fields which uniquely identifies the record in a table. The primary key field must always contain a value (i.e it cannot be NULL). Foreign keys should be maintained to establish relationships among different tables. A Foreign Key is a field in one table which is equal to the primary key column in another table. There should be relationships among tables in the database. The three types of relationships are: oneto-many; one-to-one; and many-to-many. Microsoft Access uses the following notations: A line indicates a relationship between two tables. A figure 1 at the end of a line indicates the one side of a relationship. The infinity symbol at the end of a line indicates the many side of a relationship.

Database Applications

6.2. Microsoft Access


Microsoft Access is a relational database management system. It provides a powerful way of storing, sorting, manipulating and retrieving data. The power of Access is that it is easy for beginners, to start developing simple databases straight away using basic functions. It is also used for the development of sophisticated application systems. Access allows modifying fields and tables after entering data. When you start Access, no database is open. Once a database is opened in the normal manner, the following window will be displayed.

Microsoft Access consists of many types of objects such as tables, queries, forms, reports etc. It is possible to move between the different objects by clicking on the relevant drop down menu called All Access Objects in the left-hand side of the window. Then, the selected objects will be shown below the menu.

Database Applications

6.3. Tables
6.3.1. Creating Tables
Microsoft Access provides various methods of creating tables. In this unit, we will look at the basics of creating tables in Access. More advanced details will be considered in the Database Development unit in the Advanced course. 6.3.1.1. Creating Tables in Design View Select, create => Table Design The following screen will appear.

Type the field names of each field one below the other in the Field Name column. For each field, select the data type from the drop down that appears in the Data Type column. The field types used commonly are text, number, date/time and currency. The auto number field type automatically enters a number beginning with 1 and saving consecutive values for each record. A description can also be entered against each field. Once all field details are entered, save the table. A popup window will prompt for the name of the table. If no primary key is defined, a dialog box will appear asking whether to create a primary key. If Yes is selected, an additional column will be added to the table and this column will be taken as the primary key.

Database Applications

It is possible to specify the primary key before saving the table. Click on the relevant field and click the Primary Key button in the ribbon.

Close the table window. The newly created table will appear as an item in the left-hand pane of the database window when the Tables dropdown is selected.

6.3.1.2. Creating a Table by Entering Data Select create => Table The following screen will appear.

Directly enter the data into the different fields in the table. Right click on each column and select Rename Field. Enter the column name. Once all data is entered, save the table. A popup window will prompt for the name of the table. If no primary key is defined, a dialog box will appear asking whether to create a primary key. If Yes is selected, an additional column will be added to the table and this column will be taken as the primary key. Close the table window. The newly created table will appear as an item in the left-hand pane of the database window when the Tables dropdown is selected.

Database Applications

6.3.2. Modifying the Table Structure


Right click on the table in the database window and select Design View. The table structure will appear as when creating the table in design view. Do the necessary modifications and save the table.

6.3.3. Entering and Modifying Data


Double click on the table in the database window. The table will be opened as if creating the table by entering data. Do the necessary modifications and save the table. New rows can be entered by simply clicking on the first available blank line and entering data. To delete a row from the table, right-click on the row indicator, and select Delete Record.

6.3.4. Sorting the Data


Double click on the table in the database window. The table will be opened as if creating the table by entering data. Right click on the heading of the field to sort by. Select Sort A to Z or Sort Z to A depending on which order you need to sort by. The records will be sorted in the specified order.

Database Applications

6.4. Relationships
Relationships can be created between tables (and queries). When a relationship is created, one table acts as the master table and the other table acts as the child table. The primary key field in the master table should exist as a non-primary key field in the child table. The data type and size of the corresponding fields in the two tables must match exactly. Create the tables among which the relationship exists. Define the primary key of each table. Set the field type and size of the matching column in the child table to the same field type and size as the primary key in the master table. Select Database Tools => Relationships icon in the ribbon. A dialog box will appear. The Tables tab page of this dialog box will contain a list of tables that are defined in the database. Select each table that needs to be related and click Add. Use this method to add both the master and child tables to the relationship window. The relationships window will be displayed.

Database Applications

You might also like