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

Database

Uploaded by

da.zos.1218
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Database

Uploaded by

da.zos.1218
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

DATABASE

Data and Information


What is data?
Data comprises of numbers, alphabets or any other form like pictures, sound, etc. It is
collected from various sources but not organized. Such data cannot be used directly
to make meaningful decisions. But when arranged, it may provide useful information.
Examples of data are,

Sugam scored 704 marks out of 800.

Teja was born on 15th January 2010.

What is information?
Information may be considered as data that has been organized and processed.
Information increases understanding and helps people in taking intelligent decisions.

Since computer is a calculating device, it is known as processor. The input is known


as data, output as information, and calculation to be performed on data is the
process. This is explained as follows:

What is database?
It is an organized collection of interrelated data stored together without harmful or
unnecessary repeated data to serve multiple applications.

Types of Databases:

There are mainly two types of databases:

Flat File Database: It refers to the data files that contain records, which have a small,
fixed number of fields, without any structured relationship. For example, Microsoft
Excel.

Relational Database: A relational database stores the data in several tables. Tables
are linked together by their common fields (columns) using the concept of keys to
retrieve the data. For example, Microsoft Access, Microsoft SQL, Oracle, OpenOffice
and MySQL.

1
Database Management System (DBMS)
It is very difficult to maintain a database manually when there are hundreds and
thousands of records, as the chances of committing errors increase.

A Database Management System (DBMS) is a computerized record keeping system


that enables us to create, modify, store, and extract information from a database.

The main function of a DBMS is

• to provide the users with efficient and reliable methods of data retrieval.
• to reduce the chances of errors.
• Data handling using DBMS becomes fast and efficient.

Advantages of DBMS
• Minimal Redundancy: It facilitates the reduction of data redundancy
(duplication) and eliminates the need for maintaining multiple copies of the
same data at different locations.
• Sharing of data: It facilitates the sharing of the data among the different users
based on their individual needs.
• Search capability: It increases the efficiency, speed, and flexibility in searching
and accessing information, thus saving time and energy.
• Standard can be enforced: The database administrator (DBA) has a complete
control over the database. DBA ensure that all applicable standards are
followed in the representation of data which will result in uniformity of the
entire database as well as its usage.
• Privacy and Security: Refers to protection of data against accidents or
intentional disclosure to unauthorised users.
• Integrity: Ensures that the stored data follows the customised standards of an
organisation. Suppose the maximum marks of an examination are set to 100,
then we can have rules to ensure that the database accepts the numbers only
between the range 0 to 100.

Disadvantages of DBMS

• DBMS software is very costly.


• High hardware cost: Additional memory and processing power may be
required to run the DBMS, resulting in the need to upgrade the hardware.

2
• Higher Programming cost: Because it is a complex tool with many features,
it requires experienced programmers resulting in extra payment for hire and
expertise.

Structure of Database

A database has a specific structure to store data.

Tables: Tables are the building blocks of a database. It stores the complete data in a
structured manner, i.e., in the form of rows and columns. Every table has a finite
number of rows and columns.

Following are the different elements of a table:

• Fields: All the columns in a table are called Fields. A field describes a particular
data of all the records in a table. For example, the field named Roll No in the
table ‘Students’, will store the roll numbers of all the students.
• Records: The rows in a table are called Records. A record has the values for
all the fields that belong to a single person or an entity. For example, when we
enter the data of all the fields, such as RollNo, FirstName and Marks for a given
student, it creates a new row in a table, which is called a record.
• Data: A set of characters that represent a valid value is known as Data. For
example: 3, Dipti, 90,88 and 70 are the data values for the specific fields of the
table ‘Students’.

Queries: A database stores a vast amount of data and it can be difficult to search
(Read) for the appropriate data in times of need. To retrieve the filtered data from a
database, queries are used, based upon some conditions. Queries are also used to
perform actions such as create, update and delete operations on the data.

3
Forms: Forms provide a user-friendly interface that facilitate the process of entering
data in tables and queries. A form has an attractive interface that accepts data from
the user and forwards it to the corresponding table or query.

Reports: Reports are used to display the selected data in a printable format. It collects
the summarised data from one or more tables/queries and organise it in a printable
form.

Microsoft Access

• It is the most popular Relational Database Management System (RDBMS).


• It has a graphical user interface. It is used to organise and manipulate a large
volume of data efficiently.
• It organises data in the form of tables.
• It provides the facility to create a relationship between these tables by using the
common fields.
• A relational database enables to prevent the duplication of data.
• Another important feature of Access is that we can add, update, delete and view
the data by using forms
• find and retrieve the data in a desired way by using queries
• print the data in a specific layout by using reports.

Components of Microsoft Access 2019

• Title Bar: It is located at the top of the window and displays the name of the current
database.
• Quick Access Toolbar: It is present at the top-left corner of the Access window. It
contains the most frequently used command buttons. By default, it has three
command buttons, which are Save, Undo and Redo.
• Ribbon: It has the various tabs, each with several groups of relevant commands,
Some tabs appear when we work with certain objects, like Forms or Reports. Such
tabs are called Contextual tabs.
• Tell me What You Want To Do: It is new feature, which can be used to get quick
help on topics that you are looking for or the commands that you want to use in your
document.
• Navigation Pane: This pane is present on the left side of the Access window. It
displays the name of the objects used in the database, like Tables, Queries, Forms,
Reports, etc.
4
• Navigation Bar: It helps in navigating through the records. It also displays the
current record number of an object.
• Object Tabs: The objects that you have opened in a database appear right above
the work area in a tabbed form. Clicking on any tab displays the contents of the
related object in the work area. To close the current tab, click on the close button
the right end of the bar.
• Status Bar: This bar is located at the bottom of the window. On its extreme left, it
displays the name of the current view, and on its right, it displays two view buttons:
Datasheet View and Design View.

Creating a Database

In Microsoft Access, there are two ways to create a database, either by using template
or creating a blank database.

1. Creating a Blank Database:


You can create a database from scratch. Follow the given steps to create a blank
database:
• Open Access database. For this, click on Start -> Access. The Start screen
appears.
• On the Start screen, click on the Blank Database option.
• The Blank Database window opens up that prompts you to specify the file name
in the File Name text box.

5
• If required, you can change the default location by clicking on the folder icon
placed next to the File Name text box.
• Click on the Create button. A new database will be created along with an empty
table named Table1.
• The Fields tab is selected by default. A new tab, i.e, Table Fields will be now
visible on the Ribbon.
• A database is created in the default location with the file name extension as
“.accdb”

Views of a Table

You can work on a table in two views: Design view and Datasheet view.

Design View: You can enter the field names, their data types and description. The
Design view is divided into two parts:

• Field Grid Pane – You can define the field names, their data types, and
description.
• Field Properties Pane – Used to set properties for the fields defined in the
table.

6
Datasheet View: It is used to enter data in a table. This view displays the table as a
grid. The fields are displayed as columns and the records are displayed as rows. The
field names are listed as the column headers. When you click on the table name in the
Navigation Pane, it opens the table in the Datasheet View.

Switching between views: Access allows you to switch from one view to the other
by following either of the two options:

• Click on the View button present in the Views group either on the Home tab or Fields
tab and select the desired view. (OR)
• Click on the Design View or Datasheet View buttons at the bottom-right corner of
the status bar.

Closing Access Application

• After finishing the work in Access, click on the Close option in the File tab to close
the current database.
• To close MS Access application, click on the Close button present at the extreme
right of the Access window.

7
2. Opening an Existing Database:
After you close the database, you can reopen it by following the given steps:
• Select the Open option from the File tab.
• Select the database from the Recent list (if present) or click on the Browse folder
and select the desired database from the Open dialog box. Click on the Open
button. The selected database will be opened.

3. Creating a Database Using Templates


One of the easiest ways to create a table is use a template. Follow the given steps
to create a database using the template:
• You will find some listed templates on the right side of the Start screen.
• Select the template from the displayed list.

8
Students Information Table

The ‘Students Information’ table consists of information about students as displayed


in the table given below. To enter the details of the students’ percentages and grades,
you do not have to include all the fields in a table, which have already been included
in the ‘Students Information’ table. You will take only a common field in the second
table. By making a link on this common field, you can retrieve the desired set of records
from both the tables.

Marks Table

Notice that the values of the Roll_No field in the Marks table are the same as the
values in the Students Information table. You can define a relationship between both
the tables using a common field, i.e., Roll_No. Thus, by splitting information in
separate tables, RDBMS reduces the duplication of data.

Adding a Table

You can add new tables to an existing database or new database by using the Design
view or Datasheet View.

1. Creating Table in Design View


To create the table in Design View, click on the Create tab as shown in the figure.
A table will open in Design view as shown in the figure. Now, you can add fields in
the table.

9
Adding Fields in Design View:
• For each field in the table, type a name in the Field Name column. Press the Tab
key to move to the Data Type column and select a data type, such as Short Text,
Number, Long Text, etc.
• In the Description column, you can type a description for each field, which is
optional. The description text is displayed on the Status bar when the cursor
points to that field in the Datasheet view.
• After defining all the fields, save the table by clicking on the Save option in the
File tab. (Or)
Click on the Save button, by right click on the Object Tab. (OR)
Click on the Save button, present on the Quick Access Toolbar.

2. Creating Table in Datasheet View


When you create a blank database, Access creates a table automatically. You can
either customize this table or create another table by using the Create tab. To create
a new table in the Datasheet View, click on the Create tab and select the Table
option in the Tables group. A new blank table will be created and opened in the
Datasheet View.
Adding Fields in Datasheet View:
• Access automatically creates the first field called ID. The data type of this field is
AutoNumber, which means Access will automatically generate a sequential
number in the field for each new record.

10
• You can add a new field in the table by entering data in the Click to Add column.
Access will automatically assign a data type based on the data you enter.
Let us enter the first record:
• Click on the empty cell below the Click to Add header. Enter the name of the
student, for example, Priya and the press the Tab key. You will notice that Access
has assigned value 1 to the ID Field and named the second column as Field1.
Similarly, add data in the other fields as shown in Figure below:
• To add new record, click on the New option in the Records group on the Home
tab. A new record will be added to the table, enter data for each field.
• Save the table by selecting the Save button.

3. Rules for Naming a Field


As you already know that a table has multiple fields and each field is unique to a
table. Each field has its own name and type of data. Following are some rules for
naming a field:
• A field name can range from 1 to 64 characters.
• A field name can include letters, numbers, and some special characters,
Generally, the underscore( _ ) sign is used.
• A field name cannot start with a blank space.
• A field name can be in the upper, lower or mixed case.
• A field name cannot have a period (.), exclamation (!), or brackets ([ ], ( ), { }).
• You can change the properties of a field name, i.e., storage size, format, and
validation rule by specifying certain characteristics in the Field Properties pane.

4. Data Types
Every table consists of fields and each field has its own set of properties, which
describes the characteristics and behaviour of data added to that field. The most
important property for a field is its data type. A field’s data type determines what
type of data you can enter into a field. For example, a field whose data type is
11
‘Number’ can only store numeric data and does not allow you to enter text data into
it.
The following table depicts the available data types in Access:
Data Types Functions
Short Text It is used to store text or a combination of text and numbers
that does not require calculations, such as addresses and
phone numbers. The fields with this data type can have a
maximum of 255 characters.
Long Text It stores the text and numbers up to 65,536 characters. It is
used for descriptive fields.
Number It stores the numeric information that you can use for
calculations. A number of data type can store integer values
as well as decimal values. The maximum size of a number
field can be 16 bytes.
Large Number The Large Number data type (eight bytes) gives you a much
greater range for calculation than the Number data type (four
bytes)
Date/Time It stores data and time value. You can display dates and
times in various formats. The maximum size used by this
data type is 8 bytes. Calculations related to data and time can
be done in this field type.
Currency This data type is used to store currency values upto 8 bytes.
The calculations can be performed on this data type.
AutoNumber It generates a sequential number whenever a new record is
added to a table. The value in the AutoNumber field cannot
be changed. It stores data as 4 byte values typically used to
create an identity column, which uniquely identifies each
record in a table.
Yes/No It is used at places where the field can have only one possible
value. It can either be True/False, Yes/No, or On/Off. For
example, a student can either be a male or a female.
OLE Object This is used to embed an object created in another
application, such as Microsoft word document, Excel
spreadsheet, or PowerPoint presentation into the Access
table. It stores up to 2 GB of data.

12
Hyperlink It can store links to web pages, websites, files on an intranet
or LAN on your computer. It stores up to 1 GB of data.
Attachment This data type allows you to attach images, spreadsheet files,
documents, charts, and the other types of supported files to
the records in your database, much similar to the manner in
which you attach files to the emails.
Calculated It is used when a user creates table fields that calculate the
values. The calculations can include the values from fields in
the same table as well as built-in Access functions. This data
type is used mostly in case of queries, forms and tables.
Lookup Wizard A Lookup wizard helps you to create a field whose values are
chosen from the values in another table, query, or list of
values. By default, Access sets Lookup fields to the Number
data type.

5. Setting Data Type for a Field


You can set the data types for the table fields by working in either Datasheet View
or Design View.
a. Setting Data Type in Datasheet View
When you create a field by entering data in the Datasheet View, Access
automatically assigns a data type to the field based on the data that you have
entered in the table. To define a specific data type for a field:
• Click on the drop-down arrow of the Click to Add header and choose the
required data type from the displayed list.

13
• You can reset or change the data type of a field as and when required by
choosing Table Fields tab and selecting the required data type from the
Data Type drop-down menu in the Formatting group.

b. Setting Data Type in Design View


To change or define a specific data type for a field in Design View, follow these
steps:
• Click on the drop-down arrow in the Data Type column of the field and select
the desired data type from the displayed list.

6. Field Properties
A field property applies to a particular field in a table and defines the characteristics
of that field. Each field in a table has its own set of properties that further defines
the field and how it is used in the database. You can set the properties of a field in
the Design View as well as Datasheet View.

a. To set Field properties in Design View


To set the properties of a field in the Design View, follow the given steps:

14
• Click on the field name for which you want to set the field properties.
• You will observe that the General Tab is selected by default in the Field
Properties pane.
• Set the properties of all the fields as required.
• After finishing the task, you must save the table by clicking on the Save
button on the Quick Access Toolbar. (OR) Click on the File tab and select
the Save option.

Field Properties Description


Caption The caption property specifies a label for a field to
be displayed as the column heading whenever the
table is displayed in the Datasheet View. It can have
up to 2,046 characters
Default Value You can use the Default Value property to specify a
value that is automatically entered in a field when a
new record is created. The user can accept this
value or enter a new value.
Validation Rule With the help of this property, you can limit the
values that can be entered in the field. For example,
if a field’s validation rule is >0, then a negative value
cannot be entered into that field.
Validation Text This property lets you customize the error message
that appears when you enter a value that violates
the validation rule.
Required You can use this property to specify if a value is
required in a field. It accepts two values: Yes (to
ensure that the field is not left blank during data
entry), No (field can be left blank).

15
7. Primary Key
A Primary Key is a standard feature of every database management system. It is a
field in a table that holds a unique value for every record. It ensures that every
record in a table is unique. The field that is designated as the primary key of a table
can neither have duplicate data nor can it be left blank while entering the data.
Suppose, you have a StudentInformation table that contains records regarding
students of a class. Here, the StudentID field can be set as a primary key, since all
the IDs are unique for each student. You cannot consider the Name field for primary
key as there is always a possibility that more than one student in a class might have
the same name.
Setting a Primary Key
To set the primary key, follow the given steps:
• In Design View, click on the field that you want to set as the primary key. The
selected field will be highlighted. Click on the Primary Key option, present in
the Tools group on the Table Design tab. (OR) Right click on the field and select
the Primary Key option from the context menu.
• The field will be set as the primary key indicated by a small key in the field
selector column.
• Click on the close button on the table window.
• Access will prompt a message window reminding you to save the changes.
• Click on the Yes button to save the changes.

16
8. Editing tables in Access
After entering data in a table, sometimes it is required to make changes in the
database. This can be done in the following ways:
• To edit a record directly, scroll through the records or use the Record
Navigation buttons to find the record to be edited.
• Double click on the cell where you want to make changes.
• Type the information in the field.
• Click outside the record to apply the changes (OR) click on the Enter key.

9. Inserting/Deleting/Hide/Unhide Field in Datasheet View


To insert a new field in a table, follow the given steps:
• Open a table in Datasheet View. Right click on the field on the left of which you
want to insert a new field. The context menu appears.
• Select the Insert Field option.
• The new field will be inserted on the left of the selected field. (OR) on the Table
Fields tab, in the Add & Delete group, click on the More Fields option and
choose the data type for the field.
• The new field will be inserted on the right of the selected field.
• Likewise, you can delete a field, hide and unhide fields.

17
18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy