databases Flashcards
what is ACID
required properties for database services, ensuring that it is efficient and safe to use.
Atomicity - each dataset is divided into smallest indivisible parts (adress is divided into town and street for example.)
Consistency - ensuring that the service is consistent (if you draw 3000 eur out of your bank account you dont want to get 20 do you.)
Isolation - concurency control; in case few transactions will try to pass at the same time, consistency will ensure that each are treated individually (“first come first served”)
Durability - ensures that the data is not lost (bank explodes ☹️ but you’re still rich with the saved money in it 🤑)
data dictionary
what fields are what type (phone is TEXT field for example)
boolean
binary - yes/no; 1/0
forms
in google forms for example the thing
query
a type of search - searching “databases” in google docs is a simple query. searching “databases” and adding “used by Jernej Fegus” is a complex query, as it involves simple logic.
ERD
entity-relationship diagram (the full database tables with the keys attached to eachother)
transaction
a sequence of operations - entire sequence is one logical unit of work
states:
active comes into either failed or particularly commited. fail ends in aborted.
particularly commited can go into either failed or end in a committed state.
table
2d array/grid with rows and columns
fields and records
columns and rows. take time to imagine a form and how answers of it would be organised.
primary key
unique, like IDs
secondary key
fiekd categories like Names (there are many names)
indexing
like indexing book topics
foreign key
imported primary key
super key
composite key = key + key
for example costumersID and ordersID make up prices (can be different prices despite the fact that costumers can be same)
what kind of relationship are available in databases
one to one (one child has one biological mother)
one to many (one mother can have many children)
many to many (TO BE AVOIDED IN GOOD DATABASE DESIGN!!)
orphan data (ALSO TO BE AVOIDED AS IT IS INEFFICIENT)