Answer:
The trigger code is given below
create trigger F1_Del
after delete on Friend
for each row
when exists (select * from Friend
where ID1 = Old.ID2 and ID2 = Old.ID1)
begin
delete from Friend
where (ID1 = Old.ID2 and ID2 = Old.ID1);
end
create trigger F1_Insert
after insert on Friend
for each row
when not exists (select * from Friend
where ID1 = New.ID2 and ID2 = New.ID1)
begin
insert into Friend values (New.ID2, New.ID1);
end
A Network is definitely a Tree when any of the below properties matched.
Explanation:
A Network is synonym for connected graph. Connected graph is a graph is a path which will connect from vertex to vertex.
A Tree is a network that has no circuit. network can be differed from tree by three key properties
1. Single path property - one path connecting two vertices
2. All bridges property - every edge of a network is a bridge
3. N-1 edges property - N vertices has N-1 edges
To determine this we use to N-1 edges property as given number of vertices and no bridges.
If a network has 15 vertices it must have 15-1= 14 edges to become a tree
I’m pretty sure D but it should be like $B2