1.3.2 Databases Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How to achieve first normal form

A

Data should be Atomic – i.e. cannot be broken down further. Therefore there must be:
There are no columns with repeated or similar data
Each row is unique i.e. it has a primary key
Each field has an unique name
atomic does not mean ‘single word’. It simply means that it would make no sense to reduce the data item any further as it would lose its meaning.
i.e. Chipping Campden School is a valid, atomic school name even though it contains three words

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

How to achieve second normal form

A

Only applies to tables with a COMPOUND KEY
If there is a single primary key that table is already in 2NF
For tables with a COMPOUND KEY, every non key attribute must depend on the WHOLE KEY.

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

How to achieve third normal form

A

Attributes must already be in 2NF. There are no non-key attributes that depend on other non key attributes
What this is trying to do is to spot yet another source of redundant data. If the value of an attribute can be obtained by simply making use of another attribute in the table, then it does not need to be there. Loading that attribute into another table and linking to it will make the database smaller.

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

Why is data normalised

A

The database does not have redundant data, it is smaller in size so less money needs to be spent on storage
Because there is less data to search through, it is much faster to run a query on the data
Because there is no data duplication there is better data integrity and less risk of mistakes.
Because there is no data duplication there is less chance of storing two or more different copies of the data
One change can be made which can instantly be cascaded across any related records.

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

Name the problems with normalisation

A

You need to be careful with trying to make data atomic. Just because you can split some types of data further, it isn’t always necessarily the correct thing to do. For example, telephone number might contain the code followed by the number 01234 567890. It wouldn’t be sensible to separate out these two items.
You can end up with more tables than an unnormalised database
The more tables and the more complex the database, the slower queries can be to run
It is necessary to assign more relationships to interact with larger numbers of tables
With more tables, setting up queries can become more complex

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

Name the types of keys used in data bases.

A

The Primary key which is a unique identifier

A foreign key forms a link between entities

A compound key can be formed from two or more entities to make a unique record

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

What does DBMS

A

Data base management system

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

What is DBMS used for

A

This is a tool to manage a database

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

What are some of the key features DBMS

A

A command language that allows you to create, delete and alter the database (data description language or DDL)
A way of documenting all the internal structures that make up the database (data dictionary)
A language to support the manipulation and processing of the data (data manipulation language or DML)
Support the ability to view the database from different viewpoints according to the requirements of the user
Provide some level of security and access control to the data

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

Define Data dictionaries

A

A ‘data dictionary’ describes the structure and attributes of data ‘items’ to be used within a software application (usually a database).

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

Name the main features of a Data dictionaries

A

A data dictionary includes the names and descriptions of the entites (tables) and the attributes (fields) contained in each table. It also documents information about the data type, field length and other things such as validation.
The main purpose of the data dictionary is to provide metadata, or information about data. Technically, it is a database about a database.
There is no one set standard in terms of layout or the level of detail to which a data dictionary should be written.
Software development teams need a comprehensive data dictionary to refer to during the development and maintenance of a new database. This is so that they are all working using the same data formats when reading or writing data.

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

Define DML

A

Data manipulation language

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

What is the use of DML

A

The language is used in the manipulation of the data such as inserting deleting

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

Name some of the key functions of DML

A

Insert
Delete
Update
Process data

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

Define DDL

A

Data description language

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

What is the use of DDL

A

One of the basic functions of a RDBMS is to provide a method of creating a database from scratch

17
Q

Name some of the key functions of DDL

A
The language allows tables to be defined in terms of :
Field names
Data type
Data size / length
Validation rules
Default values
Presence check
Auto incrementing requirement
Indexing requirement
Primary key
18
Q

What is the name of the structure used in databases

A

There are three fundamental views and they are useful to different groups of people. It is called the three-level architecture schema.

19
Q

Name the three types of views

A

Internal or physical view

Conceptual views

External views

20
Q

How does external view work

A

This view exposes all the internal details of how the data is stored on the physical computer. For example the data structures used in memory, the nature of the indexes used for searching, what physical devices are used to store the database and so on.
At this level the operating system is interacting with the database.

21
Q

How does Conceptual view work

A

At this level, there is no concern about the physical nature of the database, but rather the concept behind the database. It shows:
a model of all the information within the database the kind of records it holds the type of authorisation and validation methods used.This is the kind of view the database designer is using to set out the whole database

22
Q

How does External view work

A

This view sets out what an authorised user can see of the database. It sets out the data they are allowed to see and their authority level to change the records. For example consider a bank database.

23
Q

Define SQL

A

Structured Query Language

24
Q

What are the main uses of SQL

A

Some RDBMS may have some custom SQL extensions peculiar to itself but it will support all the standard functionality that ANSI compliant SQL offers.
There are many commercial RDBMS such as Oracle and DB2 and there are free open source RDBMS available such as MySQL

25
Q

Give some examples of SQL

A

SELECT {fields to be extracted} FROM {table}

SELECT * FROM ‘customers’;

SELECT * FROM customers

WHERE CustID=2;

DELETE FROM ‘customers’ WHERE CustID = 1;