Database Modelling: Tables Flashcards

1
Q

What is a schema?

A

This is the formal description of our database

This includes; columns, tables, keys, values etc.

Very important to plan schema to ensure smooth sailing from the very start of the database being online

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

Questions to ask when starting database schema?

A
  1. What’s the point? Be specific and ensure you understand the INTENTION of the database! What problem does the database solve?
  2. What do you already have? Is there any infrastructure that is to be replaced or worked on top of/with? Are there any people and resources that you need or already have to help with the development of database?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

First REAL question to ask when designing database?

A
  1. What entities will we have? Which objects need to be represented with a table. E.g. customers, oders, products, authros, employess. Use the most basic and simple words at the beginning
    NOTE: When naming tables based on these entities EITHER use singular (preferred) or plural
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are out main concerns with our database?

A
  1. Which entities we will have
  2. How we will represent these entities
  3. How we will draw relationships between these entities and their representations.

NOTE: This is known as entity-relationship modelling

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

What is our second question to ask?

A

What are our attributes that we will assign to each entity?

Attributes can start relatively simple at the start of planning BUT they should be specific.
Have to determine a naming convention for each of the attributes AND STAY CONSISTENT

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

Once entities and attributes have been determined, what is the next step?

A

Determine the data types for each attributes. Data types should be specific as DBMS require these to be specified.

E.g. character, date, integer, binary (audio, video, images) etc.

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

What are BLOBs?

A

These are Binary Large Objects

These are data types that include images, videos and audio

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

What are CLOBs?

A

These are Character Large Objects

These are data types that contain large sums of strings/text/characters

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

What is a NULL value?

A

A NULL value states that there is a complete absence of a value within a table. Different from just zero.

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

Choosing a primary key?

A

Primmary keys need to be added to tables to allow us to search for rows. They should be unique values to prevent confusion

Primary keys can be natural (an inherently unique value that is already an attribute in the table) OR can be synthetic (randomly generated number / unique value which ONLY acts as a primary key)

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

What is a composite key?

A

This is when we use two OR more values within a table to create a unique primary key.

Can be used when joining tables together with a junction/linking table to form many-to-many relationships

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