{"base":{"id":"cs8-25","subject":"Data","title":"Planning a database","scene":"data","steps":[{"mode":"table","eyebrow":"Tables","title":"Fields and records","body":"A database stores data in tables. Each column is a field (one kind of data) and each row is a record (everything about one item). Highlight a field, then a record.","actions":[{"id":"field","label":"Highlight a field"},{"id":"record","label":"Highlight a record"}]},{"mode":"key","eyebrow":"Primary key","title":"One of a kind","body":"Two bookings have the same name. A primary key is a field with a different value for every record, so each one can be found exactly. Add one.","actions":[{"id":"addKey","label":"Add a primary key"}]},{"mode":"require","eyebrow":"Data requirements","title":"Collect only what you need","body":"Before building a database, list the data the application really needs. For ticket bookings, which of these extra fields are useful? Try each one.","actions":[{"id":"seat","label":"Seat number"},{"id":"email","label":"Email"},{"id":"colour","label":"Favourite colour"},{"id":"shoe","label":"Shoe size"}]},{"mode":"evaluate","eyebrow":"Evaluating","title":"Does it do the job?","body":"Check a database against the questions its users need to answer, and check the data is suitable. Find the problems, then improve it.","actions":[{"id":"check","label":"Check the data"},{"id":"improve","label":"Improve the database"}]},{"mode":"quiz","eyebrow":"Check yourself","title":"Choose a key","body":"A library stores its books in a database. Two different books are both called ‘Ocean Life’.","question":"Which field is the best primary key?","options":["Title","Author's first name","Book ID number"],"answer":2,"right":"Correct. Each book gets its own ID, so no two records share it.","wrong":"Not quite. Which value is different for every book?","look":"key"}],"more":[{"type":"cards","id":"ideas","eyebrow":"Popular idea vs science","title":"Common mix-ups","items":[{"tag":"Popular idea","title":"\"More data is always better.\"","body":"Only collect data the task needs. Extra data wastes time and risks privacy."},{"tag":"Popular idea","title":"\"A name is a good way to identify a record.\"","body":"Names repeat. A primary key such as an ID number is unique."},{"tag":"Popular idea","title":"\"Data in a database must be correct.\"","body":"A database stores whatever is typed in. Validation and checking keep data suitable."}]},{"type":"cards","id":"terms","eyebrow":"Database words","title":"The parts of a table","items":[{"tag":"Table","title":"All the data about one kind of thing","body":"Bookings, Students, Books…"},{"tag":"Field","title":"A column","body":"One kind of data, e.g. Day."},{"tag":"Record","title":"A row","body":"All the data about one booking."},{"tag":"Primary key","title":"Unique field","body":"Different in every record, e.g. BookingID."}]},{"type":"cards","id":"suitable","eyebrow":"Suitable data","title":"Good data is…","items":[{"tag":"Relevant","title":"Needed for the task","body":"A ticket system needs the seat, not shoe size."},{"tag":"Complete","title":"No important blanks","body":"A booking without a day can't be found by day."},{"tag":"Consistent","title":"Same form every time","body":"Always 'Sunday', never 'Sun'."},{"tag":"Accurate","title":"Correct","body":"Checked when it is entered."}]},{"type":"activities","id":"try","eyebrow":"Try it at home","title":"Design a database","items":[{"title":"Pet club records","time":"20 minutes","need":["Paper and a ruler"],"steps":["Imagine a club that records members' pets. List the questions it needs to answer (e.g. 'Which pets need a vaccination this month?').","Choose the fields that answer those questions, and give each a data type.","Choose a primary key.","Draw the table with three example records. Cross out any field no question uses."],"why":"Starting from the users' questions keeps the database focused and makes sure it can do its job.","safety":"No safety risks."}]},{"type":"quiz","id":"quiz","eyebrow":"Quiz","title":"Six more questions","questions":[{"question":"What is a record?","options":["One row: all the data about one item","One column","The whole database"],"answer":0,"right":"Correct. A record is a row.","wrong":"Not quite. Think of one booking."},{"question":"What is a field?","options":["A row","One column: one kind of data","A password"],"answer":1,"right":"Correct. A field is a column.","wrong":"Not quite. Think of 'Day' for every booking."},{"question":"Why does a table need a primary key?","options":["To make it colourful","To delete records","To identify each record uniquely"],"answer":2,"right":"Correct. Unique values find exactly one record.","wrong":"Not quite. What if two records look the same?"},{"question":"Which field is NOT needed for a concert ticket booking?","options":["Seat number","Favourite food","Date"],"answer":1,"right":"Correct. It doesn't help any booking task.","wrong":"Not quite. Which one would no question use?"},{"question":"Some records say 'Sat' and some 'Saturday'. What problem can this cause?","options":["The database gets faster","Nothing","Searches for 'Saturday' miss some records"],"answer":2,"right":"Correct. Inconsistent data gives wrong answers.","wrong":"Not quite. What happens when you search?"},{"question":"Users ask 'Who hasn't paid?' but there is no Paid field. What should you do?","options":["Add a Paid field","Delete the table","Add a Favourite colour field"],"answer":0,"right":"Correct. Add the data needed to answer the question.","wrong":"Not quite. Which field answers the question?"}]},{"type":"checklist","id":"check","eyebrow":"Self-check","title":"I can explain…","items":["what tables, fields and records are","why a primary key must be unique","how to decide which data an application needs","what makes data suitable","how to evaluate and improve an existing database"]},{"type":"keywords","id":"words","eyebrow":"Key words","title":"Words to know","items":[{"word":"database","meaning":"An organised store of data that can be searched and sorted."},{"word":"field","meaning":"A column holding one kind of data."},{"word":"record","meaning":"A row holding all the data about one item."},{"word":"primary key","meaning":"A field with a unique value for every record."},{"word":"data requirements","meaning":"The list of data an application needs."}]},{"type":"sources","id":"sources","title":"Sources","items":["BBC Bitesize KS3 Computing: Databases"]}]},"overlay":null}