Spreadsheet vs Database When do we use them?. Spreadsheet review Why do we use a spreadsheet?

  • Published on

  • View

  • Download

Embed Size (px)


<ul><li>Slide 1</li></ul> <p>Spreadsheet vs Database When do we use them? Slide 2 Spreadsheet review Why do we use a spreadsheet? Slide 3 Spreadsheet review Enter data Do calculations on data Examples: expenses, profit/loss Slide 4 Expenses Slide 5 Gradesheet Slide 6 Database Store information long-term Search information Slide 7 An example What sort of information does Ren Da Fu Zhong need to keep? Think of at least 10 pieces of information! Slide 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 Slide 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 Slide 10 RDFZ stores information on Lots of stuff! Can all of this fit on one spreadsheet? No! This is when we use a database. Slide 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) Slide 12 Examples of databases Can you think of any? Slide 13 Your music Slide 14 Your games Slide 15 Your web pages Slide 16 Your life Slide 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? Slide 18 Avoid duplication (putting in the same data many times) Logical organization of data Slide 19 The parts of a database Do you remember: Columns? Rows? Cells? These have different names in a database Slide 20 Table: one page Slide 21 Column = Field We have 3 fields: ID, title, and date Notice every field has the same data type! This is required! Slide 22 Data Type review Remember these from Excel? Slide 23 Row = Record Here we have 4 records Each record has all the information from one entry. Slide 24 Another example Here we have 3 records A record has all the info on one entry Slide 25 Cell: Data Value How many data values are in this table? Slide 26 Primary Key Here, the Video Collection field is the primary key EVERY table MUST have a primary key a unique value Slide 27 Primary Key Examples Slide 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? Slide 29 Example: RDFZ What information will RDFZ store about students? What data type should each be? Which field will make a good primary key? Slide 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? Slide 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? </p>


View more >