1 / 31

Spreadsheet vs Database

Spreadsheet vs Database. When do we use them?. Spreadsheet review. Why do we use a spreadsheet?. Spreadsheet review. Enter data Do calculations on data Examples: expenses, profit/loss. Expenses. Gradesheet. Database. Store information long-term Search information. An example….

demi
Download Presentation

Spreadsheet vs Database

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. Spreadsheet vs Database • When do we use them?

  2. Spreadsheet review • Why do we use a spreadsheet?

  3. Spreadsheet review • Enter data • Do calculations on data • Examples: expenses, profit/loss

  4. Expenses

  5. Gradesheet

  6. Database • Store information long-term • Search information

  7. An example… • What sort of information does Ren Da Fu Zhong need to keep? • Think of at least 10 pieces of information!

  8. RDFZ stores information on… • Students: • Name, address, ID number, parents, grades, classes, teachers, payment info, absences, extra activities • Teachers: • Name, address, ID number, classes taught, students taught, grades given, bank information, payment information

  9. RDFZ stores information on… • Other employees: • Name, job, hours worked/week, pay scale, bank information, duties/responsibilities • Inventories: • How many classrooms, how many desks, chairs, overhead projectors, scanners, computers…

  10. RDFZ stores information on… • Lots of stuff! • Can all of this fit on one spreadsheet? • No! • This is when we use a database.

  11. Uses of a database • Store data • Backup data • Add/Modify data • Query data (ask questions) • Generate reports (print data in an easy-to-read format)

  12. Examples of databases • Can you think of any?

  13. Your music

  14. Your games

  15. Your web pages

  16. Your life

  17. Warning! • Databases are very different from word processors, spreadsheets, or presentation software. • You CANNOT just start typing. • A database must be DESIGNED before you start adding data. • Why?

  18. Why? • Avoid duplication (putting in the same data many times) • Logical organization of data

  19. The parts of a database • Do you remember: • Columns? • Rows? • Cells? • These have different names in a database… 

  20. Table: one page

  21. We have 3 fields: ID, title, and date Notice – every field has the same data type! This is required! Column = Field

  22. Remember these from Excel? Data Type review

  23. Row = Record • Here we have 4 records • Each record has all the information from one entry.

  24. Another example • Here we have 3 records • A record has all the info on one entry

  25. Cell: Data Value • How many data values are in this table?

  26. Primary Key • Here, the “Video Collection” field is the primary key • EVERY table MUST have a primary key – a unique value

  27. Primary Key Examples

  28. Designing a Database • Before we enter data, we must design the table • Things to think about: • What fields do we need? • What data type does each field need? • Which field can become the primary key?

  29. Example: RDFZ • What information will RDFZ store about students? • What data type should each be? • Which field will make a good primary key?

  30. Example: Taobao business • We are running a business on TaoBao. We are selling clothing on the internet. We want to make a database of all the orders that we receive. • What information must we store? • What data type should each field be? • What should be the primary key?

  31. Example: a new home • We are real estate agents, and need to build a database of all apartments in the area. • What information must we store? • What data type should each field be? • What should be the primary key?

More Related