database integrity Flashcards
what is data integrity ?
it refers to the accuracy,consistency, and reliability of storing data.
what is the differences between staic and referential integrity?
static refers to the correctness and consistency of individual data check like constraints- datat type,length
attribute domains
keys
relation cardinal
referential integrity
ensure consistency between table
ensure relational link
referential integrity -cascade and set null
set to null-> set null
propagate the chnage->cascade
update
update x
set x
where m
cascade
create table s( .., k integer references R on update cascade);
delete
delete from table
where x=f;
types of static intergrity
aufzahlungtypen und wertebereichseinschränkungen
constraints
check (x)
x not null
primary ke<y(x,x)
foreign key(x) references m
trigger reaction
create trigger
cascade/no cascade
before/after
update/insert/ delete x on f(table)
referencing old as oldname new as newname
for each row
when
set
temporal data
Temporal data management involves storing, querying, and analyzing data over time. Some databases support temporal features, such as temporal tables or temporal databases, which allow for the storage and querying of temporal data. Temporal databases enable the tracking of changes to data over time, querying historical data at specific points in time, and handling temporal constraints and validity periods.
transaction time versionierung
create table studiengebühren
(x,x,x,x always as row start ,generated always as row end,
period fro sytem_time ,
)with system versioning
how to write recursive
with recursive table_name as
——————base case—————–
(select x
from tablename
where x=o)
————–union…….
select.f.x
from table name f
join table_name on e.x=e.f
sql injection
sql injection is by adding sql such as 1=1 thus jeorpardizing the integrity