1. How to build a Database
What isa database?
A collectionof datathatis storedina computersystem.Theyallow theiruserstoenter,access,and
analyse theirdataquicklyandeasily.
Why use a database?
To store and organize datae.g.numbers.AlthoughExcel isgoodatstoringand organisingnumbers,
access ismuch strongerat handlingnon-numerical datasuchas names.
Databasesinaccess are composedof fourobjects:queries,forms,reportsandtables.
Forms Usedfor entering,modifyingandviewingrecords.Examplesof whenyou
mighthave had to fill inaform iswhenapplyingforaschool or visitingthe
doctor’soffice.Formsmake enteringdataeasier.Workingwithmany
tablescan be confusingandwhen youhave connectedtablesyoumight
needtowork withmore thanone at a time to entera setof data.
Queries A wayof searchingforand compilingdatafromone or more tables.When
youbuilda queryinaccess,you are definingspecificsearchconditions to
findexactlythe datayouwant. Theyare far more powerful thansimple
searches.A searchwill allow youtosee the name of one customerat your
business,while aquerywill allow youtofindall the informationof every
customerswhohas purchasedsomethingwithinthe pastweekfor
example.
Reports Offersyouthe abilitytopresentyourdatain print.Theyare useful
because theyallow youtopresentcomponentsof yourdatabase inan
easy-to-readtemplate.Itcanevenbe customisedtomake the format
more attracting.
Tables All data isstoredintablesinaccess.Tablesare goodfor tidyingclosely
relatedinformation.Rowsandcolumnsare referredtoasrecordsand
fields.A fieldisaway of organisinginformationbythe type of data itis.
Everypiece of informationinafieldisof the same type.A record isa unit
of information.Everycell inagivenrow ispart of that rowsrecord.
There are differentname tagstoput at the start at the name of a database so itis easiertoidentify
whattype of database itis.
3. > Allows you to access common commands no matter which tab is selected on the ribbon.
The navigationpane isa listcontainingeveryobjectinyourdatabase.Theycanbe renamed,opened
or deleted. The objectsare sortedbytype,withtablestogether,formstogether,queriestogether
etc.There are fourways of sortingyour objects,whichare:
> Custom– allowsyoutocreate an arrangement/groupsforsortingobjects.
> Objecttype – groups objectby type (defaulttype).
> Tablesand related Views – groups,forms,queriesandreportswithtablestheyreferto.
> CreatedDate and ModifiedDate – sortsobjectsbasedonwhentheywere createdorlast edited.
To sort objectsonthe navigationpane,clickthe dropdown arrow thenselectwhicheverone you
want.The objectsinyournavigationpane shouldbe sortedouttoyourdesire.
Thisbar allowsyouto navigate recordsone at a time.Click the arrowsto navigate throughthe
records.You can easilyskiptoa specificnumberbytypingitinthe box.
Thiscan be usedto searchfor anyterm inany field.The firstrecordfoundwill be automatically
selected.Tofindmore records,pressenter.
THE RIBBON
NAVIGATION PANE
RECORD NAVIGATION BAR
RECORD SEARCH BAR
Each tab is divided into
groups.
Clickan arrow to see
more group commands
Clicka tab to see
more commands
Contextual tabs.Will appear
whencertainitemsare selected
4. Working with tables
Tablesare composedof horizontal rows(records) andvertical columns(fields).Theyhave small
rectangleswhichare knownascellswhere the rowsandcolumnsmeet.A fieldisawayof organizing
informationbytype.A recordisone unitof information.Everysingle cell onagivenrow is part of
that row/srecord,while eachrecordhas itsownID number.
Entering data
Enteringdata onaccess isjustas simple asenteringdataonexcel.Toadda new record to a table,
youcan:
1. In the Records group,come to the home tab and clickthe new command.
2. On the record navigationbarat the bottomof the window clickthe new recordbutton.
3. Begintypinginthe row belowyourlastaddedrecord.
DEFINE PRIMARYKEY, FOREIGN KEY ETC.
Data types
> Shorttext– Allows255 characters,whichincludesspacesandpunctuation. Bettertouse forthings
like phone numbersorzipcodes because if itisa ‘Number’datatype,the 0 at the start will be taken
away inthe numberdata type.
> Longtext– Allows65.536 characters.Notideal forthingslike namesandaddressesetc.
> Number– Allowsonlynumbers.A positive ornegativesigncanbe put before the number,alsoa
decimal point.
> Date/time –Allows datesandtimes tobe enteredthroughoutaspecifictime,usuallyselectedby
personwhocreatesdatabase.
> Currency – Allowsonlynumberswithacurrencyinfront($, £ etc.)
> AutoNumber–Numbersunique toeachrecordand assignedbyAccessas youadd records,starting
at 1. Mostlyusedas a primarykeyfieldformosttables.
> Yes/No– A Booleanvalue thatcan be eitheronor off.Usuallyshownas a checkbox.
http://www.dummies.com/how-to/content/tips-for-choosing-field-types-in-access-2013.html
Sometimeswhenyouentersome informationintoarecord,a pop up will appearwarningyouwhyit
isnot possible tohave thisinthiscertaincolumn/fieldasthere isa validationrule thatrestrictswhat
can be typedinthatfield.Forexample,there’samale/femalefieldinthe ‘CardsbyJames’database,
whichhas a validationrule of ‘F’or‘M’ and if somethingelse was
typedintothat cell,apop upscreenwill appeartoletthe person
typingknowthattheycan’t add anythingotherthan‘F’or ’M’.
To save a recordgo to Home thenRecords andclick Save.
Working with forms
5. Althoughyoucan easilyadddatato your database directly,formswill make iteasierandquicker.
Theymake sure you enteryourdata correctlyinthe right place,meaningyourdatabase ismore
likelytobe accurate.
Combo box – To make sure
it’s filledinspecifically.
Allows you to enter data by
personallychoosing froma
drop downlist of different
choices.
Text box – most common
wayof enteringdata intoa
database. Anything canbe
written in it, althoughthere
maybe a limit of the
amount of characters which
can be written init.
Self-made form buttons – makesit easier
to do things like delete and save records
or go to next record before or after
Text box with validationrule
- Restricts what canbe put
into this fielde.g. only‘M’ or
‘F’ is allowedto be in this
field.
6. Designing a query
Queriesare a wayof searchingforand compilingdatafromone or more tables.Theyallow youto
pull informationfromone ormore tablesbasedona setof searchconditionsyoudefine.Theyare
strongerthan simple searchesbecause theycandraw informationfrommultiple tables.
Some querieswillhave onlyone table,however,mostof themwill have more thanone.When
makinga query,youhave to planwhatexactlyitis that youwantto know,Identifyeverytype of
informationthatyouwantincludedinyourqueryresults,whatfieldsyouwanttoinclude inyour
queryand determinethe criteriathe informationineachfieldneedstomeet.
Joiningtables
Step1: Our card businesscontainsmanycustomers,whohave all orderedthe same type of cards
possiblymanytimes.Forustomake iteasiertoaccess all theirinformationfromtblCustomer,
tblSalesRecordandtblPriceListwe use queriestojointhemtogether.Forexample,if I’mlookingfor
all the informationforthe PersonwithIDnumber42, I can get all theirinformationinstantlyif all the
tablesare joinedtogether.
Step2: Identifyingthe informationwe need.Whatfieldsare the same inmore thanone table?In
Cards byJames,tblCustomerandtblSalesRecordbothhave CustomerRefID,tblSalesRecordand
tblPriceListbothhave CardReference.
7. Creating a Report
If you needtoshare informationfromyourdatabase withsomeone butdon’twantthatperson
actuallytamperingwithyourdatabase,it’sagoodideato create a record.
To make a report,Openthe table/queryyou