paper 3 Flashcards

(47 cards)

1
Q

Database

A

An organized collection of data stored and accessed electronically.

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

DBMS

A

Database Management System: software that creates, reads, updates, and deletes data in a database.

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

Table (Relation)

A

A set of related data organized into rows (records) and columns (fields).

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

Record (Tuple)

A

A single row in a table representing one real-world entity instance.

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

Field (Attribute)

A

A column in a table representing one property of the entity.

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

Domain

A

The set of all valid values for a given attribute.

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

Primary Key

A

A field (or combination of fields) that uniquely identifies each record in a table.

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

Foreign Key

A

A field in one table that references a primary key in another table to enforce relationships.

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

Composite Key

A

A primary key made up of two or more fields combined.

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

Entity

A

An object or concept about which data is stored (e.g., Student, Car).

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

Relationship

A

An association between two entities (e.g., Student enrolls in Course).

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

Cardinality

A

Specifies how many instances of one entity relate to instances of another (1:1, 1:M, M:N).

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

1NF

A

First Normal Form: all fields contain only atomic (indivisible) values.

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

2NF

A

Second Normal Form: all non-key fields depend on the whole primary key (no partial dependencies).

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

3NF

A

Third Normal Form: no non-key field depends on another non-key field (no transitive dependencies).

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

Data Integrity

A

Ensuring the accuracy and consistency of data over its lifecycle.

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

Referential Integrity

A

Guarantee that foreign-key values match existing primary-key values (no orphan records).

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

NOT NULL

A

Constraint that prevents a field from having empty (NULL) values.

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

UNIQUE

A

Constraint that ensures all values in a field (or combination) are distinct.

20
Q

CHECK

A

Constraint that enforces a Boolean condition on field values (e.g., age ≥ 0).

21
Q

SELECT

A

Retrieve specified columns or all columns from a table (e.g., SELECT * FROM Students;).

22
Q

INSERT INTO … VALUES (…)

A

Add new rows to a table (e.g., INSERT INTO Students (name, age) VALUES (‘Alice’, 17);).

23
Q

UPDATE … SET … WHERE …

A

Modify existing rows in a table (e.g., UPDATE Students SET age = 18 WHERE name = ‘Alice’;).

24
Q

DELETE FROM … WHERE …

A

Remove rows from a table (e.g., DELETE FROM Students WHERE age < 16;).

25
CREATE TABLE
Define a new table and its columns (e.g., CREATE TABLE Students (...);).
26
DROP TABLE
Remove a table and its data from the database.
27
WHERE
Filter rows based on a condition (e.g., WHERE age > 18).
28
ORDER BY
Sort query results by one or more columns (e.g., ORDER BY age DESC).
29
GROUP BY
Group rows sharing a value for aggregate calculations (e.g., GROUP BY major).
30
LIMIT
Restrict the number of rows returned by a query (e.g., LIMIT 5).
31
*
Wildcard meaning “all columns” in a SELECT statement.
32
%
Wildcard in LIKE patterns matching any sequence of characters.
33
_
Wildcard in LIKE patterns matching exactly one character.
34
;
Statement terminator; marks the end of an SQL command. (e.g., SELECT * FROM Students; )
35
COUNT()
Aggregate function returning the number of rows matching criteria.
36
SUM()
Aggregate function returning the total sum of a numeric column.
37
AVG()
Aggregate function returning the average value of a numeric column.
38
MIN()
Aggregate function returning the smallest value in a set.
39
MAX()
Aggregate function returning the largest value in a set.
40
LIKE
Operator for pattern matching with % and _ wildcards.
41
Why normalize databases?
To reduce redundancy and prevent update, insert, and delete anomalies, ensuring integrity and efficient storage.
42
How is data consistency maintained?
Via constraints (PK, FK, NOT NULL, UNIQUE, CHECK), referential integrity, and a well-normalised schema.
43
<>
Inequality operator; selects rows where the value is not equal to the specified one. (e.g., SELECT * FROM Students WHERE grade <> 'A'; )
44
DISTINCT
Removes duplicate values from the result set, returning only unique entries. (e.g., SELECT DISTINCT major FROM Students; )
45
DESC
DESC
46
ASC
Specifies ascending sort order in an ORDER BY clause (default if omitted). (e.g., SELECT * FROM Students ORDER BY age ASC;)
47