SlideShare ist ein Scribd-Unternehmen logo
1 von 98
Downloaden Sie, um offline zu lesen
Database
Management
System
PRESENTED BY: SABIN DHAKAL
PRESENTED TO: ROSHAN MAHARJAN
Main Points to Remember
❖ Define Database Management System and Advantage and Disadvantage of DBMS
❖ Define MS-ACCESS and describe the four basic objects of MS-ACCESS.
❖ Explain how to create table, query, form and report in MS-ACCESS.
❖ Explain how to locate specific record in MS-ACCESS.
❖ Define relationship and explain the different types of relationships;
1. Data is the plural form of the word “datum” which refers to a collection of raw facts.
2. Data are the raw materials of information processing.
3. They are measured, collected and reported, and analyzed, whereupon it can be visualized using graphs,
images or other analysis tools.
Information
1. It is the resultant output after processing of data which is the most critical resource of the information.
2. Data becomes information when you understand what it means.
DATA
1. Processing is a series of actions or operations that converts some input into useful output.
2. Data processing is defined as the processing data to make it more usable and meaningful , thus
transforming it into information.
PROCESSING
1. Electronic database refers to an organized collection of data stored on a computer in such a way that its
content can easily be accessed, updated and queried upon with the help of software program.
2. In other words, A collection of systematically organized inter-related data is called a database.
3. Database is used to store, organize and retrieve data.
4. The advantage of database is the limitless capacity to store data, and speed , accuracy , and efficiency
with which you can retrieve information.
ELECTRONIC DATABASE
A database table is composed of records and fields that hold data, Tables are also called datasheets.
Tables are the building block of database. Table is a set of information about a particular object. Each table
in a database holds data about a different, but related, subject. Table stores a large volume of data into
rows and column format. A single table is used to store data of a specific purpose or subject such as
telephone directory, book records in library etc. Since entire data is managed and kept in a table for the
future retrieval process it is also called the primary object of database. Table stores large volume of data
into rows called records and column called field. When fields and records are combined forms a complete
table.
TABLE: THE BUILDING BLOCKS OF
DATABASE
Emp No. Dept No. Address
E01 D01 New Road
E02 D02 Tokha Road
E03 D03 Surket Road
How DBMS Works?
• DBMS provides a centralized control over data- A database system maintains a centralized
database, i.e. all the data is kept at one place and any application that requires the data can
access it from this central location. Any application can share data from the central location.
Though sometimes it may be necessary to duplicate the data, the redundancy can be
controlled as the DBMS is aware of the multiple copies and update them regularly.
Features of DBMS
❖Large volume of data can be stored and updated easily.
❖Provides data integrity and security.
❖Easy in data administration or data management.
❖Provides the data sharing facility.
❖Reduces the data redundancy (duplication of data).
❖ Provides concurrent access, recovers the data from the crashes.
❖Supports centralized control
Database Management System
• Database management system (DBMS) is a computerized system that stores data, processes
them and provides information in an organized form.
• DBMS basically deals with the creation of database, its management and retrieval process.
Creating, modifying, updating, appending, organizing, sorting, removing, and retrieving are the
major tasks performed easily, efficiently and accurately using Database management system.
• Some of the popular DBMS software are MS-Access, Oracle, MS-SQL Server, MySQL,
PostgreSQL etc.
ADVANTAGES OF DATABASE
SYSTEMS
• It reduces the data redundancy on the file.
Redundant data are repeated and
necessary data exist on the file. So, we have
to reduce it to save the memory of the
computer.
• Data stored on the DBMS are highly
consistent. They are constant in nature.
• It is possible to share data using DBMS.
Various users are allowed to share data
according to their needs using the same
database file.
• It is possible to apply the centralized
security system on DBMS.
• It has a very high data integrity. We can
retrieve data on complete form using DBMS
DISADVANTAGES OF
DATABASE SYSTEMS
• High initial investment in hardware,
software, and training.
• Overhead for providing security, recovery,
and integrity functions.
• Cost for the hardware-upgrade to allow for
the extensive programs and the workspaces
required for their execution and storage.
• Cost for the maintenance of the software
which remains forever.
• An additional cost is required to transfer
from a traditionally separate application
environment to an interpreted one.
• High cost for backup and recovery
Relational Database Management System (RDBMS)
• Relational Database Management System is defined as a method of viewing information for
several, separated database that relate one to another through keywords or values.
• RDBMS are database management systems that maintain data records and indices in tables.
• Relationships may be created and maintained across and among the data and tables.
• MS-ACCESS and Oracle are the best examples of RDBMS software
Microsoft Access
• Microsoft Access is a Relational Database Management System (RDBMS) that helps us to store
information for reference, reporting, and analysis.
• It is a powerful GUI based RDBMS which provides numerous easy-to-use features, including the
ability to quickly locate information , add delete , modify records , sort records, and produce
professional – looking reports.
• Access was developed by Microsoft Company. This software is distributed along with the Microsoft
Office application package. Microsoft Access 2010 is the latest version available in the market.
• Advantage
• 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
MICROSOFT ACCESS
Click on Start.
Select All Programs.
Choose Microsoft Office folder.
Now choose Microsoft Access 2013
from the list.
We will get windows with various
choices.
Select blank database and type the
required database file name on the
file name box.
Finally click on Create button.
Working with your Access Environment
• Ribbons: The ribbon is the primary replacement for menus and toolbars and provides the main command
interface in Access. ... When you open a database, the ribbon appears at the top of the main Access window,
where it displays the commands in the active command tab. The ribbon contains a series of command tabs that
contain commands.
• Quick Access Toolbar : The Quick Access Toolbar, is located above the Ribbon (top-left) and provides access to
commonly used features and commands, such as Save and Undo/Redo. Both the Ribbon and the Quick Access
Toolbar can be customized
• Backstage view: The Backstage view is the collection of commands that you see on the File tab
on the ribbon. The Navigation Pane is the pane on the left side of the Access program window
that lets you work with database objects.
• Navigation Pane: To display the Navigation Pane in an Access web app, on the Home tab, in the
Show group, click the Navigation Pane toggle button. along the top of the Navigation Pane, click
the Navigation Pane toggle button, or press F11.
Working with Objects
• Database objects are components that save and query information. A database contains
objects that are used to store and display large ,relational data. The most frequently used
objects are the table, query, form and report.
• Basic objects of MS-Access are:
1. Tables
2. Queries
3. Forms
4. Reports
5. Macros
6. Modules
Basic objects of RDBMS
❖ Table
1. It is a collection of various records.
2. A table is a feature, comprising of parallel columns and rows, which is used to store, organize,
and view data on a particular topic.
3. A single database may contain numerous tables containing information about related topics,
such as customer addresses, product prices, and other information.
4. Tables are the primary building block of database.
5. All data are stored and managed in a table. Every table in a database focuses on one specific
subject. Table stores large volume of data into rows and column.
❖ Forms
• A form is an object of database which shows only the information you want to see.
• Forms are the graphical interface used to enter data into the tables or multiple linked
tables.
• Forms are also used to display the information in specific manner, as well as it permits
user to add, modify and delete data in a table.
• Primarily, fields in the table or query are made available to place in the forms that we
create.
• A form is used to view data in a database, enter new data into the database, or edit
data.
• We can create from in database by using Design View , Auto form tabular , Auto form
Columnar, Form Wizard, etc.
❖ Report
1. A report is used to show and print selected information from a table in a customized
manner.
2. A report differs from a form because it does not allow you to make any modifications or edits
to the actual records within the table or tables.
3. Reports are the presentation of information in desired format. Reports are generally created
for the printing purpose of any desired information.
4. With Access, we can create reports of any table or query. For example, report card of your
final examination.
❖ Query:
1. A query is a question that you ask about the data in your table(s).
2. Query is also used to perform various mathematical calculation is the database records.
3. A query is simply the question that we ask about the data stored in the table.
4. Query is also used to perform various actions on the data. For example, "Show the names of
students who have scored greater than or equal to 80 marks in science." "Update the salary
of employees by 10%."
• Macro
1. This object is a structured definition of one or more actions that you want Access
to perform in response to a defined event. An Access Macro is a script for doing
some job. For example, to create a button which opens a report, you could use a
macro which will fire Open Report action.
2. You can include simple conditions in macros to specify when one or more
actions in the macro should be performed or skipped.
3. You can use macros to open and execute queries, to open tables, or to print or
view reports.
4. You can also run other macros or Visual Basic procedures from within a macro.
Data macros can be attached directly to table events such as inserting new
records, editing existing records, or deleting records.
Data macros in web apps can also be stand-alone objects that can be called from
other data macros or macro objects.
Module
Module is an object in desktop databases containing custom procedures that you code using
Visual Basic. Modules provide a more discrete flow of actions and allow you to trap errors.
1. Everything that can be done in a macro can also be done in a module, but you don't get the
macro interface that prompts you what is needed for each action.
2. Modules are far more powerful, and are essential if you plan to write code for a multi-user
environment, because macros cannot include error handling.
3. Modules can be standalone objects containing functions that can be called from anywhere in
your application, or they can be directly associated with a form or a report to respond to
events on the associated form or report.
Understanding The 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 define each field to include in
the table.
The Table Design View window is divided into two panes:
a. Field Grid Plane
b. Field Properties area
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 consists of letter, numbers ,spaces ,and special characteristics
,except a period, and exclamation point ,an accent (~) and brackets ([]).You cannot start a
field name.
Data Type
• Data type is a field property that specifies and limits what kind of data can be entered into that
field.
• For example, values that are stored in a text field can contain only letters, numbers, and a
limited set of punctuation characters.
• You can use the data type property to specify the type of data stored in a table field such as
text for name field, number for class field, date and time for DOB field, etc
Data Type Description Maximum Data /
Space
Default Field Size
Text It is used for text or combinations of
text and numbers as well as
numbers don’t require calculations,
such as phone numbers.
Up to 255
Characters
50 (2003 Version) 255
(2007/10 Version)
Memo It is used for lengthy text and
numbers.
Up to 65,536
Characters
-
Number It is used for data to be included in
mathematical calculations.
1,2,4 or 8 Bytes Long Integer
Byte It stores numbers from 0 to 255
without decimals.
1 byte -
Integer It stores numbers from -32768 to
+32768 without decimals.
2 byte -
Long Integer It stores numbers from -2147483648
to +2147483647 without decimals.
4 bytes -
Date/Time It is used for dates and time data. 8 Bytes -
Default Field
Size
Currency It is used for currency values. 8 Bytes Long Integer
Auto Number It is used for unique sequential
(incrementing by 1).
4 Bytes -
Yes/No It is used for data that can be only one
of two possible values such as Yes/No.
1 Bit -
OLE Object It is used for OLE objects (such as
MSWord documents, MS Excel
spreadsheets, pictures, sounds).
1 GB -
Hyperlink It is used for hyperlinks. Up to 64000 characters -
Attachments You can attach data from other
programs to this type of field, but you
cannot type or otherwise enter text or
numeric data.
- -
Lookup
Wizard
It is used to create a field that allows
you to choose a value from another
4 Bytes -
Field Description
• You can enter the description of each field in the description column.
• It helps you to remember the use and purpose of a particular field.
• This is an optional part in a database. It is displayed in the status bar when you select this field
on a form.
• It helps you to remember the use and purpose of a particular field which is useful in large
projects where several people may be working the same database.
Field Properties Area
• Field properties are the attribute that describe and define a field.
• Field properties are the characteristics which are related to each field. After
creating a field and setting its data type, we can set additional field properties.
• For example, we can control the size of a text field by setting its field size
property. The field size property also determines how much disk space does each
number field value require. Depending on the field size, the number can use
exactly 1, 2, 4, 8, 12, or 16 bytes
Field Property Description
Field Size Species the maximum no. of characters allowed
in the field
Format Species 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
Text Align Aligns the data in a field the left, Centre, right,
right or distributed
Default value Automatically enters the specified value in the
field
Validation rule Specifies an expression that checks for invalid
data
Field Size Properties
• You can use the Field Size property to set the maximum size for data stored in the field that is
set to the Text or Number data type.
• For Text data, the amount of data that you can store can be determined by the number of
characters you wish to store on it. Maximum is 255 characters.
• For numeric data, the field size can be set depending upon the type and range of value you
wish to store. Below table explains about the numeric data range and storage.
Field Size Setting Range of Values Decimal
Places
Storage Size
(in Bytes)
Byte 0 to 255 None 1
Integer -32768 to 32767 None 2
Long Integer 2147483648 to +2147483647 None 4
Single -3.4 x 10^38 to 3.4 x 10^38 7 4
Double -1.797 x 10^308 to 1.797x10^308 15 8
Format
➢ It is basically used to specify the layout for a field. Format field property allows you to display
data in a format different from the way it is actually stored in a table. It is also known as display
layout for a field. The format property uses different settings for different data types.
❖ For Text and Memo Data Types
Symbol Effect
@ Indicates a character or space is required
& Indicates a character or space is optional
< Converts all character to lowercase
> Converts all character to uppercase
Numeric and Currency Fields
You can format the number and currency data with predefined formats. You can choose the pre-
defined formats and many other symbols for creating your own customized numeric and currency
data format given below:
Format Setting Meaning Data Entered Data Displayed
General Number It displays number as entered without
changes.
45689.123
−33615.234
45689.123 −33615.234
Currency It displays the number with currency
symbol with separator.
255.45 $255.45
Euro It displays number with Euro currency
symbol and separator.
6455 €6,455.00
Fixed It displays at least one digit 3456.789 3456.79
Standard It displays thousand separator. 456789.12 456,789.12
Percent It displays the value multiplied by 100
with added % sign.
.22 22.00%
Scientific It uses standard scientific notation with
exponents.
2345.678 2.35E +03
For Date and Time Data Types
Setting Description/Example
General Date Here, if the value is date only, no time is displayed and if the value is time only, no
date is displayed. This setting is the combination of the short date and long time. eg.
6/19/2012 (MM/DD/YYYY) and 7:34:23 PM (HH:MM:SS)
Long Date Long date setting, e.g. Monday, August 25, 2012
Medium Date Medium date setting, e.g. 26-Jun-07 (DD-MM-YY)
Short Date Short date setting, e.g. 9/4/2012 (MM/DD-YYYY)
Long Time Long time setting, eg. 7:30:20 PM (HH:MM:SS)
Medium Time Medium time setting, eg. 7:30 PM (HH:MM)
Short Time Short time setting, eg. 17:34, 7:15 (HH:MM)
For Format String
Format String Data Entered Data Displayed
$#,##0.00 1234.56 $1,234.56
$#,##0.00 0 $0.00
##.00% 5.678 567.80%
##.00% 0 .00
For Logical (Yes/No) Data Types:
A logical format allows only two possible values. The default setting is Yes/No. You can use format as
Yes/No or ON/OFF or True/False which displays with checkbox. A checked checkbox represents Yes or
True or On. An unchecked checkbox represents No or False or Off.
Input Mask
• Input Mask is a field property that determines what kind of data can be entered in the field how it
looks and how can it be entered in a field. It is simply the control over the data entry.
• The task of input mask are:
1. It helps to enter field values in a specified pattern.
2. It can fill in constant characters like dash (-), parenthesis ( ) and slash (/) and optionally store these
characters as part of the field value as you do not have to enter these characters at the time of data
entry.
• Create your own (custom) Input Mask:
Input mask wizard can be the easiest option for certain fields like, pin code, phone numbers, date and
time. You can create your own input masks if you need to format other kinds of values.
The rules for creating input masks are :
1. It contains three possible parts, separated by semicolons (;).
2. It uses special characters in a mask to impose limits on what can be entered in a field.
Input Mask Characters
• The input mask characters are used to indicate how to limit the data that gets entered in a
field. The following input mask characters are allowed to use in the input mask.
Character Description/Function
0 Number is entered and required (0-9), no plus or minus sign.
9 Number is entered and optional (0-9), no plus or minus sign.
# Optional number or space, plus and minus sign is allowed.
L Letter is entered and required (A-Z).
? Letter is entered and optional (A-Z).
A Letter or number entered and required.
a Letter or number entered and optional.
& Any character or space required.
C Any character or space optional
Character Description/Function
< Characters get converted to lowercase.
> Characters get converted to uppercase.
! A mask that displays characters from right to left but characters
are always entered left to right.
 The mask helps display the next character in it as constant; for
example B appears as B.
Password Creates a password entry text box. Any character typed in the text
box is stored as the character but is displayed as an asterisk (*).
❖ Caption:
Adding captions to fields helps both you and future database administrators to understand the design
and content of your database. It is one of the most common filed properties of all data types. It is used to
assign a descriptive name for a field. The maximum size for this is 2048 characters. If caption is not
entered, field name is used for label for a field on a form.
❖ Default Value:
1. Default value field property displays the value automatically for the field when you add a new record
to the table. Default value can be changed during the data entry time.
2. For example, if you want to add records of class 10 students, in the class field you can set the default
value as 10 so that you do not have to enter the class each time you enter the records.
❖ Validation Rule:
1. The process of examining the data that has been entered against conditions that you have provided
is called validation.
2. A validation rule is the condition that should be satisfied by the data.
3. Access provides several ways to validate data, and you often use several of those techniques to
define a validation rule.
Validating Numbers
Expression Example Description
< <100 Entered value must be less than 100.
> >50 Entered value must be less than 50.
<> <>0 Entered value must not be equal to 0.
<= <=100 Entered value must be less than or equal to 100
>= >=50 Entered value must be less than or equal to 50.
= =10 Entered value must be equal to 10.
Between ... and
..
Between 0
and 100
Entered value must be within the range of 0 to
100.
Validation expression for Dates
Example Description
< # 1/30/2012 # Entered date must be before January 30, 2012.
> # 1/30/2010 5:30 PM # Entered date must be after January 30, 2010 and after
5:30 PM.
<= #1/30/2012 # Entered date must be before or on January 30, 2012.
>= # 1/30/2010 Entered date must be after or on January 30, 2010.
>Date() Entered date must be after the current date.
< Date() Entered date must be before the current date.
> Now() Entered date must be today after the current time or
any other day in future.
< Now() Entered date must be today before the current time or
any other day in past.
Validating Text
Expression Description
Like "B*" Here * represents zero or more characters. It checks that the value starts with
B (or b), followed by zero or more characters.
Like "*up" It checks whether text ends with characters "up".
Like "?????UP" Here? represents one character. It accepts 7 characters and ends with UP.
Like "####CSX Here # also represents one character but it is number. It accepts 7 characters
and ends with CSX and preceded by five numbers.
Like "[BO]????" It accepts 5 characters and first character is either B or O.
Like "[A-Z] [AZ]
[A-Z] [A-Z] "
It accepts four characters (Only letters). [A-Z] represents characters ranges
from A to Z
Validation text:
It is a field property which displays the error message when the user fails to use the validation rule. If the
data entered is invalid according to the specified validation rule it displays the validation text.
✓ Required:
Required property is used to specify whether a value is required in a field or not. So, Yes and No are the
options for required property. If this property is set to Yes for a field, the field must receive a value during
data entry. If this property is set to No for a field, the field can be left blank without any value during data
entry.
✓ Allow Zero Length:
Allow zero length property is only for the text and memo data types. This property works with the required
property. If you set the required property to ‘Yes’ and allow zero length to ‘No’, data must be entered
during data entry.
✓ Indexed :
This property speeds up searching and sorting of records based on a field. For example, if you search for
specific student name in the first name field, you can create an index for this field to speed up search for
the specific name. Default indexed property is set as No. It also uses other two settings.
Primary Key
▪ Primary Key is a special field or group of fields in the table that uniquely identifies each record
from the database.
▪ The primary key does not accept duplicate value for a field and it does not allow a user to leave
the field blank or null.
▪ The primary key is an identifier such as a student ID, a Product code, Exam roll no. etc. Hence,
primary key is unique to each record.
• Importance of Primary Key
1. To identify each record of a table uniquely.
2. To reduce and control duplication of the record in a table.
3. To set the relationship between tables.
Setting the Primary Key
• Follow the below steps to create a primary key field:
Step 1: Open the table in Design View.
Step 2:Click on the field in which you want to apply primary key.
Step 3: Click on Design tab.
Step 4: Click on Primary Key button from Tools group.
A key icon will be displayed on the left side of the primary key field
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 view. You
can make changes and, at the same time, see how
the design will finally look.
• In layout view, Access automatically adds a unique
Auto number 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.
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 [1:m]
• 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.
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.
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
• 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.
• 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
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.
▪ Query is an object of database that is used to view, retrieve, change and analyze records from a
table or multiple linked tables based on specified condition.
▪ Some other reasons for using queries:
▪ Find specific quickly data by filtering on specific criteria(conditions)
1. Calculate or summarize data
2. 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:
I. Append Query- takes the results of a query and “appends” (or adds)
theme to an existing table.
II. Delete Query- deletes all records in an underlying table from the set
results of the query.
III. Make Table Query- as the name suggests, it creates a table based on the
set results of a query.
IV. 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 record source.
• 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
i. Select the Create tab on the Ribbon, and locate the Queries group.
ii. Click the Query Design command.
iii. 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.
iv. Click Add, then click Close.
v. 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
vi. Set the search criteria by clicking the cell in the Criteria: row of each field you want to filter.
vii. After you have set your criteria, run the query by clicking the Run command on the Design tab.
viii. 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:
Wildcard Description
? Replaces a single character
* Replaces a number of characters
# Replaces a single desert
To specify a wildcard pattern, enter the pattern in the Criteria row of the field column in which
you want to search.
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
Operator Description Example
BETWEEN... Between two BETWEEN 100
AND values, inclusive AND 600
IN Included in a set of values IN (“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 in a Query
• 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 Calculates
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
• 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.
a. Click the Create tab.
b. Click Query Design.
c. Add your tables and fields to the query grid.
d. Click Make Table.
e. Type a name for your new table.
f. 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.
g. Click Run to execute the action query.
h. Click Yes to create your new table.
Table Query
Crosstab query with the query wizard
✓ Crosstab queries calculate a sum, average, count, or other type of aggregate function to calculate data that is
grouped by two types of information one down the left side of the datasheet and another across the top
i. Click the Create tab.
ii. Click Query Wizard.
iii. In the New Query popup window, click Crosstab Query Wizard
iv. Click OK • In the Crosstab Query Wizard, click Queries.
v. Select a query and click Next.
vi. Select one or more columns to act as row headings, and click Next.
vii. Select one column to act as the new column headings, and click Next.
viii. Select the column to summarize.
ix. Select the calculation type to use, and Click Next.
x. Type a name for your query, and click finish.
xi. Select design View.
xii. In the query Column Headings property field, type a fixed set of headings
Crosstab query with the query wizard
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:
1. The Form Wizard asks some questions and then creates an attractive form
based on your answer.
2. The Form Design and Blank Form buttons let you start with a blank form and
build from the ground up.
3. 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 wizard
• 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
• Click the Create tab on Ribbon. Several bottom groups appear on the Ribbon, including the
Forms Group.
• Open your database file.
• Click the Form Wizard button. The form Wizard appears.
• Using the Table/Queries drop-down menu, select the source of the form’s fields.
1. Click the down arrow to list the database’s tables and queries
2. 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.
• 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.
Using the Form wizard if
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 OF 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 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
➢ When you finish defining how you want records grouped, click next>.
USE REPORT WIZARD
➢ 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
Database management system

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (19)

Database Basics
Database BasicsDatabase Basics
Database Basics
 
Database fundamentals(database)
Database fundamentals(database)Database fundamentals(database)
Database fundamentals(database)
 
Database management system
Database management systemDatabase management system
Database management system
 
Mis chapter 7 database systems
Mis chapter 7 database systemsMis chapter 7 database systems
Mis chapter 7 database systems
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
 
Database systems introduction
Database systems introductionDatabase systems introduction
Database systems introduction
 
Mca ii-dbms- u-i-introductory concepts of dbms
Mca ii-dbms- u-i-introductory concepts of dbmsMca ii-dbms- u-i-introductory concepts of dbms
Mca ii-dbms- u-i-introductory concepts of dbms
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
Key database terms
Key database termsKey database terms
Key database terms
 
Info systems databases
Info systems databasesInfo systems databases
Info systems databases
 
Introduction to databases
Introduction to databasesIntroduction to databases
Introduction to databases
 
Database systems
Database systemsDatabase systems
Database systems
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Types of databases
Types of databasesTypes of databases
Types of databases
 
Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02Fundamentals of Database ppt ch02
Fundamentals of Database ppt ch02
 
Dbms sql-final
Dbms  sql-finalDbms  sql-final
Dbms sql-final
 
Database introduction
Database introductionDatabase introduction
Database introduction
 
DBMS an Example
DBMS an ExampleDBMS an Example
DBMS an Example
 
Rdbms
RdbmsRdbms
Rdbms
 

Ähnlich wie Database management system

Operate Database Applicationitss level2.pptx
Operate Database Applicationitss level2.pptxOperate Database Applicationitss level2.pptx
Operate Database Applicationitss level2.pptxAbdirisakIman
 
Chapter 9 Microsoft Access Database.pptx
Chapter 9 Microsoft Access Database.pptxChapter 9 Microsoft Access Database.pptx
Chapter 9 Microsoft Access Database.pptxAbdullaahiHashiSabri
 
MIS-3rd Unit.pptx
MIS-3rd Unit.pptxMIS-3rd Unit.pptx
MIS-3rd Unit.pptxSumit Kumar
 
database management system (DBMS)
database management system (DBMS)database management system (DBMS)
database management system (DBMS)BigyanDhital1
 
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.hetvii07HetviBhagat
 
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)07HetviBhagat
 
DATA RESOURCE MANAGEMENT
DATA RESOURCE MANAGEMENT DATA RESOURCE MANAGEMENT
DATA RESOURCE MANAGEMENT huma sh
 
Lec20.pptx introduction to data bases and information systems
Lec20.pptx introduction to data bases and information systemsLec20.pptx introduction to data bases and information systems
Lec20.pptx introduction to data bases and information systemssamiullahamjad06
 
Database Management System Part-1.pptx
Database Management System Part-1.pptxDatabase Management System Part-1.pptx
Database Management System Part-1.pptxArshveerSinghDhillon
 

Ähnlich wie Database management system (20)

Ms access
Ms accessMs access
Ms access
 
Operate Database Applicationitss level2.pptx
Operate Database Applicationitss level2.pptxOperate Database Applicationitss level2.pptx
Operate Database Applicationitss level2.pptx
 
MS-ACCESS.pptx
MS-ACCESS.pptxMS-ACCESS.pptx
MS-ACCESS.pptx
 
Chapter 9 Microsoft Access Database.pptx
Chapter 9 Microsoft Access Database.pptxChapter 9 Microsoft Access Database.pptx
Chapter 9 Microsoft Access Database.pptx
 
MIS-3rd Unit.pptx
MIS-3rd Unit.pptxMIS-3rd Unit.pptx
MIS-3rd Unit.pptx
 
MIS-3rd Unit.pptx
MIS-3rd Unit.pptxMIS-3rd Unit.pptx
MIS-3rd Unit.pptx
 
Database
DatabaseDatabase
Database
 
6.2 software
6.2 software6.2 software
6.2 software
 
MS Access Intro
MS Access IntroMS Access Intro
MS Access Intro
 
database management system (DBMS)
database management system (DBMS)database management system (DBMS)
database management system (DBMS)
 
MS Access.pptx
MS Access.pptxMS Access.pptx
MS Access.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)
 
Introduction to ms access database
Introduction to ms access databaseIntroduction to ms access database
Introduction to ms access database
 
RDMS AND SQL
RDMS AND SQLRDMS AND SQL
RDMS AND SQL
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
DATA RESOURCE MANAGEMENT
DATA RESOURCE MANAGEMENT DATA RESOURCE MANAGEMENT
DATA RESOURCE MANAGEMENT
 
Lec20.pptx introduction to data bases and information systems
Lec20.pptx introduction to data bases and information systemsLec20.pptx introduction to data bases and information systems
Lec20.pptx introduction to data bases and information systems
 
Ms access
Ms accessMs access
Ms access
 
Database Management System Part-1.pptx
Database Management System Part-1.pptxDatabase Management System Part-1.pptx
Database Management System Part-1.pptx
 

Kürzlich hochgeladen

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Kürzlich hochgeladen (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Database management system

  • 1. Database Management System PRESENTED BY: SABIN DHAKAL PRESENTED TO: ROSHAN MAHARJAN
  • 2. Main Points to Remember ❖ Define Database Management System and Advantage and Disadvantage of DBMS ❖ Define MS-ACCESS and describe the four basic objects of MS-ACCESS. ❖ Explain how to create table, query, form and report in MS-ACCESS. ❖ Explain how to locate specific record in MS-ACCESS. ❖ Define relationship and explain the different types of relationships;
  • 3. 1. Data is the plural form of the word “datum” which refers to a collection of raw facts. 2. Data are the raw materials of information processing. 3. They are measured, collected and reported, and analyzed, whereupon it can be visualized using graphs, images or other analysis tools. Information 1. It is the resultant output after processing of data which is the most critical resource of the information. 2. Data becomes information when you understand what it means. DATA
  • 4. 1. Processing is a series of actions or operations that converts some input into useful output. 2. Data processing is defined as the processing data to make it more usable and meaningful , thus transforming it into information. PROCESSING
  • 5. 1. Electronic database refers to an organized collection of data stored on a computer in such a way that its content can easily be accessed, updated and queried upon with the help of software program. 2. In other words, A collection of systematically organized inter-related data is called a database. 3. Database is used to store, organize and retrieve data. 4. The advantage of database is the limitless capacity to store data, and speed , accuracy , and efficiency with which you can retrieve information. ELECTRONIC DATABASE
  • 6. A database table is composed of records and fields that hold data, Tables are also called datasheets. Tables are the building block of database. Table is a set of information about a particular object. Each table in a database holds data about a different, but related, subject. Table stores a large volume of data into rows and column format. A single table is used to store data of a specific purpose or subject such as telephone directory, book records in library etc. Since entire data is managed and kept in a table for the future retrieval process it is also called the primary object of database. Table stores large volume of data into rows called records and column called field. When fields and records are combined forms a complete table. TABLE: THE BUILDING BLOCKS OF DATABASE Emp No. Dept No. Address E01 D01 New Road E02 D02 Tokha Road E03 D03 Surket Road
  • 7. How DBMS Works? • DBMS provides a centralized control over data- A database system maintains a centralized database, i.e. all the data is kept at one place and any application that requires the data can access it from this central location. Any application can share data from the central location. Though sometimes it may be necessary to duplicate the data, the redundancy can be controlled as the DBMS is aware of the multiple copies and update them regularly.
  • 8. Features of DBMS ❖Large volume of data can be stored and updated easily. ❖Provides data integrity and security. ❖Easy in data administration or data management. ❖Provides the data sharing facility. ❖Reduces the data redundancy (duplication of data). ❖ Provides concurrent access, recovers the data from the crashes. ❖Supports centralized control
  • 9. Database Management System • Database management system (DBMS) is a computerized system that stores data, processes them and provides information in an organized form. • DBMS basically deals with the creation of database, its management and retrieval process. Creating, modifying, updating, appending, organizing, sorting, removing, and retrieving are the major tasks performed easily, efficiently and accurately using Database management system. • Some of the popular DBMS software are MS-Access, Oracle, MS-SQL Server, MySQL, PostgreSQL etc.
  • 10. ADVANTAGES OF DATABASE SYSTEMS • It reduces the data redundancy on the file. Redundant data are repeated and necessary data exist on the file. So, we have to reduce it to save the memory of the computer. • Data stored on the DBMS are highly consistent. They are constant in nature. • It is possible to share data using DBMS. Various users are allowed to share data according to their needs using the same database file. • It is possible to apply the centralized security system on DBMS. • It has a very high data integrity. We can retrieve data on complete form using DBMS DISADVANTAGES OF DATABASE SYSTEMS • High initial investment in hardware, software, and training. • Overhead for providing security, recovery, and integrity functions. • Cost for the hardware-upgrade to allow for the extensive programs and the workspaces required for their execution and storage. • Cost for the maintenance of the software which remains forever. • An additional cost is required to transfer from a traditionally separate application environment to an interpreted one. • High cost for backup and recovery
  • 11. Relational Database Management System (RDBMS) • Relational Database Management System is defined as a method of viewing information for several, separated database that relate one to another through keywords or values. • RDBMS are database management systems that maintain data records and indices in tables. • Relationships may be created and maintained across and among the data and tables. • MS-ACCESS and Oracle are the best examples of RDBMS software
  • 12. Microsoft Access • Microsoft Access is a Relational Database Management System (RDBMS) that helps us to store information for reference, reporting, and analysis. • It is a powerful GUI based RDBMS which provides numerous easy-to-use features, including the ability to quickly locate information , add delete , modify records , sort records, and produce professional – looking reports. • Access was developed by Microsoft Company. This software is distributed along with the Microsoft Office application package. Microsoft Access 2010 is the latest version available in the market. • Advantage • Duplicate data is minimized. • Information is more accurate, reliable and consistent. • Information can be shared among several users. • Information retrieval is faster and easier.
  • 13. HOW TO OPEN MICROSOFT ACCESS Click on Start. Select All Programs. Choose Microsoft Office folder. Now choose Microsoft Access 2013 from the list. We will get windows with various choices. Select blank database and type the required database file name on the file name box. Finally click on Create button.
  • 14. Working with your Access Environment • Ribbons: The ribbon is the primary replacement for menus and toolbars and provides the main command interface in Access. ... When you open a database, the ribbon appears at the top of the main Access window, where it displays the commands in the active command tab. The ribbon contains a series of command tabs that contain commands. • Quick Access Toolbar : The Quick Access Toolbar, is located above the Ribbon (top-left) and provides access to commonly used features and commands, such as Save and Undo/Redo. Both the Ribbon and the Quick Access Toolbar can be customized
  • 15. • Backstage view: The Backstage view is the collection of commands that you see on the File tab on the ribbon. The Navigation Pane is the pane on the left side of the Access program window that lets you work with database objects. • Navigation Pane: To display the Navigation Pane in an Access web app, on the Home tab, in the Show group, click the Navigation Pane toggle button. along the top of the Navigation Pane, click the Navigation Pane toggle button, or press F11.
  • 16. Working with Objects • Database objects are components that save and query information. A database contains objects that are used to store and display large ,relational data. The most frequently used objects are the table, query, form and report. • Basic objects of MS-Access are: 1. Tables 2. Queries 3. Forms 4. Reports 5. Macros 6. Modules
  • 17. Basic objects of RDBMS ❖ Table 1. It is a collection of various records. 2. A table is a feature, comprising of parallel columns and rows, which is used to store, organize, and view data on a particular topic. 3. A single database may contain numerous tables containing information about related topics, such as customer addresses, product prices, and other information. 4. Tables are the primary building block of database. 5. All data are stored and managed in a table. Every table in a database focuses on one specific subject. Table stores large volume of data into rows and column.
  • 18. ❖ Forms • A form is an object of database which shows only the information you want to see. • Forms are the graphical interface used to enter data into the tables or multiple linked tables. • Forms are also used to display the information in specific manner, as well as it permits user to add, modify and delete data in a table. • Primarily, fields in the table or query are made available to place in the forms that we create. • A form is used to view data in a database, enter new data into the database, or edit data. • We can create from in database by using Design View , Auto form tabular , Auto form Columnar, Form Wizard, etc.
  • 19. ❖ Report 1. A report is used to show and print selected information from a table in a customized manner. 2. A report differs from a form because it does not allow you to make any modifications or edits to the actual records within the table or tables. 3. Reports are the presentation of information in desired format. Reports are generally created for the printing purpose of any desired information. 4. With Access, we can create reports of any table or query. For example, report card of your final examination.
  • 20. ❖ Query: 1. A query is a question that you ask about the data in your table(s). 2. Query is also used to perform various mathematical calculation is the database records. 3. A query is simply the question that we ask about the data stored in the table. 4. Query is also used to perform various actions on the data. For example, "Show the names of students who have scored greater than or equal to 80 marks in science." "Update the salary of employees by 10%."
  • 21. • Macro 1. This object is a structured definition of one or more actions that you want Access to perform in response to a defined event. An Access Macro is a script for doing some job. For example, to create a button which opens a report, you could use a macro which will fire Open Report action. 2. You can include simple conditions in macros to specify when one or more actions in the macro should be performed or skipped. 3. You can use macros to open and execute queries, to open tables, or to print or view reports. 4. You can also run other macros or Visual Basic procedures from within a macro. Data macros can be attached directly to table events such as inserting new records, editing existing records, or deleting records. Data macros in web apps can also be stand-alone objects that can be called from other data macros or macro objects.
  • 22. Module Module is an object in desktop databases containing custom procedures that you code using Visual Basic. Modules provide a more discrete flow of actions and allow you to trap errors. 1. Everything that can be done in a macro can also be done in a module, but you don't get the macro interface that prompts you what is needed for each action. 2. Modules are far more powerful, and are essential if you plan to write code for a multi-user environment, because macros cannot include error handling. 3. Modules can be standalone objects containing functions that can be called from anywhere in your application, or they can be directly associated with a form or a report to respond to events on the associated form or report.
  • 24. 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 define each field to include in the table. The Table Design View window is divided into two panes: a. Field Grid Plane b. Field Properties area
  • 25. 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 consists of letter, numbers ,spaces ,and special characteristics ,except a period, and exclamation point ,an accent (~) and brackets ([]).You cannot start a field name.
  • 26. Data Type • Data type is a field property that specifies and limits what kind of data can be entered into that field. • For example, values that are stored in a text field can contain only letters, numbers, and a limited set of punctuation characters. • You can use the data type property to specify the type of data stored in a table field such as text for name field, number for class field, date and time for DOB field, etc
  • 27. Data Type Description Maximum Data / Space Default Field Size Text It is used for text or combinations of text and numbers as well as numbers don’t require calculations, such as phone numbers. Up to 255 Characters 50 (2003 Version) 255 (2007/10 Version) Memo It is used for lengthy text and numbers. Up to 65,536 Characters - Number It is used for data to be included in mathematical calculations. 1,2,4 or 8 Bytes Long Integer Byte It stores numbers from 0 to 255 without decimals. 1 byte - Integer It stores numbers from -32768 to +32768 without decimals. 2 byte - Long Integer It stores numbers from -2147483648 to +2147483647 without decimals. 4 bytes - Date/Time It is used for dates and time data. 8 Bytes -
  • 28. Default Field Size Currency It is used for currency values. 8 Bytes Long Integer Auto Number It is used for unique sequential (incrementing by 1). 4 Bytes - Yes/No It is used for data that can be only one of two possible values such as Yes/No. 1 Bit - OLE Object It is used for OLE objects (such as MSWord documents, MS Excel spreadsheets, pictures, sounds). 1 GB - Hyperlink It is used for hyperlinks. Up to 64000 characters - Attachments You can attach data from other programs to this type of field, but you cannot type or otherwise enter text or numeric data. - - Lookup Wizard It is used to create a field that allows you to choose a value from another 4 Bytes -
  • 29. Field Description • You can enter the description of each field in the description column. • It helps you to remember the use and purpose of a particular field. • This is an optional part in a database. It is displayed in the status bar when you select this field on a form. • It helps you to remember the use and purpose of a particular field which is useful in large projects where several people may be working the same database.
  • 30. Field Properties Area • Field properties are the attribute that describe and define a field. • Field properties are the characteristics which are related to each field. After creating a field and setting its data type, we can set additional field properties. • For example, we can control the size of a text field by setting its field size property. The field size property also determines how much disk space does each number field value require. Depending on the field size, the number can use exactly 1, 2, 4, 8, 12, or 16 bytes
  • 31. Field Property Description Field Size Species the maximum no. of characters allowed in the field Format Species 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 Text Align Aligns the data in a field the left, Centre, right, right or distributed Default value Automatically enters the specified value in the field Validation rule Specifies an expression that checks for invalid data
  • 32. Field Size Properties • You can use the Field Size property to set the maximum size for data stored in the field that is set to the Text or Number data type. • For Text data, the amount of data that you can store can be determined by the number of characters you wish to store on it. Maximum is 255 characters. • For numeric data, the field size can be set depending upon the type and range of value you wish to store. Below table explains about the numeric data range and storage. Field Size Setting Range of Values Decimal Places Storage Size (in Bytes) Byte 0 to 255 None 1 Integer -32768 to 32767 None 2 Long Integer 2147483648 to +2147483647 None 4 Single -3.4 x 10^38 to 3.4 x 10^38 7 4 Double -1.797 x 10^308 to 1.797x10^308 15 8
  • 33. Format ➢ It is basically used to specify the layout for a field. Format field property allows you to display data in a format different from the way it is actually stored in a table. It is also known as display layout for a field. The format property uses different settings for different data types. ❖ For Text and Memo Data Types Symbol Effect @ Indicates a character or space is required & Indicates a character or space is optional < Converts all character to lowercase > Converts all character to uppercase
  • 34. Numeric and Currency Fields You can format the number and currency data with predefined formats. You can choose the pre- defined formats and many other symbols for creating your own customized numeric and currency data format given below: Format Setting Meaning Data Entered Data Displayed General Number It displays number as entered without changes. 45689.123 −33615.234 45689.123 −33615.234 Currency It displays the number with currency symbol with separator. 255.45 $255.45 Euro It displays number with Euro currency symbol and separator. 6455 €6,455.00 Fixed It displays at least one digit 3456.789 3456.79 Standard It displays thousand separator. 456789.12 456,789.12 Percent It displays the value multiplied by 100 with added % sign. .22 22.00% Scientific It uses standard scientific notation with exponents. 2345.678 2.35E +03
  • 35. For Date and Time Data Types Setting Description/Example General Date Here, if the value is date only, no time is displayed and if the value is time only, no date is displayed. This setting is the combination of the short date and long time. eg. 6/19/2012 (MM/DD/YYYY) and 7:34:23 PM (HH:MM:SS) Long Date Long date setting, e.g. Monday, August 25, 2012 Medium Date Medium date setting, e.g. 26-Jun-07 (DD-MM-YY) Short Date Short date setting, e.g. 9/4/2012 (MM/DD-YYYY) Long Time Long time setting, eg. 7:30:20 PM (HH:MM:SS) Medium Time Medium time setting, eg. 7:30 PM (HH:MM) Short Time Short time setting, eg. 17:34, 7:15 (HH:MM)
  • 36. For Format String Format String Data Entered Data Displayed $#,##0.00 1234.56 $1,234.56 $#,##0.00 0 $0.00 ##.00% 5.678 567.80% ##.00% 0 .00 For Logical (Yes/No) Data Types: A logical format allows only two possible values. The default setting is Yes/No. You can use format as Yes/No or ON/OFF or True/False which displays with checkbox. A checked checkbox represents Yes or True or On. An unchecked checkbox represents No or False or Off.
  • 37. Input Mask • Input Mask is a field property that determines what kind of data can be entered in the field how it looks and how can it be entered in a field. It is simply the control over the data entry. • The task of input mask are: 1. It helps to enter field values in a specified pattern. 2. It can fill in constant characters like dash (-), parenthesis ( ) and slash (/) and optionally store these characters as part of the field value as you do not have to enter these characters at the time of data entry. • Create your own (custom) Input Mask: Input mask wizard can be the easiest option for certain fields like, pin code, phone numbers, date and time. You can create your own input masks if you need to format other kinds of values. The rules for creating input masks are : 1. It contains three possible parts, separated by semicolons (;). 2. It uses special characters in a mask to impose limits on what can be entered in a field.
  • 38. Input Mask Characters • The input mask characters are used to indicate how to limit the data that gets entered in a field. The following input mask characters are allowed to use in the input mask. Character Description/Function 0 Number is entered and required (0-9), no plus or minus sign. 9 Number is entered and optional (0-9), no plus or minus sign. # Optional number or space, plus and minus sign is allowed. L Letter is entered and required (A-Z). ? Letter is entered and optional (A-Z). A Letter or number entered and required. a Letter or number entered and optional. & Any character or space required. C Any character or space optional
  • 39. Character Description/Function < Characters get converted to lowercase. > Characters get converted to uppercase. ! A mask that displays characters from right to left but characters are always entered left to right. The mask helps display the next character in it as constant; for example B appears as B. Password Creates a password entry text box. Any character typed in the text box is stored as the character but is displayed as an asterisk (*). ❖ Caption: Adding captions to fields helps both you and future database administrators to understand the design and content of your database. It is one of the most common filed properties of all data types. It is used to assign a descriptive name for a field. The maximum size for this is 2048 characters. If caption is not entered, field name is used for label for a field on a form.
  • 40. ❖ Default Value: 1. Default value field property displays the value automatically for the field when you add a new record to the table. Default value can be changed during the data entry time. 2. For example, if you want to add records of class 10 students, in the class field you can set the default value as 10 so that you do not have to enter the class each time you enter the records. ❖ Validation Rule: 1. The process of examining the data that has been entered against conditions that you have provided is called validation. 2. A validation rule is the condition that should be satisfied by the data. 3. Access provides several ways to validate data, and you often use several of those techniques to define a validation rule.
  • 41. Validating Numbers Expression Example Description < <100 Entered value must be less than 100. > >50 Entered value must be less than 50. <> <>0 Entered value must not be equal to 0. <= <=100 Entered value must be less than or equal to 100 >= >=50 Entered value must be less than or equal to 50. = =10 Entered value must be equal to 10. Between ... and .. Between 0 and 100 Entered value must be within the range of 0 to 100.
  • 42. Validation expression for Dates Example Description < # 1/30/2012 # Entered date must be before January 30, 2012. > # 1/30/2010 5:30 PM # Entered date must be after January 30, 2010 and after 5:30 PM. <= #1/30/2012 # Entered date must be before or on January 30, 2012. >= # 1/30/2010 Entered date must be after or on January 30, 2010. >Date() Entered date must be after the current date. < Date() Entered date must be before the current date. > Now() Entered date must be today after the current time or any other day in future. < Now() Entered date must be today before the current time or any other day in past.
  • 43. Validating Text Expression Description Like "B*" Here * represents zero or more characters. It checks that the value starts with B (or b), followed by zero or more characters. Like "*up" It checks whether text ends with characters "up". Like "?????UP" Here? represents one character. It accepts 7 characters and ends with UP. Like "####CSX Here # also represents one character but it is number. It accepts 7 characters and ends with CSX and preceded by five numbers. Like "[BO]????" It accepts 5 characters and first character is either B or O. Like "[A-Z] [AZ] [A-Z] [A-Z] " It accepts four characters (Only letters). [A-Z] represents characters ranges from A to Z Validation text: It is a field property which displays the error message when the user fails to use the validation rule. If the data entered is invalid according to the specified validation rule it displays the validation text.
  • 44. ✓ Required: Required property is used to specify whether a value is required in a field or not. So, Yes and No are the options for required property. If this property is set to Yes for a field, the field must receive a value during data entry. If this property is set to No for a field, the field can be left blank without any value during data entry. ✓ Allow Zero Length: Allow zero length property is only for the text and memo data types. This property works with the required property. If you set the required property to ‘Yes’ and allow zero length to ‘No’, data must be entered during data entry. ✓ Indexed : This property speeds up searching and sorting of records based on a field. For example, if you search for specific student name in the first name field, you can create an index for this field to speed up search for the specific name. Default indexed property is set as No. It also uses other two settings.
  • 45. Primary Key ▪ Primary Key is a special field or group of fields in the table that uniquely identifies each record from the database. ▪ The primary key does not accept duplicate value for a field and it does not allow a user to leave the field blank or null. ▪ The primary key is an identifier such as a student ID, a Product code, Exam roll no. etc. Hence, primary key is unique to each record. • Importance of Primary Key 1. To identify each record of a table uniquely. 2. To reduce and control duplication of the record in a table. 3. To set the relationship between tables.
  • 46. Setting the Primary Key • Follow the below steps to create a primary key field: Step 1: Open the table in Design View. Step 2:Click on the field in which you want to apply primary key. Step 3: Click on Design tab. Step 4: Click on Primary Key button from Tools group. A key icon will be displayed on the left side of the primary key field
  • 47. 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 view. You can make changes and, at the same time, see how the design will finally look. • In layout view, Access automatically adds a unique Auto number 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.
  • 48. 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.
  • 49. 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.
  • 50. One-to-Many [1:m] • 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.
  • 51. 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.
  • 52. 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.
  • 53. 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.
  • 54.
  • 55. 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.
  • 56. Viewing relationships • Click the Database Tools tab. • Click Relationships. • Double-click a relationship line to display and/or change the relationship
  • 57. 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.
  • 58. 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.
  • 59. Understanding Referential Integrity • 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 .
  • 60. 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.
  • 61. 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
  • 62. 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.
  • 63. 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.
  • 64. 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.
  • 65. • 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
  • 66. 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. ▪ Query is an object of database that is used to view, retrieve, change and analyze records from a table or multiple linked tables based on specified condition. ▪ Some other reasons for using queries: ▪ Find specific quickly data by filtering on specific criteria(conditions) 1. Calculate or summarize data 2. Automate data management tasks, such as a reviewing the most current data on a recurring basis.
  • 67. 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: I. Append Query- takes the results of a query and “appends” (or adds) theme to an existing table. II. Delete Query- deletes all records in an underlying table from the set results of the query. III. Make Table Query- as the name suggests, it creates a table based on the set results of a query. IV. 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.
  • 68. 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 record source. • 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.
  • 69. Using the simple query wizard
  • 70. 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.
  • 71. Using query in design view i. Select the Create tab on the Ribbon, and locate the Queries group. ii. Click the Query Design command. iii. 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. iv. Click Add, then click Close. v. 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 vi. Set the search criteria by clicking the cell in the Criteria: row of each field you want to filter. vii. After you have set your criteria, run the query by clicking the Run command on the Design tab. viii. 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.
  • 72. Using Query in Design View
  • 73. 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.
  • 74. 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: Wildcard Description ? Replaces a single character * Replaces a number of characters # Replaces a single desert To specify a wildcard pattern, enter the pattern in the Criteria row of the field column in which you want to search.
  • 75. 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.
  • 76. 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
  • 77. 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”
  • 78. Comparison operator Operator Description Example BETWEEN... Between two BETWEEN 100 AND values, inclusive AND 600 IN Included in a set of values IN (“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 “ *”
  • 79. 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*”
  • 80. 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.
  • 81. Performing calculations in a Query • 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 Calculates 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.
  • 82. 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.
  • 83. 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.
  • 84. 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.
  • 85. 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. a. Click the Create tab. b. Click Query Design. c. Add your tables and fields to the query grid. d. Click Make Table. e. Type a name for your new table. f. 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. g. Click Run to execute the action query. h. Click Yes to create your new table.
  • 87. Crosstab query with the query wizard ✓ Crosstab queries calculate a sum, average, count, or other type of aggregate function to calculate data that is grouped by two types of information one down the left side of the datasheet and another across the top i. Click the Create tab. ii. Click Query Wizard. iii. In the New Query popup window, click Crosstab Query Wizard iv. Click OK • In the Crosstab Query Wizard, click Queries. v. Select a query and click Next. vi. Select one or more columns to act as row headings, and click Next. vii. Select one column to act as the new column headings, and click Next. viii. Select the column to summarize. ix. Select the calculation type to use, and Click Next. x. Type a name for your query, and click finish. xi. Select design View. xii. In the query Column Headings property field, type a fixed set of headings
  • 88. Crosstab query with the query wizard
  • 89. 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: 1. The Form Wizard asks some questions and then creates an attractive form based on your answer. 2. The Form Design and Blank Form buttons let you start with a blank form and build from the ground up. 3. The Form tools make attractive forms with a click of the mouse
  • 90. 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
  • 91. Using the Form wizard • 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.
  • 92. Using the Form wizard if • Click the Create tab on Ribbon. Several bottom groups appear on the Ribbon, including the Forms Group. • Open your database file. • Click the Form Wizard button. The form Wizard appears. • Using the Table/Queries drop-down menu, select the source of the form’s fields. 1. Click the down arrow to list the database’s tables and queries 2. 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. • 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.
  • 93. Using the Form wizard if
  • 94. 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.
  • 95. USE OF 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.
  • 96. 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 ➢ When you finish defining how you want records grouped, click next>.
  • 97. USE REPORT WIZARD ➢ 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