Databases (A2)

Wikipedia Entity Relationship Models SQL
SQLite SQLite SQLite Tutorial
W3 Schools    
    SQLite & PHP
MySQL Video Tutorial MySQL Reference  
Access ADO 1 ADO 2

Conceptual Data Modelling

Requirements analysis: describe information needs: the type of information that will be stored in a database. Film.

Film: Conceptual Data Modelling: entities, attributes, relationships, cardinality.

Entity: things about which information is stored.

Attributes: properties of the entities (fields)

Relationships: links between entities; named with a verb

Cardinality: number of instances of one entity that relate to instances of the other

DBMS

DBMS: Database Management System. This replaced separate departmental file systems providing an integrated information facility across an organisation. This removed duplication and inconsistencies between departments and facilitated sharing of data. Features of DBMS include indexing for faster retrieval, verification and validation, reporting.

Relational Databases

Relational database (RDBMS) is based on work of E.F. Codd of IBM and uses set theory to reduce duplication. Features: tables of data with rows or 'tuples' as the records; primary key, one or more keys to identify a row (record); foreign key, a primary key in another table - the means by which tables are related.

Relation:

Attribute:

Tuple:

Table:

Schema:

Referential integrity:

Normalisation:

1NF: Atomic data, no repeating groups

2NF: 1NF plus no partial key dependencies (for a composite key)

3NF: 2NF plus no non-key dependencies

Queries are a key part of all DBMSs. One approach is Query by Example (QBE), the graphical method seen in Access which needs no code. Another approach is by a query language such as Structured Query Language (SQL), which underlies many modern DBMSs.

Homework:

Install XAMMP.  Now work through the following:

XAMMP Setup PHP PHP
PHP.net SQLite & PHP SQLite PHP Tutorial
MySQL for Beginners MySQL SQL