Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
23 views

Database Operations

1. A database is an organized collection of related data that allows users to efficiently retrieve desired information. A database management system (DBMS) is used to create and maintain databases and perform operations like adding, updating, and deleting data. 2. A relational database organizes data into tables that can be linked together through relationships. Each table contains rows and columns, and data integrity ensures completeness, accuracy, and consistency of data across tables. 3. Microsoft Access is a popular DBMS software that allows users to create computerized databases with tables, queries, forms, and reports. Users can build databases from scratch or use templates. Tables are the fundamental data structure, containing fields (columns) and records (

Uploaded by

Opa Kop
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Database Operations

1. A database is an organized collection of related data that allows users to efficiently retrieve desired information. A database management system (DBMS) is used to create and maintain databases and perform operations like adding, updating, and deleting data. 2. A relational database organizes data into tables that can be linked together through relationships. Each table contains rows and columns, and data integrity ensures completeness, accuracy, and consistency of data across tables. 3. Microsoft Access is a popular DBMS software that allows users to create computerized databases with tables, queries, forms, and reports. Users can build databases from scratch or use templates. Tables are the fundamental data structure, containing fields (columns) and records (

Uploaded by

Opa Kop
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Topic : Database Operations

M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Introduction to Database

About Data

1. The term data can be defined as set of isolated and unrelated raw facts with an
implicit meaning.
2. Data can be anything such as name of person, a number, images, sound etc.

About Database

1. A database is an organized collection of related data from which user can efficiently
retrieve the desired information.
2. Traditional databases are organized by fields, records and files.
3. A field is a single piece of information.
4. A record is one complete set of fields and a file is a collection of records.
5. In addition to the storage and retrieval of data, certain other operations can be
performed on a database and the operations include addition, alteration, updating
and deletion of data.
6. It is back-end of an application.

About Database Management System (DBMS)

1. A Database Management System (DBMS) is an integrated set of programs used to


create and maintain a database.
2. The operations such as adding, updating and deleting data on a database are
performed using Database Management System (DBMS).
3. The main objective of DBMS is to provide a convenient and effective method of
defining, storing, retrieving and manipulating data contained in the database.
4. The database and the DBMS software are collectively known as database system.
5. Database Management Systems (DBMSs) are especially designed for software
applications that interact with the user and other applications.
6. Examples of DBMS are Microsoft Access, SQL Server, MySQL etc.

1
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Relational Database
1. A relational database is a collection of data items organized as a set of
formallydescribed tables from which data can be accessed or reassembled in
many different ways without having to reorganize the database tables.
2. The relational database was invented by E. F. Codd at IBM in 1970.
3. The standard user and application program interface to a relational database is
the structured query language (SQL).
4. SQL statements are used for both interactive queries for information from a
relational database and for gathering data for reports.
5. A relational database is a set of tables containing data fitted into predefined
categories.
6. Each table (which is sometimes called a relation) contains one or more data
categories in columns. Each row contains a unique instance of data for the
categories defined by the columns.
7. The following intuitive correspondence can be made
 A relation is a file.
 Each file contains only one record type.
 The records have no particular order.
 Every field is single-valued.
 The records have a unique identifying field or composite field, called the
primary key field.
 With a relational database, user can quickly compare information
because of the arrangement of data in columns.
 The relational database model takes advantage of this uniformity to build
completely new tables out of required information from existing tables.
 In other words, it uses the relationship of similar data to increase the
speed and versatility of the database.

Fig : Relational Database

2
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Integrity

1. Data integrity refers to the overall completeness, accuracy and consistency of


data.
2. The concept of data integrity ensures that all data in a database can be traced
and connected to other data which ensures that the data is recoverable and
searchable.

Fig : Example of integrity

Types of Integrity
1. There are four types of Integrity
 Entity Integrity
 Referential Integrity
 Domain Integrity
Entity Integrity
 The Entity Integrity states that in a base relation, primary key column values
cannot be null. (Null values are defined as "empty or containing no values").
 A primary key is a minimal identifier that is used to identify columns
uniquely.
 A DBMS product such as Microsoft Access automatically enforces entity
integrity by prohibiting null values in the primary key fields.

Referential Integrity

1. The referential integrity states that, if R2 (Child table) includes a foreign key FK
matching the primary key PK of some R1 (Parent table) then every value of FK in
R2 must
 be equal to the value of PK in some rows of R1.
 be wholly null, i.e. each column in that FK must be null.
2. For example, when adding a new row to a table containing FK, the table
containing the referenced PK must have matching values.

3
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Domain Integrity

1. Domain integrity states that the values in a table are legal according to the
physical and the logical domain definition.
2. For Instant explanation, the StudentID column domain might be
 Physical : data type "numeric" ; Length "4 characters"
 Logical : "The range of the number between 1000 and 4999"
3. Therefore, the field would only accept input of four-digit number between 1000
and 4999.

Fig : Types of Integrity

What is Microsoft Access?

1. Microsoft Access is a database software package.


2. A database is an organized collection of records. Example for paper database are
telephone and address book.
3. With MS-Access, user can create a computerized database. After creation of MS-
Access database, user can search it, manipulate it and extract information from it.

Working with MS- Access

1. Open Microsoft Access 2010, click on Sample Templates. The Northwind icon
appears in the center of the window.
2. Click the Northwind icon
3. Click the Browse button.
4. The File New Database dialog box appears.
5. Locate the folder in which user wants to save the Northwind database.
6. Click OK. The File New Database window closed.
7. Click Create. MS-Access Creates the Northwind database and opens it. It shows
the warning message to open the database in trusted location.

4
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

8. To enable database click the Enable content button.


9. MS-Access enables the content. If user enabling the Northwind database, the
Login dialog box appears.
10. Click Login. MS-Access opens the Northwind database.
11. The Navigation Pane
 The MS-Access database consists of the following objects
i. Tables
ii. Queries
iii. Forms
iv. Reports
v. Macros
vi. Modules
12. The Navigation pane displays these objects in a database.

Creation of Database
1. A blank database is a database nothing in it. User must create all the tables,
forms, reports, queries and so on.
2. If user cannot find a template that suits their needs, they can create a blank
database.
3. Creating tables is the first step in building a database. Follow these steps to
create a blank database
 Start MS-Access, click Blank Database.
 Type the database name in the File Name field. MS-Access will
automatically append .accdb to the name.
 Click the Browse button.
 The File New Database window appears.
 Locate the folder in where user wants to store the database.
 Click OK, then click Create button.

Creation of Tables

1. Tables are the foundation of an MS-Access database.


2. MS-Access stores data in tables. A table is a set of columns and rows. Each
column is called field and each row is called record.
3. Each field must be given a name and no two fields can have the same name.
4. Each value in a field represents a single category of data.
5. Each row is called record.
6. Follow the steps to add fields to a table
 Click in the 'Click to Add' text box, it shows drop down list, select any data
type from the list.

5
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

 Type the nextfield name, MS-Access creates the field. User can continue
this process until fields in the table is to be created.
 Press Enter without entering a field name to end their entries.

Fig : Fields in table

7. Follow the steps to name and save a table


 Click the Save button on the Quick Access toolbar.
 The SaveAs dialog box appears.
 Type the name of the table.
 Then click OK.
8. Follow the steps to use Design view to create a new table
 Activate the Create tab.
 Click Table Design in the Tables group. MS-Access changes to Design view
and the Table Tools become available.

Fig : Table using design view

9. Type the first field name in the Field Name field.


10. Press the Tab key.
11. Click the down-arrow that appears when user click in the Data Type field and
then select a data type.
12. Click Primary Key option if the created column is primary key. A small key
appears next to the field name.

6
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Fig : Primary Key

Manipulating Table Structure

1. After creation of MS-Access table user can modify it, enter data into it manually
or import data from different application such as Excel.
2. To manipulate table structure user can
 Enter records into the table
 Modify a table
 Select columns and rows Delete a record
 Resize a column or row
 Import a table into MS-Access from Excel

Enter Records

1. To enter data into an AutoNumber field


2. Press the Tab key when the user makes an entry into another field in the record,
MS-Access will automatically make an entry into the AutoNumber field.
3. To enter data into fields that have a lookup list
 Click the down-arrow that appears when user click in the field.
 Click to select the entry that user want.
 Press the Tab key.
4. To enter data into Yes/No field
 Click the checkbox for Yes, then leave the checkbox for No.
5. To enter data into a date field
 Type the date. Or
6. Select the date from the calendar that appears to the left of the field.
7. Use the left-arrow at the top of the calendar to move to the previous month.
8. Use the right-arrow at the top of the calendar to move to the next month.
9. When user reaches the proper month, click the proper date.

Modify a Table

1. To insert column
 The insert option inserts a column before the selected column.

7
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

 Click the column head of the column before which user wants to insert a
column.
 Right-click the column head that user wants to insert a column. A menu
appears. Click Insert field.
2. To move a column
 User can use Move option to move a column from one place to another.
 Move mouse pointer over the horizontal line under the column label.
Users mouse pointer turns into a four sided arrow.
 Press left mouse button.
 Click and drag the field to the new location. A dark line appears at the new
location.
 Release left mouse button. MS-Access moves the column.
3. To delete columns
 The Delete option permanently deletes columns and all the data
contained in them. User cannot undo a column after deleting.
 Right-click the column head that user wants to delete a column. A menu
appears.
 Click Delete field.
 A warning dialog box will appear because delete option permanently
deletes the records. Click yes to delete.

Select Columns and Rows

 To perform any operation on a column or row user must select it.


 To select a column, click the column head.
 To select several columns, click a column head and then drag.
 To select a row, click the blank area to the left of the row.
 To select several rows, click the blank area to the left of a row and then drag.
 To select the entire table, click the Select All button in the upper-left corner of
the table.

Delete a Record

 To delete a record
 Select the record that user wants to delete.
 Activate the Home tab.
 Click Delete in the Records group. Or
 Click Delete option from right-click. A prompt appears.
 Click the Yes button.

8
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Resize a column or row


1. User can make the column or row as larger or smaller, if the information in a
column or row does not display or want to fit more information on the screen.
2. User can click and drag to increase or decrease column width or row height.
3. To resize a column or row
 Place the cursor over the line that separates two columns or two rows.
 The cursor turns into a double-sided arrow.
 Hold down the left mouse button and drag to increase or decrease width
of a column or the height of all of the rows.

Import a table into MS-Access from MS-Excel


1. User can import data from Excel into MS-Access by using the Excel Spreadsheet
Wizard.
2. To import data from Excel
 Open the Excel Spreadsheet Wizard
 Activate the External Data tab.
 Click the Excel button in the Import group. The Get External Data - Excel
Spreadsheet Wizard appears.
 Click the Browse button, the File Open window appears.
 Locate the spreadsheet that user want to import. Click the Open button.
The path to the selected file appears in the File Name field. Click OK. MS-
Access moves to the next page.

Fig : Import data from Excel

9
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Dropping
Delete a field in Datasheet view
1. In the Navigation Pane, double-click the table from which you want to delete the
field. The table is opened in Datasheet view.
2. Select the field (the column) that user want to delete. Press Delete Field option
from right click. Or
3. Or on the Fields tab, in the Add & Delete group, click Delete button. Then click
yes to delete the column permanently.

Delete a record in Datasheet view

1. Same method need to be followed to delete a record in datasheet view. Select the
record (the row) that user want to delete. Press Delete Record option from right
click. Or Press DELETE key. Then click yes to delete the record permanently.

Delete a table relationship

1. If the tables that participate in the table relationship are open, close them.
2. User cannot delete a table relationship between open tables.
3. Then right click over the table name in the navigation pane and click delete
option.
4. Click yes in the warning dialog box to delete a table.
5. Thus MS-Access deletes that table permanently.

Query

1. User can use a query to view a subset of data or to answer questions about user
data.
2. For example, if user wants to view a list of student names and email address, but
user do not want to see addresses and other data, user can create a query that
displays the student's first name, last name and email address only.

Open Tables or Queries in Query Design View


1. To open tables or queries in Query Design View
2. Activate the Create tab.
3. Click the Query Design button in the Queries group. The Show Table dialog box
appears.
4. Activate the Tables tab if user wants to base their query on tables, activate the
Queries tab if user want base their query on queries or activate the Both tab if
user want to base their query on both tables and queries.
5. Click to choose the table or query on which user want to base their query.
6. Click Add. The table appears in the window .

10
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

 Click to choose the next table or query on which user want to base their
query.
 Continue clicking tables or queries until user have all the tables and
queries their plan to use.

Display All Records and All Fields

1. In Query Design view, each table has an option that allows user to display all of
the fields and all of the records in a table.
2. This option appears on the field line on the drop-down menu as the table name
followed by a period and an asterisk (tablename.*).
3. To display all records and all fields.

Sort a Query

1. While creating a query, user can sort the rows that they retrieve in ascending or
descending order by choosing the option of their need on the Sort row in Query
Design view.
2. Follow the steps to perform a sort
3. Open a table or query in Query Design view.
4. Choose the field names to retrieve them.
5. Under the field click the down-arrow and then choose Ascending or Descending.
6. Click the Run button. MS-Access retrieves the selected columns and displays the
rows in the order that user specified.

Save a Query

1. User can save and return a saved query at any time.


2. To save a query
 Click the Save button on the Quick Access toolbar. Access saves the query
unless it saving for first time.
 Type the name of the query in Save As dialog box.
 Click OK. MS-Access saves the query. User can now MS-Access the query
by using the Navigation pane.

Data Entry Forms

1. MS-Access forms are much like paper forms. User can use them to enter, edit, or
display data.
2. They are based on tables. When using a form, user can choose the format, the
arrangement, and which fields to display.

11
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Using the Form Button


1. MS-Access can automatically create several types of forms.
2. For example, when user click the Form button on the Create tab, MS-Access
places all fields in the selected table on a form.
3. If the table has a one-to-many relationship with other table or query, MS-Access
creates a stacked form (the records are displayed in a column) for the primary
table and a datasheet for the related table.
4. If there are several tables with a one-to-many relationship, MS-Access does not
create the datasheet.
5. Follow the steps to create a form.
 Open the Navigation pane.
 Click the table or query on which user want to base their form.
 Activate the Create tab. Click Form in the Forms group. MS-Access creates
a form.
 User can use the Navigation bars to move through the records on a form.
6. To save a form
 Click the Save button on the Quick Access toolbar. MS-Access saves the
form unless user are saving for the first time. If user saving for the first
time, the Save As dialog box appears.
 Type the name user want to give the form. Click OK. MS-Access saves the
form. User can now access the form by using the Navigation pane.

Modify a Form

1. After user creates a form, it opens in Layout view, where user can modify it.
2. To change the size of a field
 Click a side of the field and drag to change the width of the field.
 Click the top or bottom of a field and drag to change the height of a field.
3. To move a datasheet
 Click the datasheet to select it.
 Click and drag the four-sided arrow in the upper-right corner to move the
datasheet.
4. To resize a datasheet
 Click the datasheet to select it.
 Click a side of the datasheet and drag to change the width.
 Click the top or bottom of the datasheet and drag to change the height.

12
Topic : Database Operations
M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Reports

1. Reports organize and summarize data for viewing online or for printing.
2. A detail report displays all of the selected records.

Creating Reports

1. User can include summary data such as totals, counts, and percentages in a detail
report.
2. A summary report does not list the selected records but instead summarizes the
data and presents totals, counts, percentages, or other summary data only.
3. MS-Access has several report generation tools that user can use to create both
detail and summary reports quickly.
4. Use of Report Button.
 The Report button creates a simple report that lists the records in the
selected table or query in a column format.
5. To use the Report button
 Open the Navigation pane.
 Click the table or query on which user want to base their report.
 Activate the Create tab.

Modify a Report

1. After creation of a report, user can modify it by adding groups or sorting, adding
fields, change labels and can perform many other tasks.
2. User can view a report in Report view, Layout view, design view and Print
Preview.
3. Change to Layout view
 Open the report.
 Activate the Home tab.
 Click the View button. A menu appears.
 Click Layout View. MS-Access changes to Layout view.

13

You might also like