OCR A-Level Computer Science Spec Notes - 1.3 Summarized
OCR A-Level Computer Science Spec Notes - 1.3 Summarized
1.3.2 Databases
(a) Flat file and relational databases
Databases: Structured & Persistent stores of data for ease of processing
- Allow data to be: Retrieved quickly/updated easily/filtered for different views
Flat file Databases
- Simple data structures which are easy to maintain (limited data storage)
- Limited use due to redundant/inconsistent data
- No specialist knowledge to operate
- Harder to update & data format is difficult to change
Relational Databases
- Based on linked tables (relations)
- Based on entities (Rows & Columns)
- Each row (tuple) in a table is equivalent to a record and is constructed in the same way.
- Each column (attribute) is equivalent to a field and must have just one data type.
- Improves data consistency & integrity
- Easier to change data format & update records
- Improves levels of security so easier to access data
- Reduces data redundancy to avoid wasting storage
Entity Relationships
- Used to plan RDB
- Diagrams to show relation
- Helpful in reducing redundancy
One-One Relationship
- Not suitable for relationship tables
One-Many Relationship
- Used in well designed RBS
Many-Many Relationship
- Leads to data redundancy
Indexing
- The PK is normally indexed for quick access.
- The SK is an alternative index allowing for faster searches based on different attributes.
- The index takes up extra space in the database.
- When a data table is changed, the indexes have to be rebuilt.
Serial files
- Are relatively short and simple files.
- Data records are stored chronologically i.e. in the order in which they are entered.
- New data is always appended to the existing records at the end of the file.
- To access a record, you search from the first item and read each preceding item.
- Easy to implement.
- Adding new records is easy.
- Searching is easy but slow.
Sequential files
- Are serial files where the data in the file is ordered logically according to a key field in
the record.
Indexed sequential files
- Records are sorted according to a PK
- A separate index is kept that allows groups or blocks of records to be accessed directly
and quickly
- New records need to be inserted in the correct position and the index has to be
maintained and updated to be kept in sync with the data
- Is more difficult the manage but accessing individual files is much faster
- More space efficient
- More suited to large files
Database Management System (DBMS)
- Is software that creates, maintains and handles the complexities of managing a
database.
- May provide UI.
- May use SQL to communicate with other programs.
- Provides different views of the data for different users.
- Provides security features.
- Finds, adds and updates data.
- Maintains indexes.
- Enforces referential integrity and data integrity rules.
- Manages access rights.
- Provides the means to create the database structures: queries, views, tables, interfaces
and outputs.
Queries
- Isolate and display a subset of data.
- QBE: query by example.
There are multiple ways to capture/select/manage/exchange data based on the scenario and
what needs to be obtained. For example, a hotel would want the guests information so they can
process payments.
DROP Remove database components (ALTER TABLE can be used to delete column):
ALTER TABLE green DROP COLUMN name;
1.3.3 Networks
(a) Characteristics of a networks, importance of protocols/standards
Network: interconnected set of devices
Frame: A unit of data sent on a network
Private Networks
Advantages Disadvantages
- Ring
● Nodes attached to exactly 2 other nodes
● Data sent in 1 direction to avoid collisions
● Easily disrupted
- Star
● Most networks are star layouts
● Resilient
● Speratrate link from each node to switch/hub
Standards/protocols- Set of rules relating to the communication of devices & data transmitted
between them:
- Examples: TCP/IP stack
Open Systems Interconnection (OSI) model
- An openly available (non-proprietary) network model.
7 layers in the OSI model:
● 7 – Application: collecting and delivering data in the real world.
● 6 – Presentation: data conversions.
● 5 – Session: manages connections.
● 4 – Transport: packetizing and checking.
● 3 – Network: transmission of packets, routing.
● 2 – Data Link: access control, error detection and correction.
● 1 – Physical: network devices and media.
Link (2) Passes data onto physical network (Copper wire/optical fibre/wireless)
- Divides message into data units called - Exclusive dedicated channel which
packets physically connects devices together
- Sent across the most efficient route - Suitable for intensive data transfer
(Not predetermined)
- Packets arrive out of order ( reordered - All packets go on same route in order
at destination)
Peer-Peer Server
- All computers = equal status
- Computers can act as client &/ server
- Useful on internet so traffic can avoid servers
- Cheaper as its private so no expensive hardware/bandwidth needed
- More likely to be fault tolerant
Standards: Set of guidelines used universally so all computers can access the same resources.
Examples of standards
● HTML (Hyper Text Markup Language)
- Create web pages & elements
- Has tags: Mark out elements on page to show browser how to process element
- Links: redirects user from current page to page referred by link
● CSS (Cascading Style Sheets)
- Determines how tags affect objects
- Used to standardise an appearance of a webpage
- Changes made can affect whole site instead of one page
- Content and formatting are kept separate
- Simpler HTML used as CSS can be used in multiple files
- Adjustable for different devices
● JavaScript
- Programing language which runs on browsers & controls elements
- Embedded into HTML with <script> tags to add functionality such as:
● Validation/animation/Newer content
- Used on client side = less strain on server & server side as it can be amended
- Can run on any browser (normally interpreted)
- High security: data sent to server for - Extra load on the server makes running
processing then sent back the server more expensive
Client Side Processing: Processing that takes place on the web browser
Pros Cons
Is best used when it’s not critical code that runs. If it is critical then it should be carried out on
the server. Is also best where quick feedback to the user is needed – an example being games.