ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
11 marks · Entity-relationship diagrams and keys
Complete the diagram below to show the relationship between the character entity and the studio entity. character studio Aabish populates the database with several studios and hundreds of characters. Sample data from each table is shown below. Studio studioID studioName dateFormed location staff LUX01 Luxar 23/09/1985 Japan 452 DES01 Desney 10/01/2001 UK 298 DES02 Desney 29/10/1992 Japan 1053 … … … … … Character charID name createdBy year appearances style studioID 1 Fred F. Smith 1994 23 Person DES01 2 Daisy Donkey G.R. Bryant 2003 342 Animal DES02 3 Toaster K. Kali 2018 6 Object DES02 4 Fred Z. Wayne 1994 76 Alien LUX01 … … … … … … … Design a query that could be used to create a list of character names and styles created by ‘K. Bell’ at the Japanese branch of Goban studios. Field(s) Table(s) Search criteria Aabish uses the database to identify the characters with the least number of appearances from all studios. name style appearances Triple Tiger Animal 3 Toaster Object 6 Davio Animal 12 Fred Person 23 Arthur Alien 24 Biggles Object 39 … … … Aabish wants to produce similar output for only the Desney studio characters. Complete the SQL statement below that would produce this output. SELECT FROM WHERE ORDER BY Aabish is writing a book about the history of computer animation studios and the characters created by each studio. As part of her research she makes notes about the studios and characters. charID: name: studioID: createdBy: studioName: year: dateFormed: appearances: location: USA UK China style: Alien Animal Object Japan Germany Person Anime staff: studioID: charID: name: createdBy: year: studioID: appearances: studioName: style: Alien Animal Object Person Anime dateFormed: studioID: location: USA UK China Japan Germany staff: She decides to store this information in a relational database using two entities called character and studio.
One mark for any from • • many characters (are created by) one studio Allow other acceptable one to many design notations (1-M, N-M, 1-∞) Ignore any additional information added (attributes, keys). One mark each for • name, style with no other fields • Studio, Character • Location = Japan • studioName = Goban • createdBy = K. Bell Field(s) name, style Table(s) Studio, Character Search Criteria location = Japan studioName = Goban createdBy = K. Bell Allow use of dot notation with fields Logical operators and equi-joins are not required in the search criteria as this is design. If logical operators are used then they must produce the correct result. If they do not, the first criteria may be marked correct and subsequent criteria should be marked as incorrect. One mark each for • SELECT name, style, appearances • FROM Studio, Character • WHERE studioName = “Desney” • AND Studio.studioID = Character.studioID • ORDER BY appearances (ASC) Ignore second sort, as long as appearances is the first sort. Select fields must be in the order given. The table names in FROM and the WHERE conditions may be in any order.