Computing Notes

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Computing Notes

Unit 3 - Simple database tables

3.1 : Introduction to databases


💻
Database : Organized & Accessible collection of data.

Field : A single item of data.

Record : A collection of related fields

Table : Set of data organized in columns & rows that may contain a specific number
of columns and rows needed to fit all the data broken into small information.

Key field : Uniquely identifies and finds each record in the database. Known as a
primary key when its a single key field, or a complex key when a set of fields are
used.

3.2 : Using Boolean Expressions


🤸
Boolean expression : Clear expression that might be true or false.

Boolean operator : AND, OR, and NOT manage the searching and the results that
show are relevant.

E.g. : If x and y are facts, then ‘First name = Susan AND Age = 50’ will return all 50-
year-old Susans in the database and nothing else

Computing Notes 1
Database query : piece of code that is sent to a database to extract information
from that database. Use query language such as SQL (Structured query language),
which has certain keywords that the database can understand.

SQL keywords and Examples:

SELECT

FROM

WHERE

AND

NOT

OR

LIKE

BETWEEN

SELECT * FROM WHERE SELECT WHERE Gender ‘F’


StudentInfo Gender = FirstName, AND Commendations >
‘M’ Surname FROM 10
Asks the database StudentInfo
to return all fields Only fields Only fields of those
from the database for those Means to return students that are female
called StudentInfo students just the and have more than 10
that are FirstName and commendations should
Male Surname field be returned.
should be from the
returned database called
StudentInfo

3.3 : Clues to find the subject of Enigma Variation XIII (WHAT IS


THIS)
🦍
Inaccurate data : involves spelling mistakes / incorrect data, such as old address.

Redundant data : when data is stored in a database more than once, which is
duplicated data. Lead to out of control of the database and its best to be avoided.

Computing Notes 2
Verification Validation

set of automatic checks that a computer do on the


checking the data in a database to
data to ensure the database is logical, reasonable
match the original written data.
and complete within given boundaries
people usually check them computer program validates them

uses methods, inspections, reviews, uses methos in testing the data, functional testing,
descision making stuctural testing, etc

check if the software meets the check if the software meets the persons
guidelines expectations and requirements

doesnt involve using code always involved using code

done first before validation follows after verification

Standard validation checks include:

Check Description

checks the data entering exists in the data


Existence
base. E.g. database has field for StudentID
checks correct format used. E.g. dd/mm/yy
Format
(date of birth 🤰)
checks that text is less than given number of
Length characters. E.g. more than 11 digits isnt allowed
for phone number.

checks important information that need to be


Presence
entered and no field is blank.
checks number that falls in correct range. E.g.
Range number > 18 is entered in the Age Field, person
must be over 18.

checks data entered must be correct type. E.g.


Type
letters and not numbers are entered.

Foreign key : used to link tables in a connected database. A field in one table that is
linked to the primary key / key field in another.

Unit 4 : Searching

Computing Notes 3
4.1 & 4.2 : Linear Search & Implementing linear search

Linear Search : searching method where you start at the beginning of a list and
checking it individually Example:

Start at house 1
WHILE we haven’t found our friend:

knock on the door and see who lives there


IF it’s not our friend THEN

Move to the next door


END IF
END WHILE

We are now at out friend’s house

Implementing a linear search in steps:

1. Open the array and read the search element (also known as the target
element).

2. The search element is compared to the array's first element in the second
step.

3. If both matches are made, the message "Target element is found" appears
and the linear search function is ended.

4. Compare the search element with the following element in the array if not of
them match.

5. Repeat steps 3 and 4 here until the last element of the array is compared
with the search (Target) element.

6. The Linear Search Function will be stopped and the message "Element is
not found" will be shown if the last element in the list does not match.

4.3 & 4.5 : Programming & Implementing a binary search

Computing Notes 4
Binary Search : searching method where the search splits the part of the list being
searched in two with each check. E.g.

List:

2 , 4 , 6 , 8 , 10 , 12 , 14 , 16, 18, 20, 22


0 1 2 3 4 5 6 7 8 9 10

Search: 20
0 + 10 / 5 = 5 (midpoint)

20>12

First : 5 + 1 = 6
Mid : 6 + 10 / 2 = 16 / 2 = 8

20>18

Mid : 8 + 1 = 9

Implementing a binary search in steps:

1. Find the middle element of the array.

index(Middle) = index(low) + index(high – low)/2.

2. Check the target value to the search space's middle component.

You found the target value if the target equals the middle element. Return
the middle element's index to end the function.

Because the array is sorted in ascending order, if the target is smaller than
the middle element, you should remove all elements to its right and only
search along its left side. Until the target is located, repeat this step.

Because the array is sorted in ascending order, if the target is greater than
the middle element, reduce by half the search space by removing all

Computing Notes 5
elements to its left and going on the search on its right side.
Until the target is located, repeat this step.

3. Return -1 if there isn't a match in the array.

4.4 : Comparing a binary search to a linear search


🔬
Binary Search (pausing search / half-
Linear Search (continious)
interval search)

more complex than linear search straightforward and simple to implement

more efficient for large lists too slow for large lists

more no. of comparisons are needed if presented


no. of comparisons are less items are in later part of the array / its elemtns are
more.
works well with arrays. not on linked
works with arrays and linked lists.
lists

data should be sorted in order data can be in any order

accesses data randomly accesses data constantly

elements are looked up repeatedly divide-and-conquer methos is used to search


(one by one) elements

single and complicated


(multidimensional) arrays can be only simple structural (dimensional) array can be used
used

Unit 5 : Getting down and dirty with networks

5.1 : Internet protocol suite & Application layer


🍰
Communication protocol : set of online rules allowing data exchance between
computers.

Internet protocol suite : network model consisting of 4 layer communication


protocols.

Computing Notes 6
Application layer - handles, send and recieve data & information for
formatting and presentation

Transport layer - recieves individual data from the application later, divides it
into packets and passes them to Locan Area Network (LAN)

Internet layer - handles the logical addressing and management of data


packets

Network later - contains the drivers and hardware used to transfer data from
souce to destination.

STMP (Simple Mail Transfer Protocol) : communication protocol used for sending
emails over the internet. This protocol is mainly for e-mail clients to deliver
messages to the server and forward these to their final destination.

IMAP (Internet Message Access Protocol) : protocol use to get back emails from
mail server and leave a copy of the emails on the server, allowing multiple clients to
access the same email. Enable users to organize messages into folders, flag
messages for urgency or follow up, save draft messages on the server.

POP (Post Office Protocol) : protocol to download emails from mail serve, when
downloaded, emails are removed from the server and stored locally. Transfers
messages from e-mail server to e-mail client.

I QUIT. ‼‼‼ its already night time nad im EXHAUSTED

Computing Notes 7

You might also like