Y9 All Computer Science [end of years revision]

5.0(2)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/41

flashcard set

Earn XP

Description and Tags

All topics covered in Y9 computer science: databases, python, logic gates

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

42 Terms

1
New cards

Table

a collection of related data sorted in an organized way. Made up of fields and records

2
New cards

Record

all of the data relating to one instance of the table, represented by a row e.g. Sophia Austin

(donā€™t say that it is a row)

3
New cards

Field

an attribute which all records have in common, represented by a column e.g. date of birth

(donā€™t say it is a column)

4
New cards

Query

a request for information - a way to access information from a database

5
New cards

Primary key

a special field that stores a unique value (an ID) for each record

6
New cards

CREATE TABLE statement line 1

 CREATE TABLE table_name (

ā€˜CREATE TABLEā€™ and the table name, then open brackets

7
New cards

CREATE TABLE statement lines for fields

	text_field_name VARCHAR(30),
 	text_field_name VARCHAR(30),
	integer_field_name INT,
	decimal_field_name FLOAT,
	true_or_false_field_name BOOLEAN

(indented)

Name of your first field (column), and after it what type of data youā€™ll be entering in it, e.g. text or numbers. For a text field you need to say how many characters it should allow as maximum. You put this number in brackets

Repeat for all the fields in the table

8
New cards

CREATE TABLE statement last line

	);

This closes off the list

9
New cards

INSERT INTO statement first line

INSERT INTO table_name

ā€˜INSERT INTOā€™ and then your table name

10
New cards

INSERT INTO statement second line

VALUES	
11
New cards

INSERT INTO statement lines for values

("Text 1",44,55,33,1),
("Text 2",77,11,99,0),
("Text 3",29,100,21,8)

write a list of values to put into your table, each line is one record (row), and each field is separated by commas

quotes around any text data

12
New cards

INSERT INTO statement last line

;
13
New cards

SELECT FROM statement first line

SELECT * FROM table_name;

ā€˜SELECT * FROMā€™ and then your table name and a ;

14
New cards
SELECT Firstname,Email FROM table4

What will this give you

All the firstnames and emails from table4

15
New cards
SELECT table4.Firstname, table4.email

What will this give you

All the firstnames and emails from table4

This is just another way of doing it, specifying each time which table you want it from instead of once at the start

16
New cards
SELECT Firstname FROM table_name WHERE surname="abe";

What will this give you

will give you all the firstnames in the table that have surnames containing ā€˜abeā€™, but not the surname

if you want it to display that you have to put it after a comma next to the firstname

17
New cards

function of => (SQL)

greater than or equal to

18
New cards

function of <= (SQL)

less than or equal to

19
New cards

function of <> (SQL)

not equal to

20
New cards

SQL: VARCHAR data type

a string of variable length (can contain letters, numbers and special characters). After it you put the maximum character length in brackets

21
New cards

SQL: INTEGER (aka INT) data type

a number

22
New cards

SQL: DECIMAL data type

an exact number with a fixed amount of digits and a fixed amount of digits after the decimal point, written as DECIMAL(digits, digits after decimal point)

23
New cards

SQL: BOOLEAN (aka BOOL) data type

true or false, 0 is false and anything else it true

24
New cards

Variable

a named memory location, used to store a value while the program is running. The value can change whilst the program runs

25
New cards

Operator

a symbol that takes one or more values and yields another value e.g. addition

26
New cards

Python: string data type

text

27
New cards

Python: integer (int) data type

number(s)

28
New cards

Python: float data type

a decimal

29
New cards

Python: boolean data type

true or false

1 = true
0 = false

30
New cards

* maths operator (python)

multiplication

31
New cards

** maths operator (python)

to the power of

32
New cards

// maths operator (python)

division, rounds the result down to the nearest whole number

33
New cards

% maths operator (python)

gives you the remainder of the first number divided by the second

34
New cards

== operator (python)

equal (not with numbers)

35
New cards

!= operator (python)

ā‰  (not equal to)

36
New cards

NOT gate

gives the opposite of what was put into it

<p>gives the opposite of what was put into it</p>
37
New cards

AND gate

needs both inputs to be 1 to have an output of 1, anything else will give 0

<p>needs both inputs to be 1 to have an output of 1, anything else will give 0</p>
38
New cards

OR gate

Will give 1 if either or both imputs are 1, will give 0 if both are 0

<p>Will give 1 if either or both imputs are 1, will give 0 if both are 0</p>
39
New cards

Definite iteration

when a code is repeated a specific number of times (for loop)

40
New cards

Indefinite iteration

when a code is repeated until a condition is met/no longer met

41
New cards

Iterating over a list

printing every item in that list

42
New cards

Range function (python)

prints every number in the range you specified (not including the number that you put, including 0)