Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A cinema wants a single-table database of its films. For each film it must store the title and the running time in minutes. It also stores the age rating (one letter or number, such as U or 12), the date it was first shown and whether it is shown in 3D. Two films can have the same title.
Define the table: give it a name, list the field names, and say how many fields it has.
A single-table database keeps all its data in one table. A record is one row: all the data about one thing. A field is one column: one item of data about every thing, and its heading is the field name. A table with records and fields holds data items.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. One record for each film, and one field for each item of data. Then add a field that is unique.
Step 1. The items to store. Title, running time, age rating, date first shown, and 3D or not. That is items, so fields.
Step 2. A unique field. Two films can have the same title, so the title cannot tell the records apart. Add a field FilmID.
Step 3. Name the table and the fields. A table Films with the fields FilmID, Title, RunningTime, AgeRating, FirstShown and Is3D. That is fields.
Check. Each field holds one item of data, and no field name has a space.
Answer: the table Films with fields: FilmID, Title, RunningTime, AgeRating, FirstShown, Is3D.
Log in to join the discussion.
Loading…