Presentation is loading. Please wait.

Presentation is loading. Please wait.

3.5 Databases Relationships.

Similar presentations


Presentation on theme: "3.5 Databases Relationships."— Presentation transcript:

1 3.5 Databases Relationships

2 3.5 Databases 3.5.1 Understand the characteristics of structured and unstructured data 3.5.2 Understand that data can be decomposed and organised in a structured database [tables, records, fields, relationships, keys] 3.5.3 Understand the need for and be able to use SQL statements

3 Querying a database One of the main purposes of holding data in a database is to be able to answer queries For example: What is the school record for the Senior Boys 800m, and when was it set? Which new records have been set this year? Which records have not been broken since 2010?

4 Creating a query In Access, you can create a query involving data from one or more tables Once a query has been created, it can be saved and run whenever it is needed

5 How many records have not been broken since 2011?

6 Records set in 2011 or before

7 Comparison operators used in queries
Meaning Example < Less than DateRecordSet<2012 <= Less than or equal > Greater than >= = <>

8 Combining logical operators
The two logical operators AND and OR let you combine different criteria In Access, you can combine criteria by putting them on the same line This condition can be written: DateRecordSet<=2011 AND Record = “No”

9 Combining logical operators
How do you write criteria for a query which will list all the database records for Shot AND Hammer? (Be careful!) Write criteria which will list all the database records for which a new record was set in 2012 or 2013 in the EventCategory “Year 7 Boys”

10 Speeding up searches In a small database, the computer can find any record very quickly In a database containing millions of records, it can take much longer! One way of speeding up searches on a particular field such as, for example, surname, is to index the field

11 Indexing a database An index can be searched much more quickly than searching every record in a large database The primary key field is automatically indexed You can specify that other selected fields are to be indexed Indexed fields do not have to be unique

12 Worksheet 3 Now complete the Tasks 1 and 2 on Worksheet 3

13 Combining data from two linked tables
A query can be used to combine data from two or more linked tables into a single results table The results table can be used, for example, as the basis for a form or a report

14 Worksheet 3 Now complete Task 3 on Worksheet 3


Download ppt "3.5 Databases Relationships."

Similar presentations


Ads by Google