Fundamentals of Databases Flashcards

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

What is a entity?

A

A category of object, person, event or thing of interest about which data needs to be recorded.

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

What is a attribute?

A

An identifier of what data is stored in the entity.

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

What is a primary key?

A

A attribute that uniquely identifies a particular record.

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

What is a composite primary key?

A

When two or more attributes are used to uniquely identify a record.

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

What are the possible relationships between databases?

A

one-to-one
one-to-many
many-to-many

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

What is a foreign key?

A

When the primary key of one table is in another table.

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

What is a flat-file database?

A

Where only one table holds all the data.

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

What is a relational database?

A

Where data is stored on multiple tables.

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

What conditions have to be met for a data to be 1st normalised form ?

A

No repeating attributes
All attributes are atomic.

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

What conditions have to be met for a data to be 2nd normalised form?

A

In 1NF
No partial dependencies on composite key.

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

What conditions have to be met for a data to be 3rd normalised form?

A

In 2NF
No non-key dependencies

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

What is the SQL statement to return certain items?

A

SELECT fields
FROM tables
WHERE conditions

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

What is the SQL statement to organise data returned?

A

ORDER BY (ASC/ DESC)

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

What does the SQL statement LIKE do?

A

WHERE … LIKE …
Selects data that starts/ ends with a certain character. (St*)

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

What does the SQL statement BETWEEN do?

A

WHERE … BETWEEN … AND …
Returns data values between the values given.

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

How do you return data from two tables?

A

FROM table1, table2
WHERE table1.primarykey = table2.foreignkey

17
Q

What is the SQL statement to combine data from multiple tables?

A

JOIN table
ON primarykey = foreignkey
WHERE conditions

18
Q

What is the SQL statement to create a new table?

A

CREATE TABLE name
(data)

19
Q

How do you specify data values when creating a new table?

A

userID CHAR(6) PRIMARY KEY, NOT NULL
name VARCHAR(num)

20
Q

How do you specify a foreign key when creating a new table?

A

FOREIGN KEY name REFERENCES name(table)

21
Q

What are the possible data types for a table? (8)

A

CHAR
VARCHAR
BOOLEAN
INTEGER
FLOAT
DATE
TIME
CURRENCY

22
Q

What is the SQL statement to add a new attribute to a table?

A

ALTER TABLE table
ADD attribute

23
Q

What is the SQL statement to delete an attribute in a table?

A

ALTER TABLE table
DROP attribute

24
Q

What is the SQL statement to add a new record into a table?

A

INSERT INTO table(attributes)
VALUES (values)

25
Q

What is the SQL statement to change a record in a table?

A

UPDATE table
SET new values
WHERE record

26
Q

What is the SQL statement to remove a record from a table?

A

DELETE FROM table
WHERE record