Presentation is loading. Please wait.

Presentation is loading. Please wait.

GCSE Computer Science: OCR Programming Paper

Similar presentations


Presentation on theme: "GCSE Computer Science: OCR Programming Paper"— Presentation transcript:

1 GCSE Computer Science: OCR Programming Paper
Therapies: SQL GCSE Computer Science: OCR Programming Paper

2 The OCR Paper 2 examiners’ report stated that:
“Candidates who did well on this paper…understood the use of SQL and wildcards in questions 1b(i) and 1b(ii)” And went on to state that: “Despite ‘the use of SQL to search for data’ being listed under section 2.2 of the specification, the vast majority of candidate answers showed a lack of understanding of SQL in general. It was common to see incorrect answers that attempted to use pseudocode to respond to this and a large number leaving this question blank. Where candidates did use the keywords of SELECT, FROM and WHERE answers were much more successful. The SQL keywords and terms that candidates are required to know are listed in appendix 5f of the specification.”

3 Structured Query Language
Section 2.2 (Programming Techniques) in the OCR Computer Science Specification states that learners should have studied the following: The use of SQL to search for data. Appendix 5f is a definitive list of the Pseudocode, Boolean Logic and Flow Charts that could be used by OCR in the exams. Anything outside of this list should not appear on the exam. Therefore, this appendix can be treated as a guide to what to teach students. Students would not be expected to produce anything outside of this list in an examined response. It is evident from the extensive examiners’ report that many students were unable to apply the required SQL in the Paper 2 examination.

4 Limits and Scope of SQL for OCR examinations

5 What is SQL? SQL is a language that lets you access and manipulate databases. What can it do: SQL can execute queries against a database. SQL can retrieve data from a database. SQL can insert records in a database. SQL can update records in a database. SQL can delete records from a database. SQL can create new databases. SQL can create new tables in a database. SQL can create stored procedures in a database. SQL can create views in a database. SQL can set permissions on tables, procedures and views. The GCSE exam only requires students to be able to execute queries and retrieve data from a database.

6 SQL Commands: SELECT SELECT – picks the data you want from the database. The select command should be followed by the field name(s) you would like to extract data from. E.g. SELECT firstname Multiple fields can be selected by inserting a comma between each field name. E.g. SELECT firstname, surname, age All of the fields in a database table can be selected by using the “*” command (where ‘*’ is a wildcard). E.g. SELECT *

7 SQL Commands: FROM and WHERE
provides the table you would like the data (see the SELECT command) to come from. E.g. SELECT firstname, surname, DoB FROM customers Provides a search criteria if you want to have a more defined set of results returned. E.g SELECT firstname, surname, age FROM customers WHERE DoB > # 01/01/1999#

8 SQL Commands: AND/OR Boolean operators that work in the same manner as they do in any other programming language. AND – both conditions must be true to return a result. OR – one or both conditions must be true to return a result. E.G. SELECT firstname, surname, age FROM customers WHERE DoB > # 01/01/1999# AND surname = “Smith”

9 SQL Commands - LIKE The LIKE operator is used in conjunction with the WHERE command to return results with a particular pattern. It is also used with the “%” wildcard which “represents zero, one or multiple characters”. E.G SELECT firstname, surname, age FROM customers WHERE surname LIKE ‘s%”

10 Horse Table Name YearBorn RacesWon Gender Gullopgiddy 2013 100 Male
Deezerbreeze 2010 30 Quickwinner 12 Steeplechoice 48 Female Grategallop 2012 102 Timefillies 2011 55 Rumred 21 Galgonegood 56 Goinggoingone 47

11 Using the above table write the following queries:
A query that will display all fields of records in the Horses table where the horse was born in the year 2010 and is male. A query that will display all fields or records where the horse was born in or they are female. A query that will display the name and age of horses that are male. A query that will display all the fields where the name begins with the letter “g”.

12 Take it further: Use the W3 schools website to interrogate a series of databases with more content.

13 Commissioned by The PiXL Club Ltd.
This resource is strictly for the use of member schools for as long as they remain members of The PiXL Club. It may not be copied, sold, or transferred to a third party or used by the school after membership ceases. Until such time it may be freely used within the member school. All opinions and contributions are those of the authors. The contents of this resource are not connected with, or endorsed by, any other company, organisation or institution. These papers were made by teachers in good faith based upon our understanding to date. PiXL Club Ltd endeavour to trace and contact copyright owners. If there are any inadvertent omissions or errors in the acknowledgements or usage, this is unintended and PiXL will remedy these on written notification.


Download ppt "GCSE Computer Science: OCR Programming Paper"

Similar presentations


Ads by Google