8 - data bases Flashcards

1
Q

database

A

structured collection of items of data that can be accessed by different applications programs

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

table

A

group of similar data withe rows and columns

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

record

A

a row - one instance if an entity (tuple)

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

tuple

A

a row - one instance if an entity (record)

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

field

A

column - data item stored for an entity eg name (attribute)

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

entity

A

anything that can have data stored about it eg person place thing

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

attribute

A

column - data item stored for an entity eg name (field)

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

cadidate key

A

the smallest number of attributes where no row has the same value (all unique)

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

primary key

A

unique identifier of a table

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

secondary key

A

alternative to the primary key

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

foreign key

A

set of attributes that refer to another tables primary key

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

relationship

A

one table in a database has a foreign key that refers to a primary key in another table in the database
1:1
1:m
m:1
m:m
(the many always has the foreign key)

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

referential integrity

A

database doesn’t contain any values of foreign key that don’t match the corresponding primary key

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

index

A

a data structure built from one or more columns in a database table to speed up searching

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

ER diagram

A

a graphical representation of a database and the relationships between

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

normalisation

A

the process of organising data to be stored in a database into 2 or more tables and relationships between the tables (redundancy is reduces)

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

1NF

A
  • data is atomic - cant be split further
  • no repeating attributes
  • each table has a primary key
  • each field name is unique
18
Q

2NF

A
  • must be 1NF
  • remove partial key dependencies - where an attribute in a table depends on only a part of the primary key not the whole key
19
Q

3NF

A
  • already in 2NF
  • remove transitive dependencies - where non key attribute depends on another non key attribute
20
Q

composite key

A

set of attributes that form a primary key to provide a unique identifier for a table

21
Q

limitations of file based approach

A
  • redundancy - storage space wasted when data is duplicated by separate applications
  • inconsistency - data is altered by one application and not another
  • dependencies - enquires can depend on the structure of data and software used
22
Q

+ of relational databases

A

+ no redundancy - storage space not wasted as data only stored once
+ no inconsistencies - data altered in one app is available in another
+ independent - enquires arent dependent on the structure of the data and software

23
Q

DBMS

A

system software for the definition, creation and manipulation of a database

24
Q

how DBMS fixes file based approach

A
  • redundancy - data is stored in separate tables - flags errors when keys are deleted or data is repeated
  • inconsistency - stores most items once - allowing updates to be seen by all apps
  • dependency - each app only has access to what it requires - DBMS has facilities to query data
25
DBMS features
- data management - data dictionary - data modelling - data security - data integrity
26
data management
organisation and maintenance of data in a database to provide info required - entry, storage, alteration, deletion of data
27
data dictionary
a set of data that contains metadata for a database - definition of tables, attributes, relationships between tables and indexing or validation rules or data about the physical storage
28
data modelling
the analysis and definition of data structures required to produce a data model - shows struture by ER diagrams
29
logical schema
a data model for a specific database that is independent of the DBMS used to build that database
30
data security
- passwords - access rights - backup - encryption - creates audit trail/ activity log (to record actions by users)
31
DBMS software tools
- developer interfaces - query processor
32
developer interface
allows a developer to write queries in SQL rather than query by query
33
SQL
structured query language standard query lang used with relational databases for data definition and data modification
34
query processor
takes an SQL query and processes it includes a DDL interpreter, DML compiler and query evaluation engines
35
DDL
- used to create, modify and remove data structures DDL statements are interpreted and recorded in the data dictionary
36
DML
- used to add, modify delete and retrieve data in a relational database DML is compiled into low-level instructions and executed by the query evaluation engine- the query is optimised
37
DDL data types
- character - fixed length eg 5 - varchar(n) - variable length up to max - boolean - integer - real - date - time
38
DDL statements
- CREATE DATABASE - CREATE TABLE ( ,…PRIMARY KEY (attribute)); - ALTER TABLE ADD PRIMARY KEY () - ALTER TABLE ADD FOREIGN KEY REFERENCES () (references the table where the key is primary to create relationship)
39
DML query commands
- SELECT FROM
- WHERE - ORDER BY ASC/DESC - GROUP BY - INNER JOIN ON (combines rows) - SUM - COUNT (counts the number of rows where the column isnt NULL)
40
DML maintenance commands
- INSTERT INTO
VALUES () - DELETE FROM
WHERE have to delette from all tables - UPDATE
SET WHERE