Database Design and Development Flashcards
What is a surrogate key?
‘made up’ key to uniquely identify each record
How can you validate in a data dictionary?
length, range, restricted choice, existing fieldname from tablename table
Code a new database and table with each variable type and a PK and FK
CREATE DATABASE name;
CREATE TABLE name ( fieldname1 VARCHAR(20), fieldname2 INT, fieldname3 FLOAT, fieldname4 DATE, fieldname5 TIME,
PRIMARY KEY(fieldname), FOREIGN KEY (fieldname) REFERENCES table fieldname,
);
Describe an entity occurrence diagram
Illustrates the relationship between the entity occurrence between two related occurrences in an entity. Helps to identify the cardinality of the relationship that exists between the two entities.
How to draw an entity occurrence diagram
Tall ovals, headings and lines —> shows relationship
Describe an entity relationship diagram
Used to summarise the relationship between two or more entities.
- name of each entity
- name of relationship
- the cardinality (one-to-one, one-to-many, many-to-one, many-to-many)
- show participation (mandatory = -, optional = o)
- show type (weak = depends on 1+ strong entity to exist, primary key is partially formed from pk of owner entity. strong = independent, their pk uniquely identifies each occurrence within the entity)
How to draw an entity relationship diagram
Labelled rectangles, labelled line, crows feet for many