Presentation is loading. Please wait.

Presentation is loading. Please wait.

A structured collection of related data

Similar presentations


Presentation on theme: "A structured collection of related data"— Presentation transcript:

1 A structured collection of related data
What is database ? A database is a collection of information that's related to a particular subject or purpose. A structured collection of related data

2 Some Examples Telephone directory Patients records in a hospital

3 Examples contd…. Library Catalog University Class Schedule -Timetable
Books Available. Members Information. Which Books with whom. University Class Schedule -Timetable Students have many professors. Professors have many students. Classes can be held in many classrooms.

4 Database Purpose Store Sort DATA Retrieve

5 Data vs. Information Data – a collection of facts made up of text, numbers and dates: Ravi ,50,000 Information - the meaning given to data in the way it is interpreted: Mr. Ravi is a sales person whose annual salary is Rs.3,50,000

6 Without aid of computer
You're having to coordinate and organize yourself If an STD-code number changes, you might have to update that information in all places More than 1 person needs to enter data at the same time You need to give certain people access to one view of the data and other people to a different view Contd…

7 Querying is difficult Select all the people with brown hair, high blood pressure, and younger than 37 Match all survey information with voting history for 400,000 people Show all the purchases on a given day and add on personal information for any people where we have the information

8 If your database is stored on a computer
Any change in a particular data is automatically updated wherever you use it in the database. Querying very easy define relationships, data types and many more….

9 Data Integrity is maintained
Data must be accurate. Data is RELATED to other data in your database (e.g., library patron is related to the book(s) that s/he has checked out). Maintaining the INTEGRITY of the relationship between different pieces of data is very important.

10 Steps involved Determine the purpose of your database
This will help you decide what data you want your access database to store. Determine the fields that you will need Decide what specific pieces of information you want to store. Group related fields together Once you have a clear purpose for your database and know what pieces of information you want to track. Determine Properties for each field Data Type text, number, yes/no, memo, date/time, currency Field Characteristics size limit, required, case specifications, entry specifications Determine Keys and Relationships Look at each table and decide how the data in one table is related to the data in other tables.

11 Basic Database Concepts
Name: Ravi Department: Garden Tel: Table A set of related records Record Name: Ravi Department: Garden Tel: A collection of data about an individual item Field Name: Ravi A single item of data common to all records

12 Tables to Store and manage your data How data is organized in tables?
A table is a collection of data about a specific topic. Tables organize data into columns (called fields) and rows (called records).

13 Data types Data type for data integrity (field data type: A characteristic of a field that determines what kind of data it can store. For example, a field whose data type is Text can store data consisting of either text or number characters, but a Number field can only store numerical data. Applicable data types Text Byte Integer Long Integer Single Double Decimal

14

15 Plants Classification
Family-A Genus-1 Genus-2

16 Scenario: Host Family-1 Fungi-2 Fungi-1 Fungi-3 Host-B Fungi-4 Host-A
Host-C

17 Fungi in the order - ‘Meliolales’ Information to be stored
Fungus Family Genus Species Author Citation Description Host Details Host Genus Host Species Host Family

18 The single table database

19 Problems in Single Table Databases
Data redundancy is more (eats up more memory) Need to update one by one if a data is to be corrected (no automatic updating) Chance of errors is more Data Entry is pain staking

20 Reducing Data redundancy
Analyzing the table find out redundant (repeating) split the table accordingly Using a separate table for each topic means that you store that data only once. This results in a more efficient database and fewer data-entry errors.

21 family, genus, host_genus, host_family

22 Normalization Normalization is a process designed to achieve three ends ... eliminate redundant information, increase data integrity and make systems more efficient.

23 After Normalization Primary Key Primary Key Primary Key Foreign Key

24 Similarly Host Details also splitted
Foreign Key Primary Key Primary Key

25 Primary Keys & Foreign keys
Primary Key is a variable/attribute that uniquely identifies each row Foreign key is a primary key from another table in your table.( When two tables are related you need a way to show that they are related.)

26 Relationships Relationships ‘connect’ tables. In other words they link the data in one table to the data in another. Relationships are established using a common field that is present in both the tables to be related.

27 Relationships

28 Types of Relations In a one-to-one relationship each record in one table has at most one related record in another table. This type of relationship is rare. A one-to-many relationship is by far the most common. Here one record in one table can be related to many records in another table. A many-to-many relationship means that for each record in one table there can be many records in another table and for each record in the second table there can be many in the first.

29 Referential integrity
Referential integrity is to ensure that relationships between records in related tables are valid and that you don't accidentally delete or change related data. The referential integrity rule says that the database must not contain any unmatched foreign key values. What this is saying is that a record cannot be added to a table with a foreign key unless the referenced value exists in the primary table.

30 Hands-on Session

31 New Database

32

33 Creating Tables in Design View
Field Name - can not exceed 64 characters in length and may include spaces. Data Types Text, Memo, Number, Date/Time, Currency, AutoNumber, Yes/No OLE Object – An OLE (Object Linking and Embedding) object is a sound, picture, or other object such as a Word document or Excel spreadsheet that is created in another program Hyperlink – DisplayText#Address#SubAddress#ScreenTip. Internet: CS287 Web# Database: #c:\My Documents\database.mdb#MyTable Description Field Properties

34

35 Field Properties – Filed Size

36 Queries Queries select records from one or more tables
They can be viewed, analyzed, and sorted on a common datasheet Resulting record set is called a dynaset (short for dynamic subset) Dynaset can save for future use

37 Queries examples Basic Queries Get Fungi list in Family-1
Get Fungi list under Genus-1 Host Related Queries Get Fungi list under Host Family-1 Get Fungi list under Host-1

38 What is a Form? It is simply an alternative way to enter data into a database table It also provides an alternative way of displaying data. Rather than displaying the data in datasheet view, a Form can be used to make data entry easier.

39 Creating Form by Using Wizard (1/4)
Create form by using wizard  Tables/Queries  Select table/query  Select the fields  Next 

40 Creating Form by Using Wizard (2/4)
Select the layout Columnar Justified Tabular Datasheet  Next 

41 Creating Form by Using Wizard (3/4)
Select a visual style  Next 

42 Creating Form by Using Wizard (4/4)
Name the form  Open the form to view or enter information Or Modify the form's design  Finish 

43 Create Forms in Design View (1/2)
To create a form from scratch New  Design View  Select table/query  View|Toolbox

44 Create Forms in Design View (2/2)
Add controls to the form Clicking and dragging the field names  Creates a text box and label

45 Adding Records Using Forms
Input data  filling out the fields of the form Use Tab to move from field to field Create a new record Press Tab after the last field of the last record Click the New Record Records are automatically saved

46 Qualities of a Good Database Design
Reflects real-world structure of the problem Can represent all expected data over time Avoids redundant storage of data items Provides efficient access to data Supports the maintenance of data integrity over time Clean, consistent, and easy to understand

47 Conclusion Access is good for Beginners
Small to medium size DBs < 200mbs 1 to 2 concurrent users Windows only teams (for the most part) Front ends to more complicated DBs


Download ppt "A structured collection of related data"

Similar presentations


Ads by Google