Databases Flashcards

(28 cards)

1
Q

Define data model

A

An abstract model of which things to store and what information about them should be recorded

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

Define attribute

A

A characteristic of an entity

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

Name the three possible degrees of relationship between tables in a database

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
4
Q

Define entity

A

A thing about which data is to be stored

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

What name is given to an attribute which can uniquely identify each attribute in a table?

A

Entity identifier / Primary key

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

Why are databases normalised?

A

So that they can be at their most efficient without compromising data integrity

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

What name is given to a primary key formed from multiple different attributes?

A

Composite primary key

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

What name is given to the new table created when forming a many-to-many relationship?

A

Link table

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

What is the definition of the third normal form

A

All non-key attributes depend on the key, the whole key and nothing but the key

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

Which declarative language is used to query databases?

A

SQL

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

What does SQL stand for?

A

Structured Query Language

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

What is the purpose of SQL?

A

To query, update, and manage relational databases

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

What is a foreign key?

A

An attribute in one table that refers to the primary key of another table

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

Define referential integrity

A

Ensuring that a foreign key value always refers to an existing, valid primary key in another table

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

What is the difference between DDL and DML in SQL?

A

DDL (Data Definition Language) defines structures (CREATE, ALTER), while DML (Data Manipulation Language) modifies data (INSERT, UPDATE, DELETE)

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

What does SELECT do in SQL?

A

Retrieves data from a table

17
Q

What does WHERE do in SQL?

A

Filters records based on a condition

18
Q

What does ORDER BY do in SQL?

A

Sorts query results in ascending or descending order

19
Q

What does GROUP BY do in SQL?

A

Groups rows that have the same values in specified columns into summary rows

20
Q

Name the four types of JOIN in SQL

A

INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN

21
Q

What does UNION do in SQL?

A

Combines the results of two SELECT statements into one result set

22
Q

What does CREATE TABLE do?

A

Defines a new table and its columns in the database

23
Q

What does DROP TABLE do?

A

Deletes a table and all of its data from the database

24
Q

What does ALTER TABLE do?

A

Modifies an existing table (e.g., add/remove columns)

25
What does INSERT INTO do?
Adds new rows of data into a table
26
What does UPDATE do?
Modifies existing data in a table
27
What does DELETE do?
Removes rows from a table
28
What is concurrency control?
The management of simultaneous access to a database to avoid conflicts