I just want to know what is a parent table and what is a child table in databases. Can you please show me an example so I understand how it works please.
Thank You
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Child tables and parent tables are just normal database tables, but they’re linked in a way that’s described by a parent–child relationship.
It’s usually used to specify where one table’s value refers to the value in another table (usually a primary key of another table).
For example, imagine a news article. This could be represented by a table called
articlesand has fields forid,headline,body,published_dateandauthor. But instead of placing a name in theauthorfield, you could instead put the ID value of a user in a separate table—maybe calledauthors—that has information on authors such asid,name, andemail.Therefore, if you need to update an author’s name, you only need to do so in the
authors(parent) table; because thearticles(child) table only contains the ID of the correspondingauthorrecord.Hope this helps you understand better.