Flat file databases€¦ · Flat file databases A flat file database has all data is contained in...

22
Higher Computing Science Summary notes A database is a collection of data stored in a structured, organised manner. Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes) and records (rows or occurrences). Field Types Basic field types include: text, numeric, date, time. Other field types include: Object (a container) – can contain graphic, audio, video, etc. Link – contains a hyperlink. Calculation – contains a formula to calculate its contents from other data in the record. Automatic calculation of data reduces the chance of human error. Boolean – stores Yes/No or True/False. Summary – calculates data based on data from multiple records in database. For example, totals up the contents of a particular field across all records.

Transcript of Flat file databases€¦ · Flat file databases A flat file database has all data is contained in...

Page 1: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Higher Computing Science Summary notes

A database is a collection of data stored in a structured, organised manner.

Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes) and records (rows or occurrences).

Field Types Basic field types include: text, numeric, date, time. Other field types include:

Object (a container) – can contain graphic, audio, video, etc.

Link – contains a hyperlink.

Calculation – contains a formula to calculate its contents from other data in the record. Automatic calculation of data reduces the chance of human error.

Boolean – stores Yes/No or True/False.

Summary – calculates data based on data from multiple records in database. For example, totals up the contents of a particular field across all records.

Page 2: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Relational Databases Relational databases have two or more files linked together. Using linked tables reduces unnecessary duplication of data, therefore reducing the opportunity for error. Good database design avoids data duplication by using linked tables where appropriate and reduces errors in data entry by using suitable validation techniques.

Relationships There are 3 types of relationships between tables in a relational database. One-to-one (1:1) One record in the first table can only link to exactly one record in the second table. One-to-one relationships are rarely used, except as a means of splitting up a large, unwieldy table or treating part of a table differently (e.g. keeping some fields secure).

One-to-many (1:M) One record in the first table can link to two or more records in the second table. Each record in the second table can only be linked to exactly one record in the first table. This is the most common type of relationship.

Many-to-many (M:M) One record in the first table can link to two or more records in the second table. One record in the second table can also link to two or more records in the first table. Many-to-many relationships are usually undesirable in relational database design.

Example In a database with a Customers table linked to a Tickets table - one customer can

have many tickets, but each ticket may only have one customer.

Example

In a database with a Customer Details table linked to an Account Details table – one customer can only have one account, and vice versa.

However, the Customer Details table can be made available to all staff whilst the Account Details table could only be available to senior staff.

Example

In a database with a Pupils table linked to a Teachers table – one pupil can have many teachers, and vice versa.

Page 3: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Entity Relationship Diagrams Relationships can be represented graphically using an Entity-Relationship (ER) diagram.

There are many different notations for ER diagrams, we will use crow’s foot notation.

The names of entities are written in boxes joined by straight lines.

At the “many” end the line forks.

At the “one” end the line has a single line through it.

1. Draw your first box and enter the name of one of the tables that does NOT have a primary key.

2. Find the table which features the primary key from the first table as a foreign key. Enter this into the next box. 3. Repeat the process for the third and fourth boxes. 4. Fill in the crows feet, these will feature where ever there is a foreign key.

Customers Tickets

Page 4: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Keys A primary key is a field which is a unique identifier for each record. A file may have only one primary key. At the design stage, primary keys are usually identified by underlining. A foreign key is the primary key copied from another file, used to link two files. In order to create a link, the primary key from the “one” entity gets copied into the “many” entity as a foreign key. At the design stage, foreign keys are usually identified using an asterisk. A compound key is a key which consists of two or more fields in order to create a unique identifier. This is required when no single field can be used to uniquely identify a record.

Example

Litters (Litter ID Sire

Dame Number in litter

DOB)

Puppies (Puppy ID Puppy name

Sex Cost of puppy

Litter ID*)

Customers (Customer name Address

Puppy ID*)

There are 3 tables in this database.

The Litters table has Litter ID as a primary key.

The Puppies table has Puppy ID as a primary key. The Customers table uses Customer name and Address as a compound key.

Litter ID is a foreign key in the Puppies table.

This creates a one-to-many relationship between Litters and Puppies.

Puppy ID is a foreign key in the Customers table. This creates a one-to-many relationship between Puppies and Customers.

Page 5: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Field Validation Using appropriate validation reduces the chance of error when data is input. Various validation techniques can be used to ensure data is appropriate:

Presence check – ensures field cannot be left empty, good validation for a primary key.

Restricted choice – the user is presented with a list of options to choose from using a drop-down menu, option buttons or similar. This is often used for the input of data for a foreign key, by automatically generating the list of options from the linked file.

Length check – ensures an appropriate number of characters is input, e.g. minimum of 8 characters, maximum of 20.

Range check – used on numeric fields to ensure number is within certain range e.g. between 0 and 100.

Queries Queries allows the user to find information in a database. Users may perform simple queries looking at the contents of one field or complex queries looking at the contents of many fields. When answering exam questions always state what data is being searched for and which field it should be in.

Examples To find all the male pupils who are over 12 SEARCH for “male” in the Gender field AND >12 in

the Age field

To find all the people who live in Edinburgh or Glasgow

SEARCH for “Edinburgh” in the Town field OR “Glasgow” in the Town field

To find all the people born in the 1990s SEARCH for >31/12/89 in the DOB field AND <1/1/00 in the DOB field

Sorting Sorting puts database records in order based on the contents of particular fields.

Ascending order goes from A to Z, smallest number to largest number.

Descending order goes from Z to A, largest number to smallest number.

Examples Put the customers in alphabetical order SORT on Surname field in Ascending order then the

Forename field in Ascending order.

Find the tallest person in the database SORT on Height field in Descending order then look at the first record in the list.

Reports Reports allow the presentation of selected data from the database. The output can be customised in a variety of ways, including displaying only chosen fields and formatting the data in a particular way.

Page 6: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Only 4 of the 5 fields are included in

the report, salary is not required.

A header with a title has been added.

The forename and surname fields have

been given different headings.

The birth date field has been formatted

differently.

Different fonts have been used.

There is a footer with summary fields

which automatically calculate male and

female numbers.

Here is part of a table storing details about a company’s employees.

Forename Surname Gender Birth Date Salary

Nancy Davolio F 8/12/68 32800

Carol Paterson F 9/5/75 25000

Andrew Fuller M 19/2/52 43700

Joseph McDowall M 27/1/81 19500

Janet Leverling F 30/8/63 36000

Here is a report which has been produced to show details of all employees who earn more than £30000.

Page 7: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Forms Database creators can prepare forms layouts specially designed for inputting data, to help improve usability. A well laid-out form, using suitable techniques such as drop-down menus or checkboxes, reduces the typing required and makes data input easier and faster.

Data dictionaries A data dictionary is a design notation used to show the fields required in each table of a relational database, including field types, validation required, etc.

Examples

Table Field PK/FK Data

type/size Unique Required Validation Format

Pupils Pupil ID PK Text (30) Y Y Presence AB1234

DOB Date Y dd/mm/yy

School

name FK Text (40)

Look up

from

School

table

Schools School

name PK Text (40) Y Y

Restricted

choice

Address Text (11) Y Y

Page 8: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Media Types

Compression

Appropriate use of compression can reduce file sizes.

Small file sizes can be transmitted and processed more quickly. For example, a whole webpage can be compressed, reducing the amount of data which has to be sent to the client computer and therefore reducing the load time. The browser will decompress the page before displaying it. Individual media elements audio, graphics and video within the webpage could also be compressed in order to reduce the size further.

Lossless compression reduces file sizes without removing any data.

Lossy compression reduces file sizes by removing some data.

Audio Formats

MP3 (.mp3)

Lossy compression

Removes the very high or low frequencies that humans cannot hear. When two similar sounds (but different volume) occur at the same time,

removing the quieter one. User can choose the level of compression. A full compression MP3 compresses data to around 10% of the original

size, with relatively little loss of quality.

Audio File Size Calculations To calculate the file size (in bits) of an uncompressed audio file the basic formula is:

sample frequency (Hz) x sample depth (bits) x length (seconds) x number of channels

Sample frequency is the number of times per second that a sample of the original sound was taken. 1 Hz = once every second. 1 KHz = 1000 times every second.

Sample depth is the number of bits that were used to store each sample.

Length of sound should always be converted into seconds if necessary.

Number of channels is typically 1 (mono) or 2 (stereo), although it could be more for a surround sound file.

Calculate the file size of a mono voice recording captured at 24KHz with a sample depth of 8 bits, lasting for 15 seconds.

24000 x 8 x 15 x 1 = 2880000 bits 2880000 / 8 = 360000 bytes 360000 / 1024 = 351.56 KB

Page 9: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Graphic Formats

JPEG (.jpg) Lossy compression

24 bit colour.

Allows the user to select an appropriate level of compression.

JPEG is a good compression format for high-quality images and images where quality is unimportant (e.g. thumbnails).

PNG (.png) Lossless compression

Intended to improve upon GIF format.

24 bit colour.

Allows user to set alpha level for improved transparency.

GIF (.gif) Lossless compression

Restricted to 8 bit colour.

Uses LZW algorithm to compress data.

Several images can be stored in one GIF file, allowing for animation.

Allows a specific colour in an image to be made transparent.

GIF is a good compression format for images with areas of flat colour, images that have few colours, animated images or images that require transparency.

RLE (Run Length Encoding) is a lossless compression algorithm.

It works by taking runs of the same colour and storing them as two numbers: how many pixels and colour code of this run of pixels.

RLE works best for images with large blocks of the same colour.

If an image has many different colours (e.g. a photo) RLE could potentially end up increasing the file size!

LZW (Lempel Ziv Welch) is a lossless compression method which is more effective than RLE.

It works by looking for repeated patterns of bits within data, stores them in a dictionary, then replaces them with references to the dictionary.

Indexed colour involves storing the actual RGB codes used by the image in a separate colour palette, in order to reduce file size. This can be used as a compression technique where the bit depth of the graphic is less than 24.

Page 10: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Graphic file size calculations To calculate the file size (in bits) of a bitmap graphic file the basic formula is:

number of pixels in image x bit depth

Bit depth or colour depth is the number of bits that were used to store the colour of each pixel.

Example 1

Calculate the file size of a 400 x 400 pixel graphic with a colour depth of 24.

400 x 400 = 160000 pixels in the image 160000 x 24 = 3840000 bits 3840000 / 8 = 480000 bytes 480000 / 1024 = 468.75 KB

Example 2

Calculate the file size of a 300 x 200 graphic with 256 colours.

256 colours means a colour depth of 8 (because 28 = 256) 300 x 200 = 60000 pixels in the image 60000 x 8 = 480000 bits 480000 / 8 = 60000 bytes 60000 / 1024 = 58.6 KB

Example 3

Calculate the file size of a 6’ x 5’ image, scanned at 200dpi, with 16 bit colour.

6 x 5 x 200 x 200 = 1200000 pixels in image 1200000 x 16 = 19200000 bits 19200000 / 8 = 2400000 bytes 2400000 / 1024 = 2343.75 KB 2343.75 / 1024 = 2.3 MB

Page 11: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Video Formats

MPEG (.mp4)

Lossy compression

The level of compression can be determined by the user.

Key frames (individual still images) are compressed and stored as JPEGs – generally only one full frame in every 8 to 24 frames needs to be stored.

Any data that stays the same beyond the key frame does not need to be stored. Changes to the image in each subsequent frame are then stored.

AVI (.avi) No compression built-in

Limited to 320 x 240 resolution

Limited to 30 frames per second

Can take up a large amount of storage space and can be quite RAM intensive.

Video file size calculations To calculate the file size (in bits) of an uncompressed video file the basic formula is:

number of pixels in frame x bit depth x frame rate (fps) x length of video (in seconds)

A video is simply a series of bitmap images, so this rule simply multiplies the size of one image by the number of images in the video.

Calculate the file size of a 300 x 250 pixel video, using 16 bit colour, 30 frames per second and lasting 30 seconds.

300 x 250 = 75000 pixels 75000 x 16 = 1200000 bits for 1 image 1200000 x 30 = 36000000 bits for 1 second of video 36000000 x 30 = 1080000000 bits for entire video /8 = 135000000 bytes /1024 = 131835.94 KB /1024 = 128.75 MB

Page 12: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Security / Legal implications / Environment

Legal Implications There are four areas of the law which you must be able to give a basic description of. Computer Misuse Act - Protects against criminals who perform destructive acts on computer systems.

Makes it illegal to spread computer viruses.

Makes it illegal to access computer systems without permission i.e. hacking. Copyright, Designs and Patents Act - Protects the rights of people who create original content.

Makes it illegal to use, copy or adapt software, music, video, manuscripts, etc without permission of the creator.

Communications Act - Covers acceptable use of communications technology such as the internet or mobile phones. Actions which are made illegal by this law include:

Send messages or material that are offensive/upsetting i.e. cyberbullying

Dishonestly obtaining internet access e.g. using another person’s wi-fi without consent

Unauthorised interception of communications e.g. phone hacking Regulation of Investigatory Powers Act RIPA - Allows certain organisations e.g. the police, local councils, MI5 to intercept data, access password protected data and carry out surveillance for the purposes of crime prevention.

Protects individuals’ rights to privacy.

ISPs must be prepared to provide data to authorised bodies if request to do so.

Refusing to provide keys to access encrypted data can lead to a jail sentence.

Environmental Implications Environmental benefits of computers

Global climate analysis, forecasting and modelling

Informing and educating general public

Reducing need for travel – easy communication across the globe Lifetime carbon footprint A measure of how much carbon dioxide is produced in the manufacturing, use, and disposal of computing equipment.

Page 13: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Security Risks Some of the risks associated with using computers and the WWW include:

Spyware Programs which tries to gather personal information from your computer.

Phishing A fraudulent attempt to get personal information or passwords by pretending to be a genuine organisation. Lookout for poor grammar, suspicious attachments, links which ask for passwords, etc.

Keylogging A program which monitors every keypress, often used to steal passwords, credit card numbers, etc.

Online fraud Using the internet to unlawfully obtain money or property.

Identity theft Stealing personal details and pretending to be somebody else.

Denial of Service (DOS) attacks

Flooding a web server with a large number of requests so the webpages stored on it become unavailable to legitimate users.

Security Precautions There are a variety of procedures which can be put in place to reduce the risk of security breaches.

Encryption Encoding data before it is stored or transmitted. The data must then be decrypted using the correct key before it can be understood. If data is intercepted it cannot be easily deciphered.

Digital signatures Uses encryption methods as a way of authenticating data so that the recipient can be sure it has not been altered or tampered with.

Digital certificate

An electronic document used to prove that the person sending data is who they claim to be.

A padlock icon in the address bar of your browser shows that the website has a digital certificate so you can be sure that you’re dealing with a genuine website.

Server-side validation of online form data

Online forms allow you to enter data into a website, such as a username and password. Server-side validation means that your login details are stored on the web server. The username and password you input will be compared to the details held on the server and, if they match, the server will send your account data to your computer.

Biometrics in industry Biometrics (using unique characteristics as identification, such as fingerprint, iris or voice) is increasingly popular in industry. E.g. banks using fingerprint recognition, facial recognition at airports, etc.

Page 14: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Economic Impact

Competitive advantage Dynamic websites and social networking can give businesses an advantage over their competitors.

Global marketplace

Businesses now have access to, and are able to cater for, customers across the globe.

Business costs

Costs involved in setting up a business have changed – no need for expensive premises, it is cheap to set up an e-commerce site.

Maintainability

Quickly updatable, database-driven websites, make it easy to upgrade prices, put on special offers or change branding to suit business needs.

Scalability

It can be easy for businesses to adjust according to a changing customer base, high street premises are not a requirement.

Social Impact

Censorship and freedom of speech

Anybody can make their views heard online but some governments may try to impose censorship on content which is acceptable elsewhere.

Privacy and encryption Huge amounts of data about individuals are stored and shared readily, leading to concerns about invasion of privacy and the need for encryption by all data users.

Global citizenship Online communities and a breaking down of international barriers has led to the idea of the global citizen, somebody who is aware of their responsibilities and impact upon the planet as a whole.

Online communities Online communities allow people from anywhere in the world to interact and collaborate.

Page 15: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Web Design Design The structure of a website can be planned using a site map. This will show how the pages in the site link together, usually in a hierarchical structure.

The layout of individual pages can be planned using wireframes. These will show how text, graphics, links, etc will fit together on the page. You may also consider noting formatting information, such as colours and fonts to be used. Multi Level Structure

A multi-level navigation structure involves sub-levels of navigation.

It can be useful for keeping websites with a lot of information organised. For example, the BBC website, allows you to choose a category, then another category within that, then another category within that, and so on.

Level 1

Level 2

Level 3

Page 16: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

HyperText Markup Language HTML is a language used to define the content of a webpage, using a variety of tags.

An HTML page begins with the <head> element. This can include a variety of other elements which give information about the page, such as the title, meta information, location of style sheets, etc.

After the <head> comes the <body>. The <body> element contains the content to be displayed. Some more advanced HTML tags you should know:

Tag Notes Example

<title> Included in the <head> element of the page.

Defines a title in the browser toolbar

Displays a title for the page in search engine results

Provides a title for the page when it is added to favourites

<title> ACME Corporation home page </title>

<meta> Included in the <head> element of the page.

Provides information about the page, not visible in the browser.

There is no ending </meta> tag.

Example 1 <meta name=”description” content=”ACME Corporation – Unlikely contraptions for all your needs”> Example 2 <meta name=”keywords” content=”ACME, inventions, traps, contraptions”>

<style> Allows CSS (see below) styles to be defined within an HTML document

Included in the <head> element of the page.

<style> p { margin-left:20px; } body { background-image:url("background.gif"); } </style>

<script> Used to define a client-side script (see below), such as JavaScript.

Alternatively, can provide a link to an external script file.

Example 1 <script> document.write("Hello World!") </script> Example 2 <script src=”js/lightbox.js”> </script>

<button> Used to create a clickable button <button type="button">Click Me!</button>

Page 17: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

CSS Cascading Style Sheets CSS is a language used to define the look and formatting of HTML documents. CSS can be included within an HTML document, but it is preferable to link the HTML to a separate CSS file. Using a separate CSS to define the formatting of HTML documents can help to give a consistent look across a website, save time and create more efficient code. The look of all pages in a site can be changed by editing only the CSS file.

CSS can be used to provide different style rules depending on the type of device being used to view the webpage. The rules of cascading stylesheets state that: embedded styles within the text over-rule all others document level styles, defined in the document , over-rule external Stylesheets external stylesheets only apply if they are not over-ruled by the other 2 methods

body { background-color:#d0e4fe; } h1 { color:orange; font-weight:bold; } p { font-family:"Times New Roman"; font-size:20px; }

This CSS sets the background colour for the body of the page, the colour and style of any text within <h1> tags, and the font and size of any text within <p>. Any HTML file which is to use this formatting would simply include a line like this in the <head> section: <link rel="stylesheet" type="text/css" href="mystyle.css"> Where “mystyle.css” is replaced with the name of the CSS file.

Static Webpages A static webpage looks exactly the same every time it is accessed, the content does not change.

Dynamic Webpages Dynamic webpages can contain different content depending on the conditions in which they are accessed, meaning that users can be presented with a page relating specifically to their needs. Database-driven pages are the most common example of dynamic pages. If information changes in a database which the page accesses, then the content of the page will change to reflect this. For example, online shopping, banking, buying tickets, etc.

Page 18: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Interactive Webpages Interactive webpages offer a more immersive experience, allowing the user’s actions to affect the content. Creating interactive pages usually involves the use of JavaScript or Flash.

Scripting Including sections of program code in your website, to help make it more dynamic or interactive, is called scripting.

Client-side scripting

A section of code is sent to the client computer and executed there, in the browser.

It is commonly used to add interactive elements to a webpage.

JavaScript is a language commonly used for client-side scripting.

Server-side scripting A section of code is executed by the web server.

It is commonly used to create dynamic webpages, often connected to a database on the server.

Popular languages for server-side scripting include PHP, ASP, Perl and ColdFusion.

JavaScript JavaScript is a scripting language used to control the behaviour of webpages.

It can be used to change HTML elements. E.g. Change an image when it is clicked.

It can be used to change CSS styles. E.g. Change the colour of the page when a button is clicked.

It can be used to validate user input. E.g. Asking the user to create a password and checking if it is valid

Scripts can be included in the <head> element of a page, then referred to at any point in the <body>

Alternatively, the entire script can be included at the appropriate point in the body.

Where a script is used many times throughout a website it is most efficient to put it in an external file, then link each page to it using the <script> tag.

Examples

if (time < 20) { greeting = "Good day"; } else { greeting = "Good evening"; }

This script displays a message depending on the hour of the current time.

document.getElementById("demo").innerHTML = "Hello Dolly.";

This script changes the content of an HTML element with the ID “demo”.

Page 19: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

PHP - PHP Hypertext Pre-processor PHP is a server-side scripting language used to create dynamic and database-driven webpages (in conjunction with SQL).

A PHP script is executed on the server but any output can be returned to the browser in a variety of forms, such as HTML, images or PDF.

To use PHP in your webpages, you must find web hosting which supports PHP and MySQL.

PHP files can contain HTML, CSS and JavaScript, as well as PHP.

PHP scripts begin with <?php and end with ?> Examples

<?php $t=date("H"); if ($t<"20") { echo "Have a good day!"; } ?>

This script displays a message if the hour of the current time is less than 20.

<?php setcookie("user", "Alex Porter", time()+3600); ?>

This script saves a cookie to the user’s computer.

SQL Structured Query Language SQL is a language used to access and manipulate databases.

It allows you to add/delete/amend records and fields, search records and sort records.

It is used in conjunction with a server-side language, like PHP, to create database-driven websites. Examples

SELECT CustomerName,City FROM Customers; Shows only the CustomerName and City fields from the Customers table.

SELECT * FROM Customers WHERE Country='Mexico';

Shows only the records from the Customers table which have “Mexico” in the Country field.

SELECT * FROM Customers ORDER BY Country ASC;

Shows all the records from the Customers table in ascending order by Country.

Page 20: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Compression Appropriate use of compression can reduce the load times of webpages. The webpage itself can be compressed, reducing the amount of data which has to be sent to the client computer. The browser will decompress the page before displaying it.

Lossless compression Lossless compression reduces file sizes without removing any data.

PNG Graphics 24 bit colour, transparency

GIF Graphics Restricted to 8 bit colour, basic transparency, animation

Lossy compression Lossy compression reduces file sizes by removing some data.

JPEG Graphics 24 bit colour, adjustable compression level

MP3 Audio Removes sounds outwith human hearing

MP4 Video Stores keyframes and only the changes in between them

SEO (Search Engine Optimisation) SEO is the process of improving the ranking of your webpage in search engine results, in order to increase traffic. Some SEO techniques include:

Making sure each page of your site has a unique, concise and descriptive title contained in the <title> tag.

Using the description <meta> tag to include a summary of each page.

Using concise URLs.

Submit an XML sitemap to the companies which run the search engines

Using brief, descriptive filenames and alt text for images

Search engines and web crawlers

A web crawler (aka spider) is a piece of software which follows links from web page to web page, analyses the text on each page, and indexes the pages with related keywords.

Search engines then use this index to find relevant pages when you carry out a search.

Optimisation of code Load times of webpages affect traffic. By making code more efficient, file sizes, and therefore load times, can be reduced. Some techniques include:

Using a single CSS file to hold all the formatting information for the site.

Putting all JavaScript into a single external file, to reduce fetches from the server.

Remove/reduce internal commentary and white space.

Page 21: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Accessibility Web accessibility means making sure that all users can easily access and navigate your website. Some ways in which accessibility can be improved include:

Using CSS media queries to identify the type of device accessing the webpage, and adjust display accordingly.

Using appropriate alt text for images, as these can be read by reader software.

Make all functionality accessible from the keyboard.

Make all text content easily readable and understandable.

Usability Usability refers to how easy your website is to use. Some ways in which usability can be improved include:

Making main navigation easily identifiable, with easily identifiable links.

Using consistent style throughout.

Ensuring the most important content is above the “fold” (the point where the bottom of the screen cuts off the page).

Including a clear path to contact details and information about the organisation.

Beta testing Beta testers carry out testing on the final website before it goes live. Beta testers could be anybody not involved in the development of the site, such as potential customers. The purpose of beta testing is to identify any problems that occur in normal use.

Usability testing Usability testing involves testing how easy the website is to use. Eye-tracking

Eye tracking software and hardware allows testers to analyse the way in which a user reads the information on a webpage.

This can help in adjusting the layout to focus attention on the most important information. Think aloud

Think aloud testing involves users describing their thought process as they try to complete a task on a website.

This can help in identifying design issues which may cause problems for users.

Page 22: Flat file databases€¦ · Flat file databases A flat file database has all data is contained in one file (a table or entity). Data is organised into fields (columns or attributes)

Backup Strategy Storage - kept off-site in a secure safe location, each version clearly labelled, frequency of at least daily. Recovery - recovery requires last full backup and following incremental backups to be loaded. Rotation - One set of tapes kept in one location to cover a week, fortnight or month and another set of tapes kept in a different location to be used for the next period and a third set for the next period before reverting to the first set. Frequency any time there is a change or regularly once a month / end of every day. Storage (multiple) tape or DAT tape or another external hard drive mirror drive one copy off-site Version Control 3 copies (GrandFather/Father/Son) Distinction between full back up and incremental all new data since the last back up of any type, differential – all data since the last full backup. Archive permanent copy from a monthly full backup/ grandparent not intended for recovery recovery using most recent (full) backup and all subsequent incremental backups backup storage tape – (magnetic or DAT), USB/external/portable HDD, stored in fire-proof safe, stored off-site

Client Side Scripting • Should be faster than server side scripting • Validation/Error trapping is improved • Individual fields can be checked rather than waiting for form to be submitted. • Less load on server/doesn’t affect server performance

PGP This method involves the use of keys, a public key and a private key A public key is freely available to everyone on the Internet and is used to encrypt the message A private key is secure and is used to decipher the message.