Relational Databases Flashcards

1
Q

What is a database?

A

A database is a structured way to store data so that it can be retrieved using queries

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

What is the table?

A

The table is the structural format in which data is stored in a database

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

What is record?

A

A record is a row in a table. It is all the data stored as part of the same overarching value.

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

What is a field?

A

A field is a column in the table. These are the different categories storing values of different records

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

What are the data types?

A

Integer (Whole number)
Real (Number with decimal component)
Datetime (Stores dates and times)
Char (Fixed length string up to 8000)
Varchar (Variable length string up to 8000)
Text (Variable length string up to 2GB)

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

What is a primary key?

A

A primary key is a field that stores unique data for each record in a table.

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

How does a relational database eliminate data inconsistencies and redundancies?

A

A relational databases make use of multiple tables linked by relationships.
Using relational databases and multiple tables allows the elimination of data redundancy and reduces data inconsistencies

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

What is the purpose of the SELECT function?
Example?

A

SELECT… (list the fields to be displayed)
This function selects which field needs to be selected

SELECT MemberID, FirstName, Surname
FROM members

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

What is the purpose of the FROM function?
Example?

A

FROM… (specify the table name)
This function assigns the table in which data is selected from

SELECT MemberID, FirstName, Surname
FROM members

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

What is the purpose of the WHERE function?
Example?

A

WHERE… (list the search criteria)
This function is used to select on records that specify a condition

SELECT FirstName, Surname
FROM members
WHERE Town = ‘Ipswich’

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

What is the purpose of the ORDER function?
Example?

A

ORDER BY… (Order in which the data outputted is to be)
This function allows a query to sort data by ascending or descending order

SELECT *
FROM members
ORDER BY Surname ASC

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

How do you insert data into a table using SQL?

A

INSERT INTO (Table Name) (Fields)
VALUES (Value1, Value2)

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

How do you edit and delete data in a database using SQL?

A

UPDATE (Table Name)
SET (FieldName = Changed Value)
WHERE (Search Criteria)

DELETE FROM (Table Name)
WHERE (Search Criteria)

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

What are the issues with flat-file databases?

A

This leads to inconsistencies in the data making it hard to search and sort data.
Creates redundant data so the database uses more memory than needed

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