SlideShare una empresa de Scribd logo
1 de 132
Descargar para leer sin conexión
Database management
system
-Nishchit Bhandari
Data
• Data:
• Plural form of word ‘datum’ which means collection of
raw facts.
• Raw materials for information processing (series of
action that converts input to useful outputs)
• They are measured, collected and reported,
and analyzed, whereupon it can be visualized using
graphs, images or other analysis tools
Information
• Information:
• Derives from the Latin stem (information-) of the
nominative (informatio): this noun derives from the
verb informare (to inform) in the sense of "to give form to
the mind", "to discipline", "instruct", "teach".
• Resultant output after processing of data, most critical
source of organization.
• Data becomes information when you understand what it
means.
What is data processing?
• Data processing:
• Processing of data to make it
more usable and meaningful
(transforming data into
information.)
• Consists of three sub activities –
capturing the input data,
manipulating them and
producing output results.
2
1
3
Electronic database
• An organized collection of data stored on a computer
in such a way that its contents (data) can easily be
accessed, updated and queried upon with the help of
a software program
Advantages of electronic database
• Limitless capacity to store data
• Speed
• Accuracy
• Efficiency
Tables: the building blocks of database
• Set of information about a particular subject. Table is
the building blocks of every databases
• Has records in it
• Each record is made up of fields that contains
information about the thing the record represents
Emp No. Dept No. Address
E01 D01 New Road
E02 d02 Prithvi Chowk
Records
Fields
Example of an employee master table
Database Management System (DBMS)
• Data:
• Helps to maintain a centralized control over the data.
• It involves creating, modifying, deleting, and adding
data files.
• The software that allows to perform this functions is
known as Database Management System (DBMS)
software.
Database management system (DBMS)
• Some of the database management system softwares
are are: MS Excel, MS Access, Oracle database, SQL
server, etc.
How database management system works?
• Provides a centralized control over
data
• Maintains the centralized database
• Any application can used the data
from central location
• Maintains multiple copies of data
and updates them regularly
Data files
Data files
Data files
User
User
Application
prog-1
Application
prog-1
DBMS
Advantages of database management
system (DBMS)
• Provides an organized way of storing data
• Facilities quick and efficient retrieval of information
• Reduces data redundancy
• Improves the consistency of data
• Allows sharing of data
Relational database management system
• A relational database is a special type of database
where data is stored in a number of separate but linked
tables
• Software used to create relational databases are called
relational database management system or RDBMS
• In relational database, two tables are linked together
using common field or column.
Microsoft Access
• Microsoft Access is a relational database management
system which comes as an integral part of the MS Office
Suite of applications. It is a powerful GUI based RDBMS
Advantages of Microsoft Access
• It helps you to create customized databases for self use
or for use by small and medium sized business
• It provides numerous easy to use features
• Duplicate data is minimized
• Information is more accurate, reliable and consistent
• Information can be shared among several users.
• Information retrieval is faster and easier
How to open MS Access?
• Press home button + R ( +R) to start Run menu.
• Type MSACCESS
• Press enter
How to open MS Access?
• Go to start menu( ) and “All apps”
• Select MS Access
Working with your Access environment
Each tab is
divided into
groups
Click an
arrow for
more group
commands
Click a tab
to see more
commands
Contextual tabs
will appear when
certain items are
selected
The quick access toolbar
Save
Undo
Redo
Customize quick access
toolbar
File details
Close
Restore
down
Minimize
Help
Backstage View
Backstage View
Back
Back
Back
Back
Back
Back
Back
Navigation pane
Navigation
pane
Creating a desktop database
• After opening access, click on blank desktop
database
• Type name for your database
• Select a file location in which you want to
save your database
• Click create
Working with objects
Object Description
Tables Tables are primary building blocks of Access database. Tables are collection of
records with similar data.
Queries Queries allow you to select a specific data from one or more tables. You use a
query to clearly see and work with specific information.
Forms Forms are used to display records on screen to make them easier to enter new
records and to make changes to existing records.
Reports Reports are used to present processed data in an organized format specially
designed for printing.
Macros Macros automate common Access database task, such as opening and printing
tables, forms and reports.
Modules Modules are programs written in Visual Basic language.
Pages Data access pages (DAP) are webpages that allow you to view and work with
data that is stored in an access database on the internet.
Working with objects
To open an object:
• In the Navigation pane, locate and double-click the
desired object.
• The object will appear as a tab in the Document Tabs
bar.
Working with objects
To save a new object:
• Select the object you want to save by clicking its tab in
the Document Tabs bar.
• Click the Save command on Quick Access Toolbar, or
press Ctrl + S. Enter the desired object name, then
click OK.
• The object will be saved. Click the save command again
to save any changes to the object.
Working with objects
To close an object:
• Select the object you want to close, then click X on the
right of the Documents Tabs bar.
• If there are any unsaved changes to the object, you will
be prompted it to save it. Select Yes to save, No to
close it without saving your changes, and cancel to
leave the object open.
Understanding the table
• Tables are the core database objects. Their
purpose is to store information. The
purpose of every other database object is
to interact in some manner with one or
more tables. An Access database can
contain thousands of tables, and the
number of records in each table can contain
is limited more by the storage space.
Design view and layout view are the two
most commonly used ways to create a
table.
Using the table design view
• The Table Design View window allows you to create tables
on your own in order to have complete control over the field
names, data types and field properties. It consists of design
grid where you design each field to include in the table. You
can set primary keys, data-entry rules, validations and other
controls. The Table Design View Window is divided into two
panes:
• Field Grid pane
• Field Properties area
Using the table design view
• Field Grid pane
The Field Grid pane is used for entering field names, data
types and their descriptions.
• Field Name:
A field name is used to identify the data stored in the field.
A field name should be descriptive of the contents of the
data to be entered in the field. It can be up to 64 characters
long and can consist of letters, numbers, spaces, and special
characters, except a period, an exclamation point, an accent
grave(~) and brackets ([]). You cannot start a field name with
a space.
Using the table design view
• Field Grid pane
• Data Type:
The data type determines the kind of data that can be
entered into the field. Access uses the data type to ensure
that the right kind of data is entered in a field. It is
important to choose the right data type for a field before you
start entering data in the table. You can change a data type
after the field contains data, but if the data types are not
compatible such as a text entry in a field whose data type
accepts numbers only, you may lose data. The data types are
described in next slides
Using the table design view
Data Type What It Holds
Short Text Text up to 255 characters long (including spaces and punctuation). Use a
Text field, not a Number field, for codes even if they look like numbers,
such as phone numbers, ZIP codes, and other postal codes.
Long Text
(Memo)
Text up to 65,536 characters. A Long Text field can contain Rich
Text(formatted text) and you can set it to Append Only so that it can
accumulate text notes without allowing the user to delete what's already
there.
Number Only numbers, You may use + or - before the number, as well as a
decimal point. If you plan to do math with a field, use a Number or
Currency field. Occupies 8 bytes.
Currency Numbers with a currency sign in front of them ($ and so on)
Using the table design view
Data Type What It Holds
AutoNumber Numbers unique to each record and assigned by Access as you add
records, starting at 1 . Use an AutoNumber field as the primary key field
for most tables, Occupies 8 bytes
Date/Time Date and Time values for the years 1000 through 9999. Occupies 8
bytes.
Hyperlink Text or combinations of text and numbers stored as text and used as a
hyperlink address. Occupies up to 2048 characters
Yes/No Yes and No values and fields that contain only one of two values.
Occupies 1 bit (0 or 1 ) .
Using the table design view
Data Type What It Holds
Attachment May contain 0, 1 or many files. This provides a convenient and more
efficient way to store OLE Objects.
OLE object OLE object To store images and documents. By default, OLE created a
bitmap equivalent of the image or document. Occupies 1 GB
Using the table design view
• Field Description :
Field description helps you to remember the use and purpose
of a particular field. It is very useful in large projects where
several people may be working on the same database. This
field is, however, optional.
Using the table design view
• The Field Properties Area:
The field Properties are the attributes that describe and
define a field. Each type of field has a particular set of
properties. Setting field properties enhances the way your
table works. Some of the more commonly used properties
and their functions are described in next slides
Using the table design view
Field
Property
Storage size
Field Size Specifies the maximum number of characters allowed in a field
Format Specifies how data displays in a table and prints
Input Mask Defines a standard pattern for the appearance of all data entered in a
field
Caption Used when you want to display an alternate name for the field to explain
the field name
Validation
rule
Specifies an expression that checks for invalid data.
Validation
Text
Displays the message if the entered data fails the validity rule. Default is
none.
Using the table design view
Field
Property
Storage size
Required Specifies whether or not a value must be entered in a field.
Allow Zero
length
Specifies whether or not an entry containing no character is valid.
Indexed Create an index for the primary key, speeds up sorting and searching.
Unicode
Compressio
n
Indicate whether you want Access to save space if only plain text is
entered.
IME Mode Input Method Editor-setting applies only if you are using East Asian
languages
Using the table design view
Field
Property
Storage size
IME
Sentence
Mode
Setting apply to the Japanese language only
Smart Tags Adds additional functionality to the field that you would normally have to
open another program to do
Text Align Aligns the data in a field the left, center, right or distributed (spread
across the data cell)
Using the table design view
• Click the Create tab.
• Click Table Design.
• Type a name in the Field Name column for each field you want-for example, Customer
Name, etc.
• In the Data Type drop-down list, select a data type for each field-for example, Short
Text, (At the end of this exercise, a table describes the data types that are available.)
• Save.
• Provide a name for the table, and click OK.
• If you have not created a primary key, you will be prompted to add a key. Click Yes to
add a primary key.
• After saving your table, the new ID primary key is added to the table.
• The table now appears in the navigation pane,
Choosing field size properties
The Field Size property is used to set the maximum size for the Text or Number data that
can be entered in the field. The default field size for a field with data type of Text is 50
characters. You can change the size to an amount anywhere in the range of 0 to 255
characters. The field size for numeric data tells you the range and how many bytes it
will take for storage. The options are:
• Byte, which is used to store positive integers (whole numbers) between 1 and 255.
• Integer, which is used to store larger integers and negative integers, between -32,768
and +32,768.
• Long Integer, the default Number field size, which is used to store even larger integers
between roughly -2 billion and +2 billion.
• Single, which stores single-precision floating-point numbers between -3.4 x 1 038 to
+3.4 x 1 038 .
• Double, which stores double-precision floating-point numbers between - 1 .797 x 1 0308
to + I .797 x 1 0308.
Choosing field size properties
• Replication ID, which is used to store a globally unique identifier (GUID).
• Decimal, which makes the Precision and Scale properties available to control number
entries.
• AutoNumber fields are limited to Long Integer and Replication ID field sizes
Choosing field size properties
• In the Navigation Pane, right-click the table that you want to change field properties
for.
• Select design view in the shortcut menu.
• Click the field you want to change.
• In the Field Properties General pane, click in the Field Size Property box.
• For a text field, enter a value between 1 and 255 .
For a Number field, refer to the previous table and pick an option from the drop-down
list.
• Click the save button on the Quick Access Toolbar.
• Close table design view.
Setting format properties
• Access always sets each field with the default format for its data type. The format
properties define how the field is displayed in tables, forms and reports. To change the
format of a field different symbols are entered in the Format Text box.
Text and memo fields
• Text and Memo fields use the same format settings, some of which are characters
placeholders that apply to individual characters and other settings affecting the entire
entry. Text and Memo data type can use any of these four symbols:
• For example:
i. @@@-@@-@@@@ would display 123456789 as 123-45-6789.
ii. > would display STARTUP whether you enter characters to uppercase STARTUP
,
startup or Startup.
Symbol Effect
@ Indicates a character or a space is required.
& Indicates a character or a space is optional.
< Converts all characters to lowercase.
> Converts all characters to uppercase.
Number and currency field
You can format your Number and Currency data with one of the Access’s predefined
formats or create your own using the special formatting symbols. The available formats
for the field with number data types are listed in the following table:
Setting Effect
General Displays number as entered.
Number Default for number fields.
Currency Displays number with currency symbols and thousands separator.
Negative values appear in parenthesis. Default is 2 decimal places.
Euro Displays number with Euro currency symbols and thousands separator.
Negative values appear in parenthesis. Default is 2 decimal places.
Fixed Displays at least one digit. Default is two decimal places.
Number and currency field
Setting Effect
Standard Displays thousands separator. Default is two decimal places.
Percent Displays value multiplied by 100 with added percent sign(%).Default is
two decimal places.
Scientific Uses standard scientific notation with exponents.
Number and currency field
The custom Number and Currency formats also use special characters to indicate how
you want the values to appear. The table given below describes symbols and their
effects.
Symbol Effect
.(period) Indicates the decimal point that separates the part of a number.
,(comma) Used as thousands separator.
0 A digit placeholder that displays a digit if one is there or, if none are there,
displays zero.
# A digit placeholder that displays a digit if one is there or, if none are there,
closes up the adjoining digits.
$ Displays a dollar sign.
% value is multiplied by 100 and a percent sign(%) is added.
Date/ Time Fields
Date/time fields include seven predefined format settings. The table given below
describes the format access provides
Setting Description
General Date (Default) Combination of short date and long time settings.
Long Date Uses long date regional setting.
Medium Date 12-Apr-9
Short Date Uses short date regional setting.
Long Time 2:30:00 PM
Medium Time 2:30 PM
Short Time 15:30
Number and currency field
• The table given below describe the custom formatting available for data / time values.
Symbol Description
: (colon) Time separator as set in the Regional Settings Properties dialogue box.
/ Date separator
dd Day of the month in two digits(01 to 31).
dddd Full weekday name(Sunday through Saturday)
mm Month in two digit(01-12)
yy Last two digits of the year
yyyy Full year(0100-9999)
hh, mm, ss Hour, minute or second into two digits(01 to 23, 01 to 59)
am/pm 12-hour clock with two-character uppercase or lowercase design it
Yes/ No fields
• Access automatically displays a default check box control when you specify a Yes/No
data type. Any format settings you make are ignored with this choice. Access provides
three predefined formats for displaying Yes/No, On/Off or True/False.
Yes/ No fields
• In the navigation pane, right-click
the table that you want to change
field properties for.
• Select design view in the shortcut
menu. Click the field you want to
change.
• In the Field Properties General pane,
click in the format property box.
• Select an option from the drop down
list and save the changes.
Defining input mask
An input mask is a field property that determines what data can be entered in the field,
how the data looks, and the format in which it is stored. An input mask consists of three
parts, separated by semicolons. The first part defines the mask string using mask
definition characters and embedded fixed data. The optional second part indicates
whether you want the formatting characters stored in the field in the database. Set
this second part to 0 to store the characters or to 1 to store only the data entered. The
optional third part defines the single character that Access uses as a placeholder to
indicate positions where data can be entered. The default placeholder character is an
underscore(_)
The Following list explains the purpose of the most common input mask characters:
Defining input mask
Character Description
0 Required digit(0 through 9)
9 Optional digit or space
# Optional digit or space; blank position are converted to spaces; plus and minus signs
are allowed.
L Required letter or digit(A through Z)
? Optional letter(A through Z)
A Required letter or digit
a Optional letter or digit
& Required character (any kind) or a space
C Optional character (any kind) or a space
< All characters that follow are converted to lowercase
Defining input mask
Character Description
> All character that follow are converted to uppercase
! Characters typed into the mask fill at from left to right
 Character that follows is displayed as a literal character
Password Creates a password entry box
Defining input mask
• Click the Build button (...) at the right of the field’s Input Mask property. The first
Input Mask Wizard dialog box opens where you can select from a list of ten
predesigned input m asks appropriate for commonly used fields. The Try-It box shows
how the mask works when displayed in datasheet or form vie. Access may prompt you
to save the table design before opening the first dialogue box.
• After selecting the mask, click Next to move the second dialogue box. In this dialogue
box you can make any necessary changes to the mask such as changing the placeholder
that displays the fill-in blanks (the default is an underline character), and then click
Next.
• Choose to store to the literal characters with the data, if desired.
• Click finish to close the Wizard.
Defining input mask
Setting a default value
• The caption field property is used when you want to display an alternate name for the
field to explain the field name. A caption can contain up to 255 characters, in any
combination of letters, numbers, special characters and spaces. The new caption also
appears in queries and replaces the text in the field labels attached to controls in
report and form designs. The field name remain the same; only the level so the next
caption text. (If your rename the field later in Datasheet view, the caption property is
deleted. To prevent this, rename fields ony in Design view)
Setting a default value
The default value property is used to specify a value that is automatically entered in a
field when a new record is created. This property is commonly used in most of the
entries in the field will be same for the entire table. The default value is then displayed
automatically in the field. When users add a record to the table, they can either accept
this value or enter another value. This saves time while entering data.
Setting a field validation rule
The process of examining the data that has been entered against conditions that you
have provided is call validation. A validation rule is the condition that should be
satisfied by the data. A validity check is set by entering an expression to describe
acceptable values.
Validating numbers
Expression Description
<100 The value must be less than 100.
>0 The value must be greater than 0.
<>45 The value can be anything except 45.
<=50 The value must be less than or equal to 50.
Between 0 to
50
The value must be between 0 and 50.
Validating dates
Expression Description
< # 1/30/2009 # The date occurs before January 30, 2009
< # 1/30/2009 6:30 PM # The date occurs after/on January 30, 2009 after 6:30 PM
< = # 1/30/2009 # The date occurs before/on January 30, 2009
> = # 1/30/2009 # The date occurs after/on January 30, 2009
> DATE ( ) The date occurs after the current date.
< DATE ( ) The date occurs yesterday or before the current date.
> NOW ( ) The date occurs today after the current time or any day in
future.
< NOW ( ) The date occurs today before the current time or any day in
past.
Validating texts
When you add a validity check, you can also add validation text in the Validation Text
property box. A validation text is the error message that is displayed if the data is
invalid.
Expression Description
Like “R*” The * represents zero or more characters. It checks that the
value starts with R or r, followed by a series of zero or more
characters.
Like “*ed” It checks whether text ends with characters “ed”
Like “? ? ? ADB” The ? represents a number. It accepts a text that ends with ADB.
Like “# # # ADB” The # represents a number. It accepts a text that ends with ADB
and is preceded by three numbers.
Like “[AE]? ? ?” It accepts 4 characters, and the first character is either A or E.
Validating texts
• Display the table in Design view.
• Select the field name in the upper pane of the design window, and then click validation rule in
the field properties pane.
• Click the (…) button at the right end of the validation rule box to open the expression builder, or
type an expression and press ENTER.
• In the validation textbox, enter the message you want to display when the rule is broken.
Requiring an entry
The required property specifies whether a value is required in the field. If the property
is set to ask for a field, you must enter a value in that field, and the value cannot be
null(zero). If you set the Required property to Yes for a field in a table that already
contains data, Access keeps you the option of checking whether the field has a value in
all existing records. The field must have a value in all instances in which data might be
entered in a field-in the table itself as well as in forms, queries, reports, and any other
data sheets based on the table.
You can set a Required property for any type of field except a field that has the
AutoNumber data type assigned to it. A primary key field will not accept null values.
Allow zero length string
A zero-length string is a string that contains no characters. The Allow zero length
property, when set to yes, permits zero-length strings. This property is available
only to Text, Memo and Hyperlink fields.
The indexed property field is used to set a field as an index. The Yes (No Duplicates)
setting for the indexed property indicates that the information in the field will be
indexed for faster searching, and that duplicate values are not allowed. For the
primary key field, this property is automatically set to Yes (No Duplicates)
Preventing duplicates
Defining a primary key field
• A primary key Is a field that uniquely identifies each record.
• Most tables have at least one field that is selected as the primary key.
• The data in the primary key field must be unique for each record.
• A student’s records, for example, would use Student_ID as a key field
because it uniquely identifies each student.
• A primary key prevents duplicate records from being entered in the
table and is used to control the order in which records display in the
table. This makes it faster for databases to locate record in the table
and to process other operations.
• The primary key is also used to create a link between table in a
database.
Defining a primary key field
• Right click the table in the Navigation Pane.
• Select design view.
• Select one or more fields. (Use the Ctrl key, and click the field selector to pick
Multiple fields).
• Click primary key.
• Click save.
Creating a table in layout view
The layout view in Access can be used for tables, forms and reports, and
it enables you to make design changes without using the more complex
design view. You can make changes and, at the same time see how the
design will finally look.
In layout view, you have less control over detailed choices, but you have
a faster and more intuitive interface through which to interact with the
table.
In layout view, Access automatically adds a unique AutoNumber primary
key, called 10, to your blank table design.
After working in the layout view, you can always switch to the design
view to refine your choices.
Creating a table in layout view
• A Click the Create tab.
• Click Table.
• Click the Click to Add Dropdown list.
• Select the data type.
• Replace the default caption “Field 1” with a name for the field.
• Click save.
• Provide a name for the table and click OK.
Relationship between tables
A relationship plays a very important role in the database design.
It is formed by linking matching fields of two tables.
The relationships effectively join tables to form one large table.
This avoids having to repeatedly enter the same data, therefore, saving
time and reducing data entry errors.
Table related at the table level are ready for use in queries, forms,
reports and data access page.
There are three possible relationships between related entities or table.
They are: one-to-one, one-to-many and many-to-many.
One-to-One [1:1]
In a one-to-one relationship, each record in table A can have only one matching record in
table B, and each record in table B can have only one matching record in table A. This
type of relationship is not common, because most information related in this way would
be in one table. For example, there can only be one department head in the college for
one department. The faculty head cannot head more than one department.
One-to-many relationship is the most common type of relationship. In a one-to-many
relationship, a record in table A can have many matching records in table B, but a
record in table B has only one matching record in table A.
For example, a student can major in only one discipline, but many students can register
for a discipline
One-to-Many [1:m]
Many-to-Many [m:m]
• In a many-to-many relationship, a record in table A can have many matching records
in Table B, and a record in Table B can have many matching records in Table A. This
type of relationship is only possible by defining a third table (called a junction table)
whose primary key consists of two fields-the foreign keys from both tables A and B.
For Example, a customer can purchase more than one product and a product can be
purchased by more than one customer.
Creating Relationships by using the Lookup
Wizard
The Lookup Wizard is one of the most powerful features in Access, assisting you to
relate data in one table that needs to lookup data from another table. The Lookup
Wizard will also create a relationship between your main table and the lookup table and
provides option to “Enforce Referential Integrity” which means preventing users from
typing values that are not in the lookup table or from deleting values in the lookup
table that have been used in the main table.
Creating Relationships by using the Lookup
Wizard
• A In the table design view, move to a blank line in the data type column and select the Lookup Wizard
in the drop-down list.
• Select the option to look up values from another table or query.
• Select the table from which you will look up a value, Click Next.
• Select both the field value to save in the new field(ID) and the field value to display in the
list(Customer Name). Click Next, on the following screen select any fields for sorting and click Next.
• Choose whether to show or hide the key column.(Normally, if you have two columns selected, you
would hide the primary key column). Click Next.
• Type a name for the lookup field.
• Select the Enable Data integrity check box to make sure that the list of Customer and Contacts that
refer to the customer is always consistent.
• Choose the Restrict Delete option to prevent customers from being deleted when they are referenced
by a contact.
• Click Finish.
• Click Yes to save your changes.
Creating Relationships by using the Lookup
Wizard
Viewing relationships
Relationships sit at the very heart of what distinguishes a database from a worksheet; a
relationship is a rule that cannot be subverted when you are entering or changing data
and guarantees the consistency of a data (within the bounds of the rules). The
relationship diagram can be very misleading tool to work with in any database because
it serves two purposes.
First, it is a roadmap you can delete tables and queries from the diagram without
changing anything. It is a passive picture that helps you to see how the tables are
related with each other.
The second role of a diagram is exactly the opposite of first use. When it comes to the
actual relationships between tables (the lines joining them), the diagram is an active
tool that allows you to create and delete rules (relationships) from tables.
Viewing relationships
• Click the Database Tools tab.
• Click Relationships.
• Double-click a relationship line to display and/or change the relationship
Deleting relationships
• When we delete a relationship, we remove something from the database, but if you
delete a table from the diagram, you are changing only the relationship picture. The
table is not deleted from the database, and it can be easily be added back to the
diagram. When you save the relationship diagram, you are saving only a picture. It is
when you delete or create a relationships that the database gets changed.
• Click the relationship line, which will become a thicker to indicate that it has been
selected
• Press the Delete key, and click Yes to delete the relationship.
Understanding Referential Integrity
Referential integrity is a set of rules used by Access to ensure that the relationships
between tables are valid and that the related data is not accidentally changed or
deleted. The rules include the following:
• A record in a primary table cannot be deleted if matching records exist in a related
table.
• A primary key value cannot be changed in the primary table is the record has related
records.
Once Referential Integrity has been set, Access displays a warning message if one of the
rules is broken and does not allow you to complete the action you are trying to do.
Understanding Referential Integrity
• A Double-click on the relationship line between two tables. The Edit Relationships
dialog box will open.
• Click on the Enforce Referential Integrity check box.
• Mark either or both additional check boxes as desired.
• Click on Cascade Update Related Fields to automatically change entries on the
“many” side if an entry changes on the “one” side.
• Click on Cascade Delete Related Fields to automatically delete entire records from
the table on the “many” side if the related entry in the table on the “one” side is
deleted. Then click on OK .
Sorting data
A Sorting data often helps you find specific information quickly. In Access, you can sort
data in ascending order (A to Z or 0 to 9 ) or descending order (Z to A or 9 to 0 ). You can
sort all records in a table by a single field or you can select adjacent columns or sort by
more than one field. When you select multiple columns to sort, Access sorts records
starting with the column farthest left, then moves to the right across the columns.
Access saves the new sort order with your table data and reapplies it automatically each
time you open the table to return to the primary key sort order, you must remove the
temporary sort.
Sorting data
• Select a field in the cell you wish to sort by.
• Click the Home tab on the Ribbon and locate the Sort and Filter group.
• Sort the field by selecting the Ascending or Descending command.
• The table will now be sorted by the selected field.
• To save the new sort click the save command on the Quick Access Toolbar.
Indexing
Indexing refers to creation of a separate file called index-file that stores the order of
records on the basis of a field’s value. This index-file is internally used by database
management system for various purposes. Indexing can be achieved by setting the
Indexed property of field to Yes.
Indexing
• In the table design view, locate the field name you want to index.
• In the Field Properties Section, select an index allowing duplicates.
• You can display and manage all indexes in a table by using Indexes popup window.
Filtering records
Filtering is a restriction you place on records in the open datasheet or form to quickly
isolate and display a subset of records. A filter is created by specifying a set of limiting
conditions or criteria, you want records to meet in order to be displayed. A filter is
ideal when you want to display the subset for only one for only a brief time, then return
immediately to the full set of records. Filter is also temporary and all records are
redisplayed when you remove the filter or close and reopen the table or form. The
filter cannot be saved. However, the last filter criteria you specify are saved with the
table, and results can be quickly redisplayed.
Filtering records
• Click the drop-down arrow next to the field you want to filter by,
• A drop-down menu with a checklist will appear. Only checked items will be included in
your filtered results. Use the following options to determine which items will be
included in your filter:
Select and deselect items one at a time by clicking their checkboxes.
Click Select All to include every item in the filter. If all items are already selected, this
option will deselect all items.
Click blanks to set the filter to find only the records with no data in the selected field.
Click ok the filter will be applied
Filtering records
Extracting information with queries
A query is a request for data results, for an action on data, or for both. Using a query
makes it easier to view, add, delete, or change data in your Access database. Some other
reasons for using queries:
• Find specific quickly data by filtering on specific criteria(conditions)
• Calculate or summarize data
• Automate data management tasks, such as a reviewing the most current data on a
recurring basis.
Extracting information with queries
Query Type Description
Select Query Used to select and display data from either one table or a series of them depending on what is
needed.
Crosstab Query Summarizes large amounts of data in an easy-to-read, row-and-column format.
Parameter
Query
Displays a dialog box prompting you for information, such as criteria for locating data.
Action Query Add, change, or delete data. Each task has a specific type of action query. Four kinds of action
queries are:
Append Query- takes the results of a query and “appends” (or adds) theme to an existing table.
Delete Query- deletes all records in an underlying table from the set results of the query.
Make Table Query- as the name suggests, it creates a table based on the set results of a query.
Update Query- allows for one or more field in your table to be updated.
SQL Query Created using SQL (Structured Query Language), an advanced programming language used in Access.
Using the simple query wizard
A good way to start learning about queries is to create one with the Simple Query
Wizard. It creates a select query, a basic kind of query that displays certain fields from
a table in a datasheet like view. For example, you can use address table to extract
names and telephone numbers of the employee using query.
• On the Create tab, in the Queries group, click Query Wizard.
• In the New Query dialog box, click Simple Query Wizard, and then click OK.
• Under Tables/Queries, click the table that has the data that you want to use. Note
that a query can also use another query as a recordsource.
• Under Available Fields, double-click the required fields, and click Next.
• Name the query, and then click Finish.
• Access displays all of the contact records in Datasheet view. The results show all of the
records, but show only the four fields that you specified in the query wizard.
Using the simple query wizard
Using query in design view
The Query Design view is used to create and modify the structure of the query. The
Query Design window is divided into two areas. The upper portion of the Query Design
View displays the field list for each table used by the query. The lower portion of Query
Design view displays the query grid where you add or change the fields displayed by the
query, add criteria to determine which records will be selected, define sort orders and
build calculated fields.
Using query in design view
• Select the Create tab on the Ribbon, and locate the Queries group.
• Click the Query Design command.
• Access will switch to Query Design view. In the Show Table dialogue box that appears,
select the table you want to run a query on.
• Click Add, then click Close.
• The selected table will appear as a small window in the Object Relationship pane. In
the table window, double-click the field names you want to include in your query. They
will be added to the design grid in the bottom part of the screen.
• Set the search criteria by clicking the cell in the Criteria: row of each field you want to
filter. Typing criteria into more than one field in the Criteria: row will set your query
to include only results that meet all criteria. If you want to set multiple criteria but
don't need the records shown in your results to meet all of them, type the first
criteria in the Criteria:row and additional criteria in the or:row and the rows beneath
it.
Using query in design view
• After you have set your criteria, run the query by clicking the Run command on the
Design tab.
• The query results will be displayed in the query’s Datasheet view. If you want, Save
your by clicking the Save command in the Quick Access toolbar. When prompted to
name it, type the desired name, then click OK
Using query in design view
Adding selection criteria in queries
• The selection criteria in queries are expressions defining a condition that must be met
for the record to be included in the subset. An expression is a combination of symbols,
values, identifiers and operators used for many purposes. Symbols used in expressions
include quotation marks, colons, asterisks, and other special characters. Values can be
expressed as literal values, constants, the result of a function, or an identifier.
Identifiers refer to the value of a field, a control in a form or report, or a property. An
operator is a symbol or word that indicates an operation to be performed on one or
more elements in the expression.
Using wildcard Patterns
Wildcards offer a way of setting criteria based on patterns or partial words rather than
exact matches. The most common wildcard operation include:
To specify a wildcard pattern, enter the pattern in the Criteria row of the field column
in which you want to search
Wildcard Description
? Replaces a single character
* Replaces a number of characters
# Replaces a single desert
Using operators
• Operators are the key to more flexible expressions. Access has several classes of
operators: arithmetic, comparison, concatenation and logical. The table in the next
column lists operators you can use in query criteria expressions.
Arithmetic operators
An arithmetic operator is a mathematical function that takes two operands and
performs a calculation on them. They are used in common arithmetic and most
computer languages contain a set of such operators that can be used within equations
to perform number of types of the sequential calculations.
Operator Description Example
+ Addition =Total +3
- Subtraction =Total -3
* Multiplication =Total *3
/ Division =Total/3
 Integer division =Total3
Mod Modular Division =Total mod 3
Comparison operator
• Comparison operators, as their name implies, allow you to compare two values.
Operator Description Example
= Equals =Books or =“Books”
> Greater than >7/15/06 or
<#7/15/06#
< Less than <1000
>= Greater than or equal
to
>=20
<= Less than or equal to <=20
<> Not equal to <>“KTM”
Comparison operator
• Comparison operators, as their name implies, allow you to compare two values.
Operator Description Example
BETWEEN... Between two BETWEEN 100
AND values, inclusive AND 600
IN Included in a set of
values
I (“Pokhara”,
“K ”)
IS NULL Field is empty Is Null
IS NOT NULL Field is not empty Is Not Null
“ ” Zero-length string =“ ”
LIKE Matches a pattern Like C* or
k “ *”
Logical Operators
Logical operators to combine two Boolean values and return a true, false, or null result.
Logical operators are also referred to as Boolean operators.
Operator Description Example
AND both conditions are true >=10 AND <=100
OR either condition is true “Books” OR “Pencil”
NOT not true NOT like “A*”
Sorting query field
• By default, query fields are not sorted. You can however sort any fields in either
ascending or descending order.
• Click on the Sort row in the field column you want to sort. A down arrow will appear to
the right of the field.
• Click on the down arrow. A menu will appear.
• Click on ascending to sort in ascending order.
or
Click on Descending to sort in descending order.
The sort order will be set based on the instructions
in step third
Performing calculations
• A calculated field displays the results of a calculation in a query. You can perform a
variety of calculation in queries. You can create your own calculation or use one of
Access’s seven predefined calculations called functions:
Function Calculations
SUM Total of the values in a field.
AVG Average of the values in a field.
COUNT Counts number of values, excluding empty cells, in a field for all records
MIN Lowest value in a field.
MAX Highest value in a field.
STDEV A measure of the dispersion of a frequency distribution.
VAR Square of the standard deviation.
Append query
• Append query is a type of query that enables you to select data from existing tables
and add data into another table. Any rules or validation defined in the table into which
the data is added are enforced when you try to append the data. You are allowed to
select data from several tables, but you can append only to a single table. After you
have selected the target table, you can see the name of the table by viewing the SQL.
After you have selected the target table, fields where names match are automatically
paired together; if the names are different; you can select the corresponding fields.
Append query
• Append query is a type of query that enables you to select data from existing tables
and add data into another table. Any rules or validation defined in the table into which
the data is added are enforced when you try to append the data. You are allowed to
select data from several tables, but you can append only to a single table. After you
have selected the target table, you can see the name of the table by viewing the SQL.
After you have selected the target table, fields where names match are automatically
paired together; if the names are different; you can select the corresponding fields.
Append query
• Start with a select query including your table, select the fields to be used in the new
table, and then click Append.
• Select the table into which to append the data.
• Click OK.
• Use the drop-down list of available fields to match up any fields where the names are
different. Where the names are the same, the Field and Append To rows will be
matched.
• Click Run.
• Click Yes to add data to your table.
Append query
• Start with a select query including your table, select the fields to be used in the new
table, and then click Append.
• Select the table into which to append the data.
• Click OK.
• Use the drop-down list of available fields to match up any fields where the names are
different. Where the names are the same, the Field and Append To rows will be
matched.
• Click Run.
• Click Yes to add data to your table.
Delete query
Delete query is a type of query that allows you to delete data from a table either by
specifying filtering criteria or by using data in other tables or queries to limit the data
that is being deleted. As with all action queries, you cannot undo the operation, so
making a backup of a database before you execute a Delete query is important.
• Start with a select query including your table, and click Delete.
• Select a field to filter the data.
• Type the filter criteria.
• Click Run.
• Click Yes.
Make table query
Make Table query is a type of query that creates a new table based upon the selections that you
choose on the query grid. This type of query is useful when you are improving the design of
database by creating new lists of data or by splitting the data in one table into a state of tables.
• Click the Create tab.
• Click Query Design.
• Add your tables and fields to the query grid.
• Click Make Table.
• Type a name for your new table.
• Click OK. Before clicking the Run button, you can click View to review the data that will be
created in the new table and then return to design view to execute the query by clicking the
Run button.
• Click Run to execute the action query.
• Click Yes to create your new table.
Crosstab query with the query wizard
Crosstab queries can be constructed manually. However, it is simpler to use the Query
Wizard to create the query, which you can later change in design view.
• Click the Create tab.
• Click Query Wizard.
• In the New Query popup window, click Crosstab Query Wizard
• Click OK
• In the Crosstab Query Wizard, click Queries.
• Select a query and click Next.
• Select one or more columns to act as row headings, and click Next.
• Select one column to act as the new column headings, and click Next.
• Select the column to summarize.
• Select the calculation type to use, and Click Next.
Crosstab query with the query wizard
• Type a name for your query, and click finish.
• Select design View.
• In the query Column Headings property field, type a fixed set of headings
Understanding forms
A form is a database object used primarily to display records onscreen, to make it easier
to enter new records and to make changes to the existing records. Form allows you to
design the layout of fields on the screen in any arrangement. Forms are based on an
underlying table, and include design control elements office descriptive text, title,
labels, lines, boxes and pictures. Depending on your needs, you can create forms in
three ways:
• The Form Wizard asks some questions and then creates an attractive form based on
your answer.
• The Form Design and Blank Form buttons let you start with a blank form and build from
the ground up.
• The Form tools make attractive forms with a click of the mouse.
Using the Form tool if
• You want all fields in the selected table or query to appear on the form
• You don’t want to control over the type of style that is applied to the form
• In the navigation pane, select the table you want to use to create a form. You do not
need to open the table
• Select the create tab, locate the forms group and click the form command
• Your form will be created and opened in layout view
Using the Form tool
Using the Form wizard if
• You want to select specific fields for your form.
• You want to select fields from more than one table or query.
• You want to choose from a list of layouts for your form.
Using the Form wizard if
• Open your database file.
• Click the Create tab on Ribbon. Several bottom groups appear on the Ribbon, including
the Forms Group.
• Click the Form Wizard button. The form Wizard appears.
• Using the Table/Queries drop-down menu, select the source of the form’s fields.
i. Click the down arrow to list the database’s tables and queries
ii. Select the table or query that contains the fields you want to view with this form
• Select the fields you want
To select the individual fields, double click each field you want in the available fields
list. If you want to add all the fields, click the >>> button.
• After you have selected all the fields you want to include on your form, click Next.
Using the Form wizard if
• Choose one of the layouts and then click Next.
• Enter a descriptive title in the What Title Do You Want For Your Form? Box at the top of
Form Wizard screen.
• Click Finish to open form in Form view. Your new form appears on screen.
Understanding reports
• Report is an Access database object that presents information in the printed format. It
is a summary of the data contained in one or more tables or queries. It will often
provide answers about the information in your database such as yearly sales for a
specific product or the payroll data for a particular week or month. When you create
an Access report you can include calculations that are not included in other database
objects. You can also include headers and footers to print identifying information at
the top and the bottom of every page. You can group and sort data to organize
information efficiently and apply formatting effects to make your report both
attractive and easier to read and understand.
Use report button
The report button creates a simple report that lists the record in the selected table or
query in a columnar format.
• Open the table or query you want to use in your report.
• Select a Create tab on the Ribbon. Locate the Reports group, then click the Report
command.
• Access will create a new report based on your object.
• Click the Save button on the Quick Access toolbar. Access saves the report unless you
are saving for the first time. If you are saving for the first time, the Save As dialogue
box appears.
• Type the name you want to give to your report.
• Click OK. Access saves the report. You can now access the report by using the
Navigation pane.
Use report button
Use report wizard
The report Wizard provides you with more flexibility than you get by using the Report
button. You can choose the tables and fields, group the data, sort the data, summarize
the data, choose a layout and orientation, apply a style and title your report.
• On the create tab in the reports group, click report wizard. The wizard starts.
• From the tables/queries drop down list, select the table(or query) to base the report
on. The fields for the selected table load in the available field list box.
• Move the fields to include on the report from the available fields to selected fields
• Click next
• To group records on the report by a particular field, highlight the field in the list box and click
>.
• To group records on the report by a particular field, highlight the field in the box and click >.
• Add more grouping levels if desired
Use report wizard
• When you finish defining how you want records grouped, click next>.
• In the first drop-down list, select the field to sort records by
• When you finish specifying sorting options, click next
• In the layout field, select the format of the report
• In the orientation field, select the orientation
• If you want all the fields to fit ton a single page, ensure the adjust the field width so all fields
fit on a page check box is marked
• Click next
• Enter title of the report
• Select an option for the view you want to open the report in
• Click finish
Use report wizard
Thank you!

Más contenido relacionado

La actualidad más candente

Basic introduction to ms access
Basic introduction to ms accessBasic introduction to ms access
Basic introduction to ms accessjigeno
 
INTRODUCTION TO MS EXCEL 2010
INTRODUCTION TO MS EXCEL 2010INTRODUCTION TO MS EXCEL 2010
INTRODUCTION TO MS EXCEL 2010laraibali21
 
How to Use Zoom for Virtual Meetings and Webinars
How to Use Zoom for Virtual Meetings and Webinars How to Use Zoom for Virtual Meetings and Webinars
How to Use Zoom for Virtual Meetings and Webinars Learning in Bloom
 
Ms Access ppt
Ms Access pptMs Access ppt
Ms Access pptanuj
 
Windows 7 interface
Windows 7 interfaceWindows 7 interface
Windows 7 interfaceSirajRock
 
How to install windows 10
How to install windows 10How to install windows 10
How to install windows 10Annu Ahmed
 
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
 
File based approach
File based approachFile based approach
File based approachPreethaAS
 
L3 ms access 2010 interface
L3 ms access 2010 interfaceL3 ms access 2010 interface
L3 ms access 2010 interfaceBryan Corpuz
 
Database administrator
Database administratorDatabase administrator
Database administratorTech_MX
 
PowerPoint basics
PowerPoint basicsPowerPoint basics
PowerPoint basicshope baido
 
History of websites
History of websitesHistory of websites
History of websitesleahwilshh2
 
Access lesson 03 Creating Queries
Access lesson 03 Creating QueriesAccess lesson 03 Creating Queries
Access lesson 03 Creating QueriesAram SE
 

La actualidad más candente (20)

10 WIndows Basics
10 WIndows Basics 10 WIndows Basics
10 WIndows Basics
 
Windows 10 user guide
Windows 10 user guideWindows 10 user guide
Windows 10 user guide
 
Basic introduction to ms access
Basic introduction to ms accessBasic introduction to ms access
Basic introduction to ms access
 
INTRODUCTION TO MS EXCEL 2010
INTRODUCTION TO MS EXCEL 2010INTRODUCTION TO MS EXCEL 2010
INTRODUCTION TO MS EXCEL 2010
 
Search engine
Search engineSearch engine
Search engine
 
How to Use Zoom for Virtual Meetings and Webinars
How to Use Zoom for Virtual Meetings and Webinars How to Use Zoom for Virtual Meetings and Webinars
How to Use Zoom for Virtual Meetings and Webinars
 
Ms Access ppt
Ms Access pptMs Access ppt
Ms Access ppt
 
Google Search Tips
Google Search TipsGoogle Search Tips
Google Search Tips
 
MySQL ppt
MySQL ppt MySQL ppt
MySQL ppt
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
 
Ms excel
Ms excelMs excel
Ms excel
 
Windows 7 interface
Windows 7 interfaceWindows 7 interface
Windows 7 interface
 
How to install windows 10
How to install windows 10How to install windows 10
How to install windows 10
 
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
 
File based approach
File based approachFile based approach
File based approach
 
L3 ms access 2010 interface
L3 ms access 2010 interfaceL3 ms access 2010 interface
L3 ms access 2010 interface
 
Database administrator
Database administratorDatabase administrator
Database administrator
 
PowerPoint basics
PowerPoint basicsPowerPoint basics
PowerPoint basics
 
History of websites
History of websitesHistory of websites
History of websites
 
Access lesson 03 Creating Queries
Access lesson 03 Creating QueriesAccess lesson 03 Creating Queries
Access lesson 03 Creating Queries
 

Similar a Ms access

Similar a Ms access (20)

Introduction to ms access database
Introduction to ms access databaseIntroduction to ms access database
Introduction to ms access database
 
MS Access Intro
MS Access IntroMS Access Intro
MS Access Intro
 
access1.ppt
access1.pptaccess1.ppt
access1.ppt
 
MS-ACCESS.pptx
MS-ACCESS.pptxMS-ACCESS.pptx
MS-ACCESS.pptx
 
Database management system
Database management systemDatabase management system
Database management system
 
01 Microsoft Access
01 Microsoft Access01 Microsoft Access
01 Microsoft Access
 
Access
AccessAccess
Access
 
OPERATE DATABASE APPLICATION
OPERATE DATABASE APPLICATIONOPERATE DATABASE APPLICATION
OPERATE DATABASE APPLICATION
 
Chapter 9 Microsoft Access Database.pptx
Chapter 9 Microsoft Access Database.pptxChapter 9 Microsoft Access Database.pptx
Chapter 9 Microsoft Access Database.pptx
 
MS Access.pptx
MS Access.pptxMS Access.pptx
MS Access.pptx
 
Access2003
Access2003Access2003
Access2003
 
Access2003
Access2003Access2003
Access2003
 
Ms access
Ms accessMs access
Ms access
 
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
 
Operate Spreadsheet applications ppt.pptx
Operate Spreadsheet applications ppt.pptxOperate Spreadsheet applications ppt.pptx
Operate Spreadsheet applications ppt.pptx
 
6.2 software
6.2 software6.2 software
6.2 software
 
Ms access 2007 pptx
Ms access 2007 pptxMs access 2007 pptx
Ms access 2007 pptx
 
Introduction to database with ms access.hetvii
Introduction to database with ms access.hetviiIntroduction to database with ms access.hetvii
Introduction to database with ms access.hetvii
 
Introduction to database with ms access(DBMS)
Introduction to database with ms access(DBMS)Introduction to database with ms access(DBMS)
Introduction to database with ms access(DBMS)
 
Database
DatabaseDatabase
Database
 

Más de RoshanMaharjan13 (13)

E-Commerce.pptx
E-Commerce.pptxE-Commerce.pptx
E-Commerce.pptx
 
Computer security
Computer securityComputer security
Computer security
 
File handling
File handlingFile handling
File handling
 
Ethical and Social Issues in ICT
Ethical and Social Issues in ICTEthical and Social Issues in ICT
Ethical and Social Issues in ICT
 
Basic of qbasic
Basic of qbasicBasic of qbasic
Basic of qbasic
 
Computer Software
Computer SoftwareComputer Software
Computer Software
 
Number system
Number systemNumber system
Number system
 
Computer hardware
Computer hardwareComputer hardware
Computer hardware
 
Networking and telecommunication
Networking and telecommunication Networking and telecommunication
Networking and telecommunication
 
Categories of computer
Categories of computerCategories of computer
Categories of computer
 
Microsoft word
Microsoft wordMicrosoft word
Microsoft word
 
Modular programming
Modular programmingModular programming
Modular programming
 
Introduction to computer
Introduction to computerIntroduction to computer
Introduction to computer
 

Último

ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 

Último (20)

ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

Ms access

  • 2. Data • Data: • Plural form of word ‘datum’ which means collection of raw facts. • Raw materials for information processing (series of action that converts input to useful outputs) • They are measured, collected and reported, and analyzed, whereupon it can be visualized using graphs, images or other analysis tools
  • 3. Information • Information: • Derives from the Latin stem (information-) of the nominative (informatio): this noun derives from the verb informare (to inform) in the sense of "to give form to the mind", "to discipline", "instruct", "teach". • Resultant output after processing of data, most critical source of organization. • Data becomes information when you understand what it means.
  • 4. What is data processing? • Data processing: • Processing of data to make it more usable and meaningful (transforming data into information.) • Consists of three sub activities – capturing the input data, manipulating them and producing output results. 2 1 3
  • 5. Electronic database • An organized collection of data stored on a computer in such a way that its contents (data) can easily be accessed, updated and queried upon with the help of a software program
  • 6. Advantages of electronic database • Limitless capacity to store data • Speed • Accuracy • Efficiency
  • 7. Tables: the building blocks of database • Set of information about a particular subject. Table is the building blocks of every databases • Has records in it • Each record is made up of fields that contains information about the thing the record represents Emp No. Dept No. Address E01 D01 New Road E02 d02 Prithvi Chowk Records Fields Example of an employee master table
  • 8. Database Management System (DBMS) • Data: • Helps to maintain a centralized control over the data. • It involves creating, modifying, deleting, and adding data files. • The software that allows to perform this functions is known as Database Management System (DBMS) software.
  • 9. Database management system (DBMS) • Some of the database management system softwares are are: MS Excel, MS Access, Oracle database, SQL server, etc.
  • 10. How database management system works? • Provides a centralized control over data • Maintains the centralized database • Any application can used the data from central location • Maintains multiple copies of data and updates them regularly Data files Data files Data files User User Application prog-1 Application prog-1 DBMS
  • 11. Advantages of database management system (DBMS) • Provides an organized way of storing data • Facilities quick and efficient retrieval of information • Reduces data redundancy • Improves the consistency of data • Allows sharing of data
  • 12. Relational database management system • A relational database is a special type of database where data is stored in a number of separate but linked tables • Software used to create relational databases are called relational database management system or RDBMS • In relational database, two tables are linked together using common field or column.
  • 13. Microsoft Access • Microsoft Access is a relational database management system which comes as an integral part of the MS Office Suite of applications. It is a powerful GUI based RDBMS
  • 14. Advantages of Microsoft Access • It helps you to create customized databases for self use or for use by small and medium sized business • It provides numerous easy to use features • Duplicate data is minimized • Information is more accurate, reliable and consistent • Information can be shared among several users. • Information retrieval is faster and easier
  • 15. How to open MS Access? • Press home button + R ( +R) to start Run menu. • Type MSACCESS • Press enter
  • 16. How to open MS Access? • Go to start menu( ) and “All apps” • Select MS Access
  • 17. Working with your Access environment Each tab is divided into groups Click an arrow for more group commands Click a tab to see more commands Contextual tabs will appear when certain items are selected
  • 18. The quick access toolbar Save Undo Redo Customize quick access toolbar File details Close Restore down Minimize Help
  • 21. Back
  • 22. Back
  • 23. Back
  • 24. Back
  • 25. Back
  • 26. Back
  • 27. Back
  • 29. Creating a desktop database • After opening access, click on blank desktop database • Type name for your database • Select a file location in which you want to save your database • Click create
  • 30. Working with objects Object Description Tables Tables are primary building blocks of Access database. Tables are collection of records with similar data. Queries Queries allow you to select a specific data from one or more tables. You use a query to clearly see and work with specific information. Forms Forms are used to display records on screen to make them easier to enter new records and to make changes to existing records. Reports Reports are used to present processed data in an organized format specially designed for printing. Macros Macros automate common Access database task, such as opening and printing tables, forms and reports. Modules Modules are programs written in Visual Basic language. Pages Data access pages (DAP) are webpages that allow you to view and work with data that is stored in an access database on the internet.
  • 31. Working with objects To open an object: • In the Navigation pane, locate and double-click the desired object. • The object will appear as a tab in the Document Tabs bar.
  • 32. Working with objects To save a new object: • Select the object you want to save by clicking its tab in the Document Tabs bar. • Click the Save command on Quick Access Toolbar, or press Ctrl + S. Enter the desired object name, then click OK. • The object will be saved. Click the save command again to save any changes to the object.
  • 33. Working with objects To close an object: • Select the object you want to close, then click X on the right of the Documents Tabs bar. • If there are any unsaved changes to the object, you will be prompted it to save it. Select Yes to save, No to close it without saving your changes, and cancel to leave the object open.
  • 34. Understanding the table • Tables are the core database objects. Their purpose is to store information. The purpose of every other database object is to interact in some manner with one or more tables. An Access database can contain thousands of tables, and the number of records in each table can contain is limited more by the storage space. Design view and layout view are the two most commonly used ways to create a table.
  • 35. Using the table design view • The Table Design View window allows you to create tables on your own in order to have complete control over the field names, data types and field properties. It consists of design grid where you design each field to include in the table. You can set primary keys, data-entry rules, validations and other controls. The Table Design View Window is divided into two panes: • Field Grid pane • Field Properties area
  • 36. Using the table design view • Field Grid pane The Field Grid pane is used for entering field names, data types and their descriptions. • Field Name: A field name is used to identify the data stored in the field. A field name should be descriptive of the contents of the data to be entered in the field. It can be up to 64 characters long and can consist of letters, numbers, spaces, and special characters, except a period, an exclamation point, an accent grave(~) and brackets ([]). You cannot start a field name with a space.
  • 37. Using the table design view • Field Grid pane • Data Type: The data type determines the kind of data that can be entered into the field. Access uses the data type to ensure that the right kind of data is entered in a field. It is important to choose the right data type for a field before you start entering data in the table. You can change a data type after the field contains data, but if the data types are not compatible such as a text entry in a field whose data type accepts numbers only, you may lose data. The data types are described in next slides
  • 38. Using the table design view Data Type What It Holds Short Text Text up to 255 characters long (including spaces and punctuation). Use a Text field, not a Number field, for codes even if they look like numbers, such as phone numbers, ZIP codes, and other postal codes. Long Text (Memo) Text up to 65,536 characters. A Long Text field can contain Rich Text(formatted text) and you can set it to Append Only so that it can accumulate text notes without allowing the user to delete what's already there. Number Only numbers, You may use + or - before the number, as well as a decimal point. If you plan to do math with a field, use a Number or Currency field. Occupies 8 bytes. Currency Numbers with a currency sign in front of them ($ and so on)
  • 39. Using the table design view Data Type What It Holds AutoNumber Numbers unique to each record and assigned by Access as you add records, starting at 1 . Use an AutoNumber field as the primary key field for most tables, Occupies 8 bytes Date/Time Date and Time values for the years 1000 through 9999. Occupies 8 bytes. Hyperlink Text or combinations of text and numbers stored as text and used as a hyperlink address. Occupies up to 2048 characters Yes/No Yes and No values and fields that contain only one of two values. Occupies 1 bit (0 or 1 ) .
  • 40. Using the table design view Data Type What It Holds Attachment May contain 0, 1 or many files. This provides a convenient and more efficient way to store OLE Objects. OLE object OLE object To store images and documents. By default, OLE created a bitmap equivalent of the image or document. Occupies 1 GB
  • 41. Using the table design view • Field Description : Field description helps you to remember the use and purpose of a particular field. It is very useful in large projects where several people may be working on the same database. This field is, however, optional.
  • 42. Using the table design view • The Field Properties Area: The field Properties are the attributes that describe and define a field. Each type of field has a particular set of properties. Setting field properties enhances the way your table works. Some of the more commonly used properties and their functions are described in next slides
  • 43. Using the table design view Field Property Storage size Field Size Specifies the maximum number of characters allowed in a field Format Specifies how data displays in a table and prints Input Mask Defines a standard pattern for the appearance of all data entered in a field Caption Used when you want to display an alternate name for the field to explain the field name Validation rule Specifies an expression that checks for invalid data. Validation Text Displays the message if the entered data fails the validity rule. Default is none.
  • 44. Using the table design view Field Property Storage size Required Specifies whether or not a value must be entered in a field. Allow Zero length Specifies whether or not an entry containing no character is valid. Indexed Create an index for the primary key, speeds up sorting and searching. Unicode Compressio n Indicate whether you want Access to save space if only plain text is entered. IME Mode Input Method Editor-setting applies only if you are using East Asian languages
  • 45. Using the table design view Field Property Storage size IME Sentence Mode Setting apply to the Japanese language only Smart Tags Adds additional functionality to the field that you would normally have to open another program to do Text Align Aligns the data in a field the left, center, right or distributed (spread across the data cell)
  • 46. Using the table design view • Click the Create tab. • Click Table Design. • Type a name in the Field Name column for each field you want-for example, Customer Name, etc. • In the Data Type drop-down list, select a data type for each field-for example, Short Text, (At the end of this exercise, a table describes the data types that are available.) • Save. • Provide a name for the table, and click OK. • If you have not created a primary key, you will be prompted to add a key. Click Yes to add a primary key. • After saving your table, the new ID primary key is added to the table. • The table now appears in the navigation pane,
  • 47. Choosing field size properties The Field Size property is used to set the maximum size for the Text or Number data that can be entered in the field. The default field size for a field with data type of Text is 50 characters. You can change the size to an amount anywhere in the range of 0 to 255 characters. The field size for numeric data tells you the range and how many bytes it will take for storage. The options are: • Byte, which is used to store positive integers (whole numbers) between 1 and 255. • Integer, which is used to store larger integers and negative integers, between -32,768 and +32,768. • Long Integer, the default Number field size, which is used to store even larger integers between roughly -2 billion and +2 billion. • Single, which stores single-precision floating-point numbers between -3.4 x 1 038 to +3.4 x 1 038 . • Double, which stores double-precision floating-point numbers between - 1 .797 x 1 0308 to + I .797 x 1 0308.
  • 48. Choosing field size properties • Replication ID, which is used to store a globally unique identifier (GUID). • Decimal, which makes the Precision and Scale properties available to control number entries. • AutoNumber fields are limited to Long Integer and Replication ID field sizes
  • 49. Choosing field size properties • In the Navigation Pane, right-click the table that you want to change field properties for. • Select design view in the shortcut menu. • Click the field you want to change. • In the Field Properties General pane, click in the Field Size Property box. • For a text field, enter a value between 1 and 255 . For a Number field, refer to the previous table and pick an option from the drop-down list. • Click the save button on the Quick Access Toolbar. • Close table design view.
  • 50. Setting format properties • Access always sets each field with the default format for its data type. The format properties define how the field is displayed in tables, forms and reports. To change the format of a field different symbols are entered in the Format Text box.
  • 51. Text and memo fields • Text and Memo fields use the same format settings, some of which are characters placeholders that apply to individual characters and other settings affecting the entire entry. Text and Memo data type can use any of these four symbols: • For example: i. @@@-@@-@@@@ would display 123456789 as 123-45-6789. ii. > would display STARTUP whether you enter characters to uppercase STARTUP , startup or Startup. Symbol Effect @ Indicates a character or a space is required. & Indicates a character or a space is optional. < Converts all characters to lowercase. > Converts all characters to uppercase.
  • 52. Number and currency field You can format your Number and Currency data with one of the Access’s predefined formats or create your own using the special formatting symbols. The available formats for the field with number data types are listed in the following table: Setting Effect General Displays number as entered. Number Default for number fields. Currency Displays number with currency symbols and thousands separator. Negative values appear in parenthesis. Default is 2 decimal places. Euro Displays number with Euro currency symbols and thousands separator. Negative values appear in parenthesis. Default is 2 decimal places. Fixed Displays at least one digit. Default is two decimal places.
  • 53. Number and currency field Setting Effect Standard Displays thousands separator. Default is two decimal places. Percent Displays value multiplied by 100 with added percent sign(%).Default is two decimal places. Scientific Uses standard scientific notation with exponents.
  • 54. Number and currency field The custom Number and Currency formats also use special characters to indicate how you want the values to appear. The table given below describes symbols and their effects. Symbol Effect .(period) Indicates the decimal point that separates the part of a number. ,(comma) Used as thousands separator. 0 A digit placeholder that displays a digit if one is there or, if none are there, displays zero. # A digit placeholder that displays a digit if one is there or, if none are there, closes up the adjoining digits. $ Displays a dollar sign. % value is multiplied by 100 and a percent sign(%) is added.
  • 55. Date/ Time Fields Date/time fields include seven predefined format settings. The table given below describes the format access provides Setting Description General Date (Default) Combination of short date and long time settings. Long Date Uses long date regional setting. Medium Date 12-Apr-9 Short Date Uses short date regional setting. Long Time 2:30:00 PM Medium Time 2:30 PM Short Time 15:30
  • 56. Number and currency field • The table given below describe the custom formatting available for data / time values. Symbol Description : (colon) Time separator as set in the Regional Settings Properties dialogue box. / Date separator dd Day of the month in two digits(01 to 31). dddd Full weekday name(Sunday through Saturday) mm Month in two digit(01-12) yy Last two digits of the year yyyy Full year(0100-9999) hh, mm, ss Hour, minute or second into two digits(01 to 23, 01 to 59) am/pm 12-hour clock with two-character uppercase or lowercase design it
  • 57. Yes/ No fields • Access automatically displays a default check box control when you specify a Yes/No data type. Any format settings you make are ignored with this choice. Access provides three predefined formats for displaying Yes/No, On/Off or True/False.
  • 58. Yes/ No fields • In the navigation pane, right-click the table that you want to change field properties for. • Select design view in the shortcut menu. Click the field you want to change. • In the Field Properties General pane, click in the format property box. • Select an option from the drop down list and save the changes.
  • 59. Defining input mask An input mask is a field property that determines what data can be entered in the field, how the data looks, and the format in which it is stored. An input mask consists of three parts, separated by semicolons. The first part defines the mask string using mask definition characters and embedded fixed data. The optional second part indicates whether you want the formatting characters stored in the field in the database. Set this second part to 0 to store the characters or to 1 to store only the data entered. The optional third part defines the single character that Access uses as a placeholder to indicate positions where data can be entered. The default placeholder character is an underscore(_) The Following list explains the purpose of the most common input mask characters:
  • 60. Defining input mask Character Description 0 Required digit(0 through 9) 9 Optional digit or space # Optional digit or space; blank position are converted to spaces; plus and minus signs are allowed. L Required letter or digit(A through Z) ? Optional letter(A through Z) A Required letter or digit a Optional letter or digit & Required character (any kind) or a space C Optional character (any kind) or a space < All characters that follow are converted to lowercase
  • 61. Defining input mask Character Description > All character that follow are converted to uppercase ! Characters typed into the mask fill at from left to right Character that follows is displayed as a literal character Password Creates a password entry box
  • 62. Defining input mask • Click the Build button (...) at the right of the field’s Input Mask property. The first Input Mask Wizard dialog box opens where you can select from a list of ten predesigned input m asks appropriate for commonly used fields. The Try-It box shows how the mask works when displayed in datasheet or form vie. Access may prompt you to save the table design before opening the first dialogue box. • After selecting the mask, click Next to move the second dialogue box. In this dialogue box you can make any necessary changes to the mask such as changing the placeholder that displays the fill-in blanks (the default is an underline character), and then click Next. • Choose to store to the literal characters with the data, if desired. • Click finish to close the Wizard.
  • 64. Setting a default value • The caption field property is used when you want to display an alternate name for the field to explain the field name. A caption can contain up to 255 characters, in any combination of letters, numbers, special characters and spaces. The new caption also appears in queries and replaces the text in the field labels attached to controls in report and form designs. The field name remain the same; only the level so the next caption text. (If your rename the field later in Datasheet view, the caption property is deleted. To prevent this, rename fields ony in Design view)
  • 65. Setting a default value The default value property is used to specify a value that is automatically entered in a field when a new record is created. This property is commonly used in most of the entries in the field will be same for the entire table. The default value is then displayed automatically in the field. When users add a record to the table, they can either accept this value or enter another value. This saves time while entering data.
  • 66. Setting a field validation rule The process of examining the data that has been entered against conditions that you have provided is call validation. A validation rule is the condition that should be satisfied by the data. A validity check is set by entering an expression to describe acceptable values.
  • 67. Validating numbers Expression Description <100 The value must be less than 100. >0 The value must be greater than 0. <>45 The value can be anything except 45. <=50 The value must be less than or equal to 50. Between 0 to 50 The value must be between 0 and 50.
  • 68. Validating dates Expression Description < # 1/30/2009 # The date occurs before January 30, 2009 < # 1/30/2009 6:30 PM # The date occurs after/on January 30, 2009 after 6:30 PM < = # 1/30/2009 # The date occurs before/on January 30, 2009 > = # 1/30/2009 # The date occurs after/on January 30, 2009 > DATE ( ) The date occurs after the current date. < DATE ( ) The date occurs yesterday or before the current date. > NOW ( ) The date occurs today after the current time or any day in future. < NOW ( ) The date occurs today before the current time or any day in past.
  • 69. Validating texts When you add a validity check, you can also add validation text in the Validation Text property box. A validation text is the error message that is displayed if the data is invalid. Expression Description Like “R*” The * represents zero or more characters. It checks that the value starts with R or r, followed by a series of zero or more characters. Like “*ed” It checks whether text ends with characters “ed” Like “? ? ? ADB” The ? represents a number. It accepts a text that ends with ADB. Like “# # # ADB” The # represents a number. It accepts a text that ends with ADB and is preceded by three numbers. Like “[AE]? ? ?” It accepts 4 characters, and the first character is either A or E.
  • 70. Validating texts • Display the table in Design view. • Select the field name in the upper pane of the design window, and then click validation rule in the field properties pane. • Click the (…) button at the right end of the validation rule box to open the expression builder, or type an expression and press ENTER. • In the validation textbox, enter the message you want to display when the rule is broken.
  • 71. Requiring an entry The required property specifies whether a value is required in the field. If the property is set to ask for a field, you must enter a value in that field, and the value cannot be null(zero). If you set the Required property to Yes for a field in a table that already contains data, Access keeps you the option of checking whether the field has a value in all existing records. The field must have a value in all instances in which data might be entered in a field-in the table itself as well as in forms, queries, reports, and any other data sheets based on the table. You can set a Required property for any type of field except a field that has the AutoNumber data type assigned to it. A primary key field will not accept null values.
  • 72. Allow zero length string A zero-length string is a string that contains no characters. The Allow zero length property, when set to yes, permits zero-length strings. This property is available only to Text, Memo and Hyperlink fields. The indexed property field is used to set a field as an index. The Yes (No Duplicates) setting for the indexed property indicates that the information in the field will be indexed for faster searching, and that duplicate values are not allowed. For the primary key field, this property is automatically set to Yes (No Duplicates) Preventing duplicates
  • 73. Defining a primary key field • A primary key Is a field that uniquely identifies each record. • Most tables have at least one field that is selected as the primary key. • The data in the primary key field must be unique for each record. • A student’s records, for example, would use Student_ID as a key field because it uniquely identifies each student. • A primary key prevents duplicate records from being entered in the table and is used to control the order in which records display in the table. This makes it faster for databases to locate record in the table and to process other operations. • The primary key is also used to create a link between table in a database.
  • 74. Defining a primary key field • Right click the table in the Navigation Pane. • Select design view. • Select one or more fields. (Use the Ctrl key, and click the field selector to pick Multiple fields). • Click primary key. • Click save.
  • 75. Creating a table in layout view The layout view in Access can be used for tables, forms and reports, and it enables you to make design changes without using the more complex design view. You can make changes and, at the same time see how the design will finally look. In layout view, you have less control over detailed choices, but you have a faster and more intuitive interface through which to interact with the table. In layout view, Access automatically adds a unique AutoNumber primary key, called 10, to your blank table design. After working in the layout view, you can always switch to the design view to refine your choices.
  • 76. Creating a table in layout view • A Click the Create tab. • Click Table. • Click the Click to Add Dropdown list. • Select the data type. • Replace the default caption “Field 1” with a name for the field. • Click save. • Provide a name for the table and click OK.
  • 77. Relationship between tables A relationship plays a very important role in the database design. It is formed by linking matching fields of two tables. The relationships effectively join tables to form one large table. This avoids having to repeatedly enter the same data, therefore, saving time and reducing data entry errors. Table related at the table level are ready for use in queries, forms, reports and data access page. There are three possible relationships between related entities or table. They are: one-to-one, one-to-many and many-to-many.
  • 78. One-to-One [1:1] In a one-to-one relationship, each record in table A can have only one matching record in table B, and each record in table B can have only one matching record in table A. This type of relationship is not common, because most information related in this way would be in one table. For example, there can only be one department head in the college for one department. The faculty head cannot head more than one department. One-to-many relationship is the most common type of relationship. In a one-to-many relationship, a record in table A can have many matching records in table B, but a record in table B has only one matching record in table A. For example, a student can major in only one discipline, but many students can register for a discipline One-to-Many [1:m]
  • 79. Many-to-Many [m:m] • In a many-to-many relationship, a record in table A can have many matching records in Table B, and a record in Table B can have many matching records in Table A. This type of relationship is only possible by defining a third table (called a junction table) whose primary key consists of two fields-the foreign keys from both tables A and B. For Example, a customer can purchase more than one product and a product can be purchased by more than one customer.
  • 80. Creating Relationships by using the Lookup Wizard The Lookup Wizard is one of the most powerful features in Access, assisting you to relate data in one table that needs to lookup data from another table. The Lookup Wizard will also create a relationship between your main table and the lookup table and provides option to “Enforce Referential Integrity” which means preventing users from typing values that are not in the lookup table or from deleting values in the lookup table that have been used in the main table.
  • 81. Creating Relationships by using the Lookup Wizard • A In the table design view, move to a blank line in the data type column and select the Lookup Wizard in the drop-down list. • Select the option to look up values from another table or query. • Select the table from which you will look up a value, Click Next. • Select both the field value to save in the new field(ID) and the field value to display in the list(Customer Name). Click Next, on the following screen select any fields for sorting and click Next. • Choose whether to show or hide the key column.(Normally, if you have two columns selected, you would hide the primary key column). Click Next. • Type a name for the lookup field. • Select the Enable Data integrity check box to make sure that the list of Customer and Contacts that refer to the customer is always consistent. • Choose the Restrict Delete option to prevent customers from being deleted when they are referenced by a contact. • Click Finish. • Click Yes to save your changes.
  • 82. Creating Relationships by using the Lookup Wizard
  • 83. Viewing relationships Relationships sit at the very heart of what distinguishes a database from a worksheet; a relationship is a rule that cannot be subverted when you are entering or changing data and guarantees the consistency of a data (within the bounds of the rules). The relationship diagram can be very misleading tool to work with in any database because it serves two purposes. First, it is a roadmap you can delete tables and queries from the diagram without changing anything. It is a passive picture that helps you to see how the tables are related with each other. The second role of a diagram is exactly the opposite of first use. When it comes to the actual relationships between tables (the lines joining them), the diagram is an active tool that allows you to create and delete rules (relationships) from tables.
  • 84. Viewing relationships • Click the Database Tools tab. • Click Relationships. • Double-click a relationship line to display and/or change the relationship
  • 85. Deleting relationships • When we delete a relationship, we remove something from the database, but if you delete a table from the diagram, you are changing only the relationship picture. The table is not deleted from the database, and it can be easily be added back to the diagram. When you save the relationship diagram, you are saving only a picture. It is when you delete or create a relationships that the database gets changed. • Click the relationship line, which will become a thicker to indicate that it has been selected • Press the Delete key, and click Yes to delete the relationship.
  • 86. Understanding Referential Integrity Referential integrity is a set of rules used by Access to ensure that the relationships between tables are valid and that the related data is not accidentally changed or deleted. The rules include the following: • A record in a primary table cannot be deleted if matching records exist in a related table. • A primary key value cannot be changed in the primary table is the record has related records. Once Referential Integrity has been set, Access displays a warning message if one of the rules is broken and does not allow you to complete the action you are trying to do.
  • 87. Understanding Referential Integrity • A Double-click on the relationship line between two tables. The Edit Relationships dialog box will open. • Click on the Enforce Referential Integrity check box. • Mark either or both additional check boxes as desired. • Click on Cascade Update Related Fields to automatically change entries on the “many” side if an entry changes on the “one” side. • Click on Cascade Delete Related Fields to automatically delete entire records from the table on the “many” side if the related entry in the table on the “one” side is deleted. Then click on OK .
  • 88. Sorting data A Sorting data often helps you find specific information quickly. In Access, you can sort data in ascending order (A to Z or 0 to 9 ) or descending order (Z to A or 9 to 0 ). You can sort all records in a table by a single field or you can select adjacent columns or sort by more than one field. When you select multiple columns to sort, Access sorts records starting with the column farthest left, then moves to the right across the columns. Access saves the new sort order with your table data and reapplies it automatically each time you open the table to return to the primary key sort order, you must remove the temporary sort.
  • 89. Sorting data • Select a field in the cell you wish to sort by. • Click the Home tab on the Ribbon and locate the Sort and Filter group. • Sort the field by selecting the Ascending or Descending command. • The table will now be sorted by the selected field. • To save the new sort click the save command on the Quick Access Toolbar.
  • 90. Indexing Indexing refers to creation of a separate file called index-file that stores the order of records on the basis of a field’s value. This index-file is internally used by database management system for various purposes. Indexing can be achieved by setting the Indexed property of field to Yes.
  • 91. Indexing • In the table design view, locate the field name you want to index. • In the Field Properties Section, select an index allowing duplicates. • You can display and manage all indexes in a table by using Indexes popup window.
  • 92. Filtering records Filtering is a restriction you place on records in the open datasheet or form to quickly isolate and display a subset of records. A filter is created by specifying a set of limiting conditions or criteria, you want records to meet in order to be displayed. A filter is ideal when you want to display the subset for only one for only a brief time, then return immediately to the full set of records. Filter is also temporary and all records are redisplayed when you remove the filter or close and reopen the table or form. The filter cannot be saved. However, the last filter criteria you specify are saved with the table, and results can be quickly redisplayed.
  • 93. Filtering records • Click the drop-down arrow next to the field you want to filter by, • A drop-down menu with a checklist will appear. Only checked items will be included in your filtered results. Use the following options to determine which items will be included in your filter: Select and deselect items one at a time by clicking their checkboxes. Click Select All to include every item in the filter. If all items are already selected, this option will deselect all items. Click blanks to set the filter to find only the records with no data in the selected field. Click ok the filter will be applied
  • 95. Extracting information with queries A query is a request for data results, for an action on data, or for both. Using a query makes it easier to view, add, delete, or change data in your Access database. Some other reasons for using queries: • Find specific quickly data by filtering on specific criteria(conditions) • Calculate or summarize data • Automate data management tasks, such as a reviewing the most current data on a recurring basis.
  • 96. Extracting information with queries Query Type Description Select Query Used to select and display data from either one table or a series of them depending on what is needed. Crosstab Query Summarizes large amounts of data in an easy-to-read, row-and-column format. Parameter Query Displays a dialog box prompting you for information, such as criteria for locating data. Action Query Add, change, or delete data. Each task has a specific type of action query. Four kinds of action queries are: Append Query- takes the results of a query and “appends” (or adds) theme to an existing table. Delete Query- deletes all records in an underlying table from the set results of the query. Make Table Query- as the name suggests, it creates a table based on the set results of a query. Update Query- allows for one or more field in your table to be updated. SQL Query Created using SQL (Structured Query Language), an advanced programming language used in Access.
  • 97. Using the simple query wizard A good way to start learning about queries is to create one with the Simple Query Wizard. It creates a select query, a basic kind of query that displays certain fields from a table in a datasheet like view. For example, you can use address table to extract names and telephone numbers of the employee using query. • On the Create tab, in the Queries group, click Query Wizard. • In the New Query dialog box, click Simple Query Wizard, and then click OK. • Under Tables/Queries, click the table that has the data that you want to use. Note that a query can also use another query as a recordsource. • Under Available Fields, double-click the required fields, and click Next. • Name the query, and then click Finish. • Access displays all of the contact records in Datasheet view. The results show all of the records, but show only the four fields that you specified in the query wizard.
  • 98. Using the simple query wizard
  • 99. Using query in design view The Query Design view is used to create and modify the structure of the query. The Query Design window is divided into two areas. The upper portion of the Query Design View displays the field list for each table used by the query. The lower portion of Query Design view displays the query grid where you add or change the fields displayed by the query, add criteria to determine which records will be selected, define sort orders and build calculated fields.
  • 100. Using query in design view • Select the Create tab on the Ribbon, and locate the Queries group. • Click the Query Design command. • Access will switch to Query Design view. In the Show Table dialogue box that appears, select the table you want to run a query on. • Click Add, then click Close. • The selected table will appear as a small window in the Object Relationship pane. In the table window, double-click the field names you want to include in your query. They will be added to the design grid in the bottom part of the screen. • Set the search criteria by clicking the cell in the Criteria: row of each field you want to filter. Typing criteria into more than one field in the Criteria: row will set your query to include only results that meet all criteria. If you want to set multiple criteria but don't need the records shown in your results to meet all of them, type the first criteria in the Criteria:row and additional criteria in the or:row and the rows beneath it.
  • 101. Using query in design view • After you have set your criteria, run the query by clicking the Run command on the Design tab. • The query results will be displayed in the query’s Datasheet view. If you want, Save your by clicking the Save command in the Quick Access toolbar. When prompted to name it, type the desired name, then click OK
  • 102. Using query in design view
  • 103. Adding selection criteria in queries • The selection criteria in queries are expressions defining a condition that must be met for the record to be included in the subset. An expression is a combination of symbols, values, identifiers and operators used for many purposes. Symbols used in expressions include quotation marks, colons, asterisks, and other special characters. Values can be expressed as literal values, constants, the result of a function, or an identifier. Identifiers refer to the value of a field, a control in a form or report, or a property. An operator is a symbol or word that indicates an operation to be performed on one or more elements in the expression.
  • 104. Using wildcard Patterns Wildcards offer a way of setting criteria based on patterns or partial words rather than exact matches. The most common wildcard operation include: To specify a wildcard pattern, enter the pattern in the Criteria row of the field column in which you want to search Wildcard Description ? Replaces a single character * Replaces a number of characters # Replaces a single desert
  • 105. Using operators • Operators are the key to more flexible expressions. Access has several classes of operators: arithmetic, comparison, concatenation and logical. The table in the next column lists operators you can use in query criteria expressions.
  • 106. Arithmetic operators An arithmetic operator is a mathematical function that takes two operands and performs a calculation on them. They are used in common arithmetic and most computer languages contain a set of such operators that can be used within equations to perform number of types of the sequential calculations. Operator Description Example + Addition =Total +3 - Subtraction =Total -3 * Multiplication =Total *3 / Division =Total/3 Integer division =Total3 Mod Modular Division =Total mod 3
  • 107. Comparison operator • Comparison operators, as their name implies, allow you to compare two values. Operator Description Example = Equals =Books or =“Books” > Greater than >7/15/06 or <#7/15/06# < Less than <1000 >= Greater than or equal to >=20 <= Less than or equal to <=20 <> Not equal to <>“KTM”
  • 108. Comparison operator • Comparison operators, as their name implies, allow you to compare two values. Operator Description Example BETWEEN... Between two BETWEEN 100 AND values, inclusive AND 600 IN Included in a set of values I (“Pokhara”, “K ”) IS NULL Field is empty Is Null IS NOT NULL Field is not empty Is Not Null “ ” Zero-length string =“ ” LIKE Matches a pattern Like C* or k “ *”
  • 109. Logical Operators Logical operators to combine two Boolean values and return a true, false, or null result. Logical operators are also referred to as Boolean operators. Operator Description Example AND both conditions are true >=10 AND <=100 OR either condition is true “Books” OR “Pencil” NOT not true NOT like “A*”
  • 110. Sorting query field • By default, query fields are not sorted. You can however sort any fields in either ascending or descending order. • Click on the Sort row in the field column you want to sort. A down arrow will appear to the right of the field. • Click on the down arrow. A menu will appear. • Click on ascending to sort in ascending order. or Click on Descending to sort in descending order. The sort order will be set based on the instructions in step third
  • 111. Performing calculations • A calculated field displays the results of a calculation in a query. You can perform a variety of calculation in queries. You can create your own calculation or use one of Access’s seven predefined calculations called functions: Function Calculations SUM Total of the values in a field. AVG Average of the values in a field. COUNT Counts number of values, excluding empty cells, in a field for all records MIN Lowest value in a field. MAX Highest value in a field. STDEV A measure of the dispersion of a frequency distribution. VAR Square of the standard deviation.
  • 112. Append query • Append query is a type of query that enables you to select data from existing tables and add data into another table. Any rules or validation defined in the table into which the data is added are enforced when you try to append the data. You are allowed to select data from several tables, but you can append only to a single table. After you have selected the target table, you can see the name of the table by viewing the SQL. After you have selected the target table, fields where names match are automatically paired together; if the names are different; you can select the corresponding fields.
  • 113. Append query • Append query is a type of query that enables you to select data from existing tables and add data into another table. Any rules or validation defined in the table into which the data is added are enforced when you try to append the data. You are allowed to select data from several tables, but you can append only to a single table. After you have selected the target table, you can see the name of the table by viewing the SQL. After you have selected the target table, fields where names match are automatically paired together; if the names are different; you can select the corresponding fields.
  • 114. Append query • Start with a select query including your table, select the fields to be used in the new table, and then click Append. • Select the table into which to append the data. • Click OK. • Use the drop-down list of available fields to match up any fields where the names are different. Where the names are the same, the Field and Append To rows will be matched. • Click Run. • Click Yes to add data to your table.
  • 115. Append query • Start with a select query including your table, select the fields to be used in the new table, and then click Append. • Select the table into which to append the data. • Click OK. • Use the drop-down list of available fields to match up any fields where the names are different. Where the names are the same, the Field and Append To rows will be matched. • Click Run. • Click Yes to add data to your table.
  • 116. Delete query Delete query is a type of query that allows you to delete data from a table either by specifying filtering criteria or by using data in other tables or queries to limit the data that is being deleted. As with all action queries, you cannot undo the operation, so making a backup of a database before you execute a Delete query is important. • Start with a select query including your table, and click Delete. • Select a field to filter the data. • Type the filter criteria. • Click Run. • Click Yes.
  • 117. Make table query Make Table query is a type of query that creates a new table based upon the selections that you choose on the query grid. This type of query is useful when you are improving the design of database by creating new lists of data or by splitting the data in one table into a state of tables. • Click the Create tab. • Click Query Design. • Add your tables and fields to the query grid. • Click Make Table. • Type a name for your new table. • Click OK. Before clicking the Run button, you can click View to review the data that will be created in the new table and then return to design view to execute the query by clicking the Run button. • Click Run to execute the action query. • Click Yes to create your new table.
  • 118. Crosstab query with the query wizard Crosstab queries can be constructed manually. However, it is simpler to use the Query Wizard to create the query, which you can later change in design view. • Click the Create tab. • Click Query Wizard. • In the New Query popup window, click Crosstab Query Wizard • Click OK • In the Crosstab Query Wizard, click Queries. • Select a query and click Next. • Select one or more columns to act as row headings, and click Next. • Select one column to act as the new column headings, and click Next. • Select the column to summarize. • Select the calculation type to use, and Click Next.
  • 119. Crosstab query with the query wizard • Type a name for your query, and click finish. • Select design View. • In the query Column Headings property field, type a fixed set of headings
  • 120. Understanding forms A form is a database object used primarily to display records onscreen, to make it easier to enter new records and to make changes to the existing records. Form allows you to design the layout of fields on the screen in any arrangement. Forms are based on an underlying table, and include design control elements office descriptive text, title, labels, lines, boxes and pictures. Depending on your needs, you can create forms in three ways: • The Form Wizard asks some questions and then creates an attractive form based on your answer. • The Form Design and Blank Form buttons let you start with a blank form and build from the ground up. • The Form tools make attractive forms with a click of the mouse.
  • 121. Using the Form tool if • You want all fields in the selected table or query to appear on the form • You don’t want to control over the type of style that is applied to the form • In the navigation pane, select the table you want to use to create a form. You do not need to open the table • Select the create tab, locate the forms group and click the form command • Your form will be created and opened in layout view
  • 122. Using the Form tool
  • 123. Using the Form wizard if • You want to select specific fields for your form. • You want to select fields from more than one table or query. • You want to choose from a list of layouts for your form.
  • 124. Using the Form wizard if • Open your database file. • Click the Create tab on Ribbon. Several bottom groups appear on the Ribbon, including the Forms Group. • Click the Form Wizard button. The form Wizard appears. • Using the Table/Queries drop-down menu, select the source of the form’s fields. i. Click the down arrow to list the database’s tables and queries ii. Select the table or query that contains the fields you want to view with this form • Select the fields you want To select the individual fields, double click each field you want in the available fields list. If you want to add all the fields, click the >>> button. • After you have selected all the fields you want to include on your form, click Next.
  • 125. Using the Form wizard if • Choose one of the layouts and then click Next. • Enter a descriptive title in the What Title Do You Want For Your Form? Box at the top of Form Wizard screen. • Click Finish to open form in Form view. Your new form appears on screen.
  • 126. Understanding reports • Report is an Access database object that presents information in the printed format. It is a summary of the data contained in one or more tables or queries. It will often provide answers about the information in your database such as yearly sales for a specific product or the payroll data for a particular week or month. When you create an Access report you can include calculations that are not included in other database objects. You can also include headers and footers to print identifying information at the top and the bottom of every page. You can group and sort data to organize information efficiently and apply formatting effects to make your report both attractive and easier to read and understand.
  • 127. Use report button The report button creates a simple report that lists the record in the selected table or query in a columnar format. • Open the table or query you want to use in your report. • Select a Create tab on the Ribbon. Locate the Reports group, then click the Report command. • Access will create a new report based on your object. • Click the Save button on the Quick Access toolbar. Access saves the report unless you are saving for the first time. If you are saving for the first time, the Save As dialogue box appears. • Type the name you want to give to your report. • Click OK. Access saves the report. You can now access the report by using the Navigation pane.
  • 129. Use report wizard The report Wizard provides you with more flexibility than you get by using the Report button. You can choose the tables and fields, group the data, sort the data, summarize the data, choose a layout and orientation, apply a style and title your report. • On the create tab in the reports group, click report wizard. The wizard starts. • From the tables/queries drop down list, select the table(or query) to base the report on. The fields for the selected table load in the available field list box. • Move the fields to include on the report from the available fields to selected fields • Click next • To group records on the report by a particular field, highlight the field in the list box and click >. • To group records on the report by a particular field, highlight the field in the box and click >. • Add more grouping levels if desired
  • 130. Use report wizard • When you finish defining how you want records grouped, click next>. • In the first drop-down list, select the field to sort records by • When you finish specifying sorting options, click next • In the layout field, select the format of the report • In the orientation field, select the orientation • If you want all the fields to fit ton a single page, ensure the adjust the field width so all fields fit on a page check box is marked • Click next • Enter title of the report • Select an option for the view you want to open the report in • Click finish