Database Design and Development Flashcards

1
Q

What is a surrogate key?

A

‘made up’ key to uniquely identify each record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you validate in a data dictionary?

A

length, range, restricted choice, existing fieldname from tablename table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Code a new database and table with each variable type and a PK and FK

A

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,

);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe an entity occurrence diagram

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to draw an entity occurrence diagram

A

Tall ovals, headings and lines —> shows relationship

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe an entity relationship diagram

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to draw an entity relationship diagram

A

Labelled rectangles, labelled line, crows feet for many

How well did you know this?
1
Not at all
2
3
4
5
Perfectly