220 likes | 370 Views
DATABASES. IGHSAAN FRANCIS. What is a database?. A database is a computer-based programme that specialises in managing and manipulating structured information. Most databases come with multiple components: Tables for structuring the data Forms for entering data
E N D
DATABASES IGHSAAN FRANCIS
What is a database? A database is a computer-based programme that specialises in managing and manipulatingstructured information. Most databases come with multiple components: • Tablesfor structuring the data • Formsfor entering data • Queriesfor asking questions of that data • Reportsfor displaying the results of a query.
Why use a database? • A database helps you to organize your data in a logical manner (Tables) • Allows you to specify how different data relates to each other (Tables) • Ensures that data remains consistent when you add, update or delete data (Tables) • An advantage is fast and efficient data retrieval (Queries) • Retrieve the data you want in the way you want it (Queries) • Allows you to feed back on the results of queries (Reports) (Purpose of database)
Who uses databases? • Schools use them to keep a record of students and teachers. • Doctor’ssurgery uses them to keep a record of patients details. • Librariesuse them to keep a record the books that members of the public borrow. • Shopsuse them to keep a record of the items that have been bought throughout the day. • Police stations use them to keep a record a the criminal's record.
Database vs Spreadsheet Why can’t I just use a spreadsheet? Databases are much more powerful than spreadsheets in the way you’re able to manipulate data. Here are just a few of the actions that you can perform on a database that would be difficult if not impossible to perform on a spreadsheet. • Retrieve all records that match certain criteria • Update records in bulk • Cross-reference records in different tables • Perform complex aggregate calculations
Tables • A table is a collection of data about a specific topic, such as students or contacts. Using a separate table for each topic means that you store that data only once, which makes your database more efficient, and reduces data-entry errors. • Tables organise data into columns (called fields) and rows (called records).
Primary Key • Every table in your database should have a primary key — a field or set of fields with a unique value for each record stored in the table. You can use the primary key to identify and refer to each record. • Use a field that is unique, where the items for the field cannot be repeated, such as • An ID number • A cell number (telephone number) • Persal /staff number
Forms • An input interface to guide users to enter data and to minimise errors when doing so. • Elements to a form: • Good layout less errors: Aesthetically functional • Uncomplicated • Uncluttered • Avoidhaving users to scroll • No jargon
Queries • Informally, a query is a question • In a database the same, a query is a request for information from the database. • Elements to a query: • Select appropriate fields (either for query or display) • Be clear on the criteria • Summaryoptions (group/sum/avg/count/etc.) • Sorting
Reports • Feedback on resultsof a query • Elements to a report: • Format of reporting (electronic/hard copy) • Layoutand detail (headers and footers) • Appropriate fields • Summaryoptions (group/sum/avg/etc.) • Sorting
Lets create our own database • Scenario: “Music is love in search of a word ” Sidonie Gabrielle With so many ways in which music is accessible to us since the Internet (Napster, You Tube, iTunes, Nokia Music, etc.), and the multiple of music storage and playing devices (CDs, iPod, MP3 players, cell phones, etc.) we need to find ways in sorting and storing the kind of music we like in a music collection.
Scenario You are about to create your own music collection, of which some CDs are from The MetroFM Top 40. Look at the following slides (15 -17) and create a database to organise the storing of your CDs. (Some of the data is thumb-sucked to facilitate querying of the database) • In designing your database make use of appropriate data types • Make the Item no. your primary key (See further instructions in accompanying Word doc under Informal Assessment)
Data Items (1) Song: Soul In MindArtist(s): LiraItem no.: 90876 Date Released: 12/06/2008Price Was: R109.95Price Now: R104.45 Country: South Africa Contact no: 021 2365489 Song: Perceptions of PachaArtist(s): GoldfishItem no.: 13456 Date Released: 20/12/2008Price Was: R115.95Price Now: R104.36 Country: South Africa Contact no: 031 9632145 Song: Tswack stick em Artist(s): KhulichanaItem no.: 23450 Date Released: 15/05/2009 Price Was: R153.95Price Now: R126.36 Country: South Africa Contact no: 011 2587413 Song: MadArtist(s): Ne YoItem no.: 21508 Date Released: 19/01/2009Price Was: R89.95Price Now: R80.00 Country: America Contact no: 011 8897112
Data Items (2) Song: HeartlessArtist(s): Khanye WestItem no.: 56782 Date Released: 30/01/2009Price Was: R155.95Price Now: R105.95 Country: America Contact no: 061 2673945 Song: Diva Artist(s): Beyonce Item no.: 77892 Date Released: 12/12/2008Price Was: R215.95Price Now: R115.95 Country: America Contact no: 021 2255889 Song: Blame ItArtist(s): Jamie Foxx feat Busta & T-Pain Item no.: 76341 Date Released: 14/02/2009Price Was: R150.00Price Now: R110.00 Country: America Contact no: 031 6497489 Song: Change The World Artist(s): Master Jam feat RJ Benjamin Item no.: 65432 Date Released: 01/01/2009Price Was: R110.00Price Now: R104.00 Country: England Contact no: 041 2699114
Data Items (3) Song: Dead & Gone Artist(s): T.I feat Justine Timberlake Item no.: 44561 Date Released: 05/05/2009Price Was: R180.50Price Now: R130.50 Country: America Contact no: 091 6489744 Song: War Artist(s): Sean Kingston feat Lil Wayne Item no.: 65312 Date Released: 10/11/2008Price Was: R160.95Price Now: R130.55 Country: America Contact no: 021 6633221 Song: Turning Me On Artist(s): Keri Hilson feat Lil WayneItem no.: 11479 Date Released: 21/11/2008Price Was: R95.95Price Now: R85.00 Country: America Contact no: 011 0326580 Song: Chocolate High Artist(s): India Arie feat Musiq Souldchild Item no.: 98112 Date Released: 20/01/2009Price Was: R195.95Price Now: R155.95 Country: America Contact no: 051 2388589