Databases- 2024/2025

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 424

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

425 Terms

1

definition: database

A database is a shared collection of logically related data and its description, designed to meet the information needs of an organization.

New cards
2

data:

integrated from several sources: different departments in a company
stored in a standared format for many different application

New cards
3

definition: database management system

a database management system is a software system that enables users to define, create, maintain and control access to the database

New cards
4

database management system: DBMS (1)

general purpose software used to manage electronically stored database

maintains data independent of application programs

minimizes data redundancy
e.g. - ms access, MySql

New cards
5

what does a database system consist of

database
DBMS

computer hardware

New cards
6

why reduce redundancy

data redundancy can lead to inconsistencies

New cards
7

DBMS: (2)

allows re-use and sharing of the data by many users
ensures: data consistency and integrity

New cards
8

data consistency

same data across applications
same data even when replicated

New cards
9

integrity

up-to-date data
correct data

New cards
10

DBMS: (3)

enables many users to access data concurrently
allows data acess control appropriate to individual user

New cards
11

A simplified database system environment

knowt flashcard image
New cards
12

roles and skills in a db environment

database administrator (dba)
database designer
app programmers
end users

New cards
13

database administrators

oversee and manage resources: vm, utilized hardware
authorization: for common usage
security policy: app dependant
performance, tuning: can change over time

New cards
14

database designers

identify data to be stored and structured to be used
identify constraints
design structural and functional aspects

New cards
15

application programmers

develop and implement end-cuser requirements

New cards
16

end users

may be sophisticated/naive, regular/casual.
varying degrees of access

New cards
17

stages in database development

problem analysis
database design
database implementation
database monitoring/tuning

New cards
18

problem analysis

identify and understand:
data to be collected
requirements
constraints
facts and enterprise rules etc…

New cards
19

database design

produce data models
entities and their relationships

New cards
20

database implementation

structured data in the physical database

New cards
21

database monitoring/tuning

monitor db usage
re-structure and optimise databse

New cards
22

data models

specify the concepts that are used to describe the db : its content

New cards
23

three categories of data models

high level - conceptual data model
representational level - logical data model
low level -physical data model

New cards
24

conceptual data model

concepts at user level:
entities/ classes
attributes
relationships/ associations.

independent of DBMS

may be presented to user

New cards
25

conceptual data model example

knowt flashcard image
New cards
26

logical data model

e.g relational, network, hierarchical
may be record based, object oriented

New cards
27

physical data model

Details of physical data storage, formats, access paths, ordering…
Both depend on type of DBMS
And are typically not to be accessible by user

New cards
28

logical data model example

knowt flashcard image
New cards
29

physical data model example

knowt flashcard image
New cards
30

types of logical data modes

relational model
entity-relationship (ER) model
object-oriented model

New cards
31

relational model

forms basis of current database management systems

New cards
32

entity relationship model

a diagrammatic technique that proves a generalised approach to the representation of data
helpful in the design of the relational database system

New cards
33

object oriented model

Has become more prominent in recent years particularly applied to data management in the form of the object-oriented database

Now competes with the relational database for certain applications

New cards
34

What are the two main types of Database Languages?

Data Definition Language (DDL)

Data Manipulation Language (DML)

New cards
35

What does DDL include?

DDL includes structure and view definition languages.

New cards
36

What are the characteristics of DML?

High or low level (declarative or procedural)

Standalone or embedded in a host procedural language

Set-oriented or record-oriented

New cards
37

What is the single language most DBMS provide?

Most DBMS provide a single Structured Query Language (SQL) consisting of all required functionality.

New cards
38

definition: relational model

a relational db is a collection of related tables

New cards
39

purposes of a function

mapping sets of inputs to sets of outputs
mapping from an input value to a specific output value
each input relates to exactly one output

New cards
40

what is a relation/table

is a logical representation of data
is physically represented as a table
it allows us the precisely explain what happens in a db

New cards
41

types of relational model

logical
formal
data

New cards
42

logical model

independent of physical implementation

New cards
43

formal model

uses set theory and predicate logic

New cards
44

data model

Concepts used to describe the database, i.e., the contain information

Simple but powerful; still the foundation for databases

New cards
45

three aspects of data

data structure
data integrity
data manipulation

New cards
46

data structure

table, column, domain, row

entities and their relations

New cards
47

data integrity

null, entity Integrity, referential integrity, general constraints

(rules that ensure the data is accurate, consistent and valid)

New cards
48

data manipulation

relational algebra

(using relational algebra to retrieve, edit and add data to our database)

New cards
49

what does a relational model consist of

data structure
data constraints
relational operators

New cards
50

data constraints

Restrictions on data, relations, …

New cards
51

relational operators

Restrict, project, cartesian product, union, difference, …

New cards
52

objective of a relational model

To obtain a high degree of data independence – allow changes without affecting the applications that use it

To control redundancy – data not stored in multiple places/ tables

To maintain consistency – the state of copies are the same, accurate & up-to-date

To enable set-oriented manipulation languages to be used (e.g. relational algebra)

New cards
53

row

records or tuple
A row in a table represents individual instance of the entity

Each row is uniquely identified by one or more attributes, i.e. the primary key

No part of the primary key may have a null value (entity integrity rule)

New cards
54

column

field or attribute
Each column heading in a table has a distinct name

Its value must be atomic, i.e., a single value drawn from the domain of the column

New cards
55

table

relation
has rows and columns
represents a kind of entity or class
each table is has a unique name for id
properties: no duplicate rows, no significance to row and col order, col has unique name

New cards
56

domain (1)

Set of possible values that a column can take
Every column in a table is defined on a domain


Different domains are unrelated: restricts comparison between col and prevents meaningless operations

columns in table may have the same domain: SID, CID

New cards
57

domain (2)

may be potentially infinite - in the real world
constrained

New cards
58

Key

one or more columns that determine (imply) other columns

Or: one or more columns to uniquely identify a row

New cards
59

types of keys:

candidate
primary
alternate
foreign
composite

New cards
60

candidate key

A minimal set of columns which uniquely identifies each row

New cards
61

primary key

The chosen candidate key to uniquely identify each row

New cards
62

alternate key

the remaining candidate keys

If there are more than one candidate keys in a table and one of these is chosen as the primary key, the remaining candidate keys are referred to as alternate keys

New cards
63

foreign key

Columns (or a set of columns) that matches the candidate key of the associated table

Used to represent relationship between tables

New cards
64

composite key

Refers to a key consisting of two or more columns

New cards
65

null values

A NULL value is required to deal with missing information: value unknown, inserted later..
not the same as “ “ (blank) or 0

New cards
66

db constraints

The definition of a database encompasses integrity constraints:
rules to ensure that the db doesn’t have ‘invalid’ values and configs
means the data in the db is accurate and reliable

New cards
67

what could be db constraints

app/db specific: equal to enterprise or business rules


integirty constrains:
Entity integrity – each row is unique and identifiable

Referential integrity – rules ensuring the accuracy and consistency of data between tables

multiplicity
required data- primary key not null
domain constraints

New cards
68

integrity constraints

Entity integrity rule:
constraint on primary keys
Value of a primary key must be unique and
not null

Referential integrity rule:
constraint on foreign keys
Value of a foreign key must either match the candidate key it refers to
or be null

New cards
69

what does a relational model comprise of

structural definition
integrity rules
data manipulation

New cards
70

main languages used to deal with data manipulation

relational algebra
relational calculus

New cards
71

relational algebra (1)

Is a theoretical language

Provides a collection of operations used to manipulate relations

Is implementable

Basis for SQL query execution

New cards
72

visual summary of operations

knowt flashcard image
New cards
73

natural join

knowt flashcard image
New cards
74

restrict operation

defines horizontal subset table
called a unary operator as it works on a single tables

New cards
75

project operation ⫪

defines vertical partitioning of a table

New cards
76

intersection operation

set intersection on tables:
only rows contained in both

New cards
77

natural join operation  ⋈

cartesian product, removing common duplicated columns

New cards
78

relational algebra is a procedural language

query is evaluated in the order specified

New cards
79

complex queries are evaluated by:

Nesting operations to create a relational expression

or applying operations one at a time and creating temporary tables

New cards
80

processing complex queries

most efficient one is preferable

New cards
81

relational algebra Vs Relational calculus - similarities

they are formal, theoretical - based on maths principals, non user friendly
used as a basis for data manipulation
lang for relational db
used to define operations to manipulate tables
equivalent in terms of expressive power

New cards
82

relation algebra Vs relational calculus - differences

relational algebra - is procedural , specifies how to achieve
relational calc - is declarative , specifies what to achieve

New cards
83

relational algebra (2)

operations work on one or more tables to define another table without editing the og tables
both operands and results are tables so output from one operation can become input to another operation
allows expressions to be nested
closure

New cards
84

closure

property where operations produce only tables based on elements of the input tables

New cards
85

unary

unary - 1

New cards
86

relational algebar operations 5+2

5 basic operations:
restrict (unary)
projection(unary)
cartesian product
union
set difference

2 operations expressed in terms of basic operations:
join
intresections

New cards
87

relational algebra symbols

knowt flashcard image
New cards
88

visual interpretation summary

knowt flashcard image
New cards
89

comparison operators

<, >, <=, >=, =, ≠

New cards
90

boolean operators

∧ - and ∨- or ∾- not

New cards
91

set operations

∪ = union
∩= intersection
- = difference

New cards
92

∪ union

combines two tables
removes all duplicate rows

New cards
93

∩ intersection

returns rows that appear in both tables

New cards
94

- = difference

returns rows that are in on and not the other table
T ← R - S
output all the rows that are in R but not in S

New cards
95

cartesian product (X)

multiplies two tables
PQ ← P x Q

<p>multiplies two tables <br>PQ ← P x Q </p>
New cards
96

types of join operations

equi-join
natrual join
outer join : left outer join, right outer join, full outer join

New cards
97

join ⋈

combines 2 tables to form a new one
derivative of the cartesian product where all elements satisfy p
col involves in ajoin condition p must have the same domain

New cards
98

equi - join

condition of equi- join contains only equality comparisons

New cards
99

outer join

used when displaying rows in the result that don’t have matching values in the join col

avoids info loss and includes unmatched rows in the result table

New cards
100

problems with natural join

rows not included when:
join cols are null or dont have matching rows in another tables

can cause loss of data

New cards
robot