Download presentation
Presentation is loading. Please wait.
Published byJohnathan Riley Modified over 9 years ago
1
Here are the main points: use the words SEARCH, SORT and REPORT (report = a print out, sometimes called a hard copy) mention the names of the fields that you are using use the keywords AND, OR (and sometimes NOT) state the conditions of the search check to see if a field exists. If it doesn’t, say in your answer “create the field ****” where *** is the NEW field to be created. DATABASE REVISION
2
The database in a school has the fields Firstname, Surname, Street, Town, Postcode, Clan and Doctor. A school guidance teacher wants a list in alphabetical order of all the pupils from Oban in Clan Fingal. Describe how this would be done. SOLUTION. The teacher would SEARCH the TOWN field for “town = OBAN” AND the CLAN field for “clan = FINGAL”. The teacher would SORT the SURNAME field in alphabetical order and produce a REPORT using fields FIRSTNAME, SURNAME, TOWN and CLAN.
3
The teacher wants the Names and addresses of all the families who have more than 5 members in the household. How would that be done? SOLUTION. Note that in this database there is no field which gives the number of members of the family. Therefore add the field “Number in household” or something similar. Then SEARCH the database for “Number in household>5” and produce a report with the fields FIRSTNAME, SURNAME, STREET, TOWN, POSTCODE, NUMBER IN HOUSEHOLD.
4
State the KEY FIELD in this database or suggest a KEY FIELD if none exists. A key field is a field which uniquely identifies each and every record. That means that every record must have different entries for a key field. There is no field which MUST be different every record here. It might be suggested that PUPIL NUMBER, or SQA NUMBER would be a key field.
5
Other important points A computed field is a field which obtains its values by doing a calculation on other fields in the database.
6
Totally Unsorted Sorted By Surname onlySorted by Surname AND forename SURNAMEFORENAMESURNAM E FORENAMESURNAM E FORENAME SymeHelenSempleAdamSempleAdam SmithWilliamSmithWilliamSmithFred SmithFredSmithFredSmithMel SempleAdamSmithMelSmithWilliam SmithMelSymeHelenSymeHelen Sorting: A field can be sorted on One field Two fields …………….. or more
7
File size calculations A database has fields FIRSTNAME, SURNAME, STREET, TOWN, POSTCODE, and NUMBER IN HOUSEHOLD. Draw a table which has a suitable type and size for each field and estimate how much space would be needed for 5000 records if one character takes 1 byte. Field NameTypeSize in characters Notes FIRSTNAMEText15 15 should cover most names; there will be no names needing more than 15 characters (letters) SURNAMEText25 As above STREETText25 TOWNText20 POSTCODEText10 NUMBER IN HOUSEHOLD Number2 Numbers should be allocated 2 bytes because of the way they are stored Total97
8
Number of bytes for 1 record = 97 bytes Number of bytes for 5000 records= 5000 X 97 = 485000 bytes = 485000 divided by 1024 kilobytes = 473.6 Kb (approximately) Field NameTypeSize in characters Notes FIRSTNAMEText15 15 should cover most names; there will be no names needing more than 15 characters (letters) SURNAMEText25 As above STREETText25 TOWNText20 POSTCODEText10 NUMBER IN HOUSEHOLD Number2 Numbers should be allocated 2 bytes because of the way they are stored Total97
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.