Databases and SQL Flashcards

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

What is a flat file database?

A

A flat file database is a database of just one table.
It’s an organised computerised system that makes it easy to search, select and store information. It stores information until specifically deleted.

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

What is a relational database?

A

A relational database is a structured database that is made up of more than one table. It allows data to be separated and connected across several tables.

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

What is a primary key?

A

A primary key is an unique identifier for each record. It uniquely identifies a record in one table and a table can only have one primary key.

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

What is a table?

A

A table is a collection of record for a specific theme.

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

What is a field?

A

A field is categories for each piece of data in a table.

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

Give some examples of a field.

A

First name
Surname
Student ID

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

What is a record?

A

A record is a row of data for one object, person, or place.

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

Why can data redundancy be a problem?

A

Data redundancy can be a problem because data can be repeated in a database table, and it makes the database file much larger than it needs to be.

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

Why can data inconsistency be a problem?

A

Data inconsistency can be a problem because the more redundant data there is, the more likelihood there is that errors are introduced and that some of that data will be inconsistent. This would create differences in the data stored on a database.

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

What is a foreign key?

A

A foreign key is a primary key from one table that appears in another table to link the two together.

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

Why might the primary key for one table, not be the same primary key in another table?

A

A primary key provides a mechanism for ensuring that the rows in a table are unique. Other columns might also contain unique values, but a table can contain only one primary key. Because the primary key must be able to identify each row, no columns that participate in a primary key can contain NULL values.

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

What are comparison operators?

A
= - Equal to
> - Greater than
< - Less than
>= - Greater than or equal to
<= - Less than or equal to
<> OR =! - Not equal to
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Logical Operators:

AND

A

AND - TRUE if both conditions are TRUE

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

Logical Operators:

BETWEEN

A

BETWEEN - TRUE if the range is within the comparisons

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

Logical Operators:

OR

A

OR - TRUE if any of the conditions are TRUE

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

Different data types:

Integer

A

Integer- a whole number

17
Q

Different data types:

Real

A

Real- a number with a decimal point

18
Q

Different data types:

Text

A

Text- a string of variable length

19
Q

CREATING A DATABASE:

A
20
Q

There are also a number of tick boxes for each field:

A

NN (Not Null) this field cannot be left blank

21
Q

There are also a number of tick boxes for each field:

A

PK (Primary Key) this field is the primary key, the unique
identifier for the table. This will ensure it is unique and
cannot be left blank

22
Q

There are also a number of tick boxes for each field:

A

Al (Automatic Increment) if this is a number it will add I
onto the last one to generate a new number, usually used
for Primary Key fields

23
Q

There are also a number of tick boxes for each field:

A

U (Unique) this is used to say the contents need to contain
a unique value and cannot contain any duplicate values.
If you select PK this field does not need to be ticked as PK
already specifies it needs to be set to unique