1.3.2 Databases Flashcards

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

Database

A

An organised collection of data

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

Database advantages

A

Make data available to users, the data is correct and the data can be held securely

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

Table

A

A collection of associated data stored within a database

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

Fields

A

The characteristics of each table

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

Record

A

An individual entry that belongs in a table

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

Entity

A

Something in the real world that we store data about

Becomes a table in a database

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

Attribute

A

A characteristic of an entity

Becomes a field in a database

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

Entity description format

A

TableName(Entity1, Entity2…)

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

Char(n) vs VarChar(n)

A

A char string has fixed length n, a varchar string has variable length up to n

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

How to access a database

A

Using a DBMS (Database Management System)

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

Flat file database

A

A database comprised of a single table, based around a single entity and its attributes

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

Flat file advantages and disadvantages

A

+ simple and quick to set up

- very inefficient, used for storing small amounts of data

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

Relational databases

A

Databases split into multiple tables linked by relationships

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

Primary key

A

A field in a record which is unique, allowing each record to be uniquely identified. Must not be duplicated or reused.

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

Secondary key

A

A field can be defined as a secondary key to be indexed for faster lookups.

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

Foreign key

A

The key in a table that correlates to a primary key in another table

17
Q

Entity Relationship Diagrams (ERD)

A

One to one is linked by a straight line
One to many diverges into 3 near the many side]
Many to many diverges into 3 at both ends

18
Q

SQL

A

Structured Query Language

A declarative language used for querying and updating tables in a relational database

19
Q

SQL Queries

A

Retrieves data based on a given criteria

20
Q

SQL Clauses

A

Filters data and returns data that fulfils a specific condition

21
Q

SQL Predicates

A

Specify conditions which return the filter

22
Q

SQL Expression

A

A combination of one or more values, functions and operators

23
Q

SQL Select format

A

SELECT lists the fields to be displayed
FROM states which table they come from
WHERE specifies a condition
ORDER BY lists how they are sorted (ASC,DESC)
e.g. SELECT name FROM sales WHERE cores=4 ORDER BY name DESC

24
Q

SQL UPDATE

A

Modifies existing values in a table

25
Q

SQL DELETE

A

Deletes existing records from a table

26
Q

SQL DROP

A

Deletes a database or table

DROP table tableName

27
Q

SQL INSERT INTO

A

Inserts new records into a table

INSERT INTO Table(Fields), VALUES (Data)

28
Q

Join

A

Combines rows from 2 or more tables based on a related column between them

29
Q

INNERJOIN

A

The SQL for joining tables

INNERJOIN newTableName on table.field = table.field

30
Q

SQL UPDATE Syntax

A

UPDATE tableName SET field = newValue WHERE …

31
Q

SQL Additional Data Types

A

TIME and CURRENCY

32
Q

SQL Select All

A

SELECT *

33
Q

SQL Like

A

Like “%xx%”

Where the string xx is included anywhere in the data it is returned