Question 2

OCR Computer Science June 2022 Computer systems (H446-01)A level38 marks

On the specification

(a)(i)
1.3 Exchanging data
(a)(ii)
1.3 Exchanging data
(a)(iii)
1.4 Data types, data structures and algorithms
(a)(iv)
1.4 Data types, data structures and algorithms
(b)
1.3 Exchanging data
(c)(i)
1.1 The characteristics of contemporary processors, input, output and storage devices1.3 Exchanging data
(c)(ii)
1.3 Exchanging data
(d)(i)
1.3 Exchanging data
(d)(ii)
1.3 Exchanging data
(d)(iii)
1.3 Exchanging data
(d)(iv)
1.3 Exchanging data
(e)
1.5 Legal, moral, cultural and ethical issues
(f)
1.3 Exchanging data
(g)(i)
2.2 Problem solving and programming
Question text

2 A video streaming service uses a relational database. An extract of the data from two tables from this database is shown in Fig. 2. Membership contains data about current memberships that customers hold and package contains data about different streaming packages available. Username FirstName StartDate PackageType User001 Amaya 08/05/2016 Premium User002 Amit 06/06/2019 Basic User003 Tom 17/08/2019 Free User004 Kareem 08/08/2017 Basic User005 Sarah 25/03/2020 Premium Membership PackageType CostPerMonth(£) Adverts Premium 12.99 false Basic 7.99 true Free 0.00 true Package Fig. 2 (a) (i) State what is meant by the term ‘primary key’. [1] (ii) Identify the foreign key used in the database and the table name where this is a foreign key. Foreign Key Table Name [2] (iii) Identify the data type of the CostPerMonth(£) field. [1] (iv) Give the name of the field that could be stored using a Boolean data type. [1] (b) The Adverts field indicates if customers will be shown adverts. true indicates that customers will be shown adverts, and false indicates that adverts are not shown. Write Structured Query Language (SQL) to return the Username and FirstName fields for all customers who see adverts. [5] (c) When new customers join the streaming service, their name, email address and contact details are captured so that they can be entered into the database. (i) Identify one method of capturing a new customer’s personal data, describing why this method is suitable. Method Suitability [3] (ii) Sometimes the company may need to move or backup its data they hold about customers. Identify two methods of exchanging data with other computer systems. 1 2 [2] (d) The database supports ACID transactions. ACID stands for Atomicity, Consistency, Isolation and Durability. (i) Describe what is meant by a transaction being durable. [2] (ii) Give one way that durability can be achieved for a completed transaction. [1] (iii) Explain how record locking can be used to ensure that the ACID principle of isolation is achieved when carrying out multiple transactions. [3] (iv) Give one disadvantage of using record locking. [1] (e) The Copyright Designs and Patents Act 1988 applies to all videos that are streamed. Explain how this act applies to the videos. [2] (f) All videos that are streamed are compressed. Customers have the option to choose from watching the videos with lossy compression or lossless compression. Explain how this choice will impact the customer. [5] (g) A program is written using an object-oriented programming paradigm and uses a class called video to organise the videos that are streamed to customers. The class video has these attributes: • name • number of views • star rating. The constructor method will set the name attribute to the name that is passed in as a parameter. The constructor will also initially set the number of views to 0 and the star rating to 3. (i) Write program code or pseudocode to declare the class video and initialise the required attributes as private. You should include both the attribute definitions and the constructor method in your answer. [7] (ii) A public method called updateviews() will update the number of views after a video has been viewed. This method is defined inside the video class. Write program code or pseudocode for the method updateviews() to increase the number of views by one. [2]