1 / 9

Databases

Databases. Searching and Sorting. SIMPLE search. A SIMPLE search is when you use only ONE field to search the database. e.g. Searching a football database to find all teams that play in Spain So you would use COUNTRY = “Spain” (only ONE field is used). COMPLEX search.

quiana
Download Presentation

Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Databases Searching and Sorting

  2. SIMPLE search A SIMPLE search is when you use only ONE field to search the database. e.g. Searching a football database to find all teams that play in Spain So you would use COUNTRY = “Spain” (only ONE field is used)

  3. COMPLEX search A complex search uses TWO OR MORE fields to find information So searching the same database would be as follows COUNTRY = “Spain” AND Colours = “White”

  4. Examples of Simple searches • Eye Colour = “Blue” • Country = “Italy” • Language = “Spanish” • Stays in = “Lochwinnoch” Anything that uses just ONE field in a database is a SIMPLE search

  5. More SIMPLE searches If you have a numeric field then it is possible to search that in a slightly different way. Look at the extract from countries database Since it is a numeric field we can treat the contents as a number therefore Population > 100 gives 2 countries Japan and Brazil

  6. More COMPLEX searches • Eye colour = “Blue” AND Hair Colour = “Brown” • Town = “Johnstone” AND Primary = “Thorn” • Currency = “Euro” AND Population > 20 million • Cost < £1 AND Type = “drink” • Height > 2m AND Right handed = “Yes” • Resort = “Corfu” AND Cost < £400

  7. SORTING a database • Sorting a database involves using ONE or MORE fields and putting them in order. You can either sort • ALPHABETICALLY (a-z or z-a) • NUMERICAL (ascending or descending) YOU HAVE TO TELL THE DATABASE WHAT FIELD YOU ARE SORTING THOUGH

  8. More SORTING Sorted using height field ascending

  9. SUMMARY Do you know the difference between SIMPLE SEARCH And COMPLEX SEARCH Make sure you tell the database which FIELD or FIELDS you intend to search. Do you know the difference between Sort ascending or descending Numerical Sort and Alphabetical Sort

More Related