You just need to set up some logic.
If you are deleting a subtopic make sure you delete all articles with subtopic_id, and if you are deleting a topic make sure you delete all subtopics with topic_id and all articles with subtopic_id.
I would have three tables
Article
(Article_id, Article_name)
Subtopic
(Subtopic_id, Subtopic_name)
Article
(Article_id, Subtopic_id, Article_name, Article_file, Article_keyword)
If you want to upgrade your system to have as many subtopics within subtopics as you wish then modify it as so:
Article
(Article_id, Parent_id, Topic_name)
(this will allow threads, i.e. a topic, with a subtopic with a subsubtopic... and it gets rid of the need for three tables, just the two)