Sreedhar.a wrote:
I have only one ALBUM named 'Confession' with id 1 and
only one ARTIST named 'Madonna' with id 2 and
one BGM named 'rock' with id 5.
MUSIC table will have all these details.
Now If I delete the Album 'Confession' From table ALBUM.
Then it is deleting that record with that id i.e,1 for 'confession' in MUSIC
table.So now there is no records in the MUSIC table.
But it is not deleting in the ARTIST and the BGM table since that Artist '
Madonna ' and BGM 'rock' are present in one record and that record too
deleted in Music table. For me the complete record details to be deleted in
all the tables.
I think I have to add some more constraints in triggers/sql statemets
I think you need to add a delete trigger on the music that will delete
records in the album, artist, and bgm tables if there are no other
records with the same albumId, artitId, or bgmId in the music table
(i.e. if this is the last record in the music table that references a
record in each of the other tables).
HTH
Dennis Cote
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------