ITRevise.in

Chapter library

Working with Multiple Tables · Class X · Part B

Open an answer to check your recall, or turn this topic into an MCQ quiz.

Database Management System

Working with Multiple Tables

Practice this chapter
How a book is linked to its loans. Books: BookID. Loans: LoanID. Loans: BookID. Return due date.
One book can have many loan records. Each loan refers to its book.
1 Explain “Foreign key” with an example.

Foreign key references a candidate key in a related table.

A database stores structured facts. Keys connect or identify records, queries select information, forms help with data entry and reports arrange results for people to read. One-to-many relationship allows one parent row to match several child rows. Junction table stores links in a many-to-many relationship. Referential integrity requires valid references between related records.

Example. An Orders table may store CustomerID as a foreign key that refers to CustomerID in Customers. Several orders can refer to the same customer. Repeating the identifier in Orders is expected, while repeating a primary identifier in Customers is not allowed.

The important point is what “Foreign key” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

171 words

2 Explain “One-to-many relationship” with an example.

One-to-many relationship allows one parent row to match several child rows.

A database stores structured facts. Keys connect or identify records, queries select information, forms help with data entry and reports arrange results for people to read. Junction table stores links in a many-to-many relationship. Referential integrity requires valid references between related records. Composite key uses more than one field together to recognise a row.

Example. In a library database, a Books table contains one row per BookID. A Loans table can have several rows with the same BookID because one book can be borrowed many times. A loan must refer to an existing book, and a separate LoanID can identify that individual loan.

The important point is what “One-to-many relationship” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

180 words

3 Explain “Junction table” with an example.

Junction table stores links in a many-to-many relationship.

A database stores structured facts. Keys connect or identify records, queries select information, forms help with data entry and reports arrange results for people to read. Referential integrity requires valid references between related records. Composite key uses more than one field together to recognise a row. Foreign key references a candidate key in a related table.

Example. In a library database, a Books table contains one row per BookID. A Loans table can have several rows with the same BookID because one book can be borrowed many times. A loan must refer to an existing book, and a separate LoanID can identify that individual loan.

The important point is what “Junction table” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

179 words

4 Explain “Referential integrity” with an example.

Referential integrity requires valid references between related records.

A database stores structured facts. Keys connect or identify records, queries select information, forms help with data entry and reports arrange results for people to read. Composite key uses more than one field together to recognise a row. Foreign key references a candidate key in a related table. One-to-many relationship allows one parent row to match several child rows.

Example. In a library database, a Books table contains one row per BookID. A Loans table can have several rows with the same BookID because one book can be borrowed many times. A loan must refer to an existing book, and a separate LoanID can identify that individual loan.

The important point is what “Referential integrity” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

182 words

5 Explain “Composite key” with an example.

Composite key uses more than one field together to recognise a row.

A database stores structured facts. Keys connect or identify records, queries select information, forms help with data entry and reports arrange results for people to read. Foreign key references a candidate key in a related table. One-to-many relationship allows one parent row to match several child rows. Junction table stores links in a many-to-many relationship.

Example. In a library database, a Books table contains one row per BookID. A Loans table can have several rows with the same BookID because one book can be borrowed many times. A loan must refer to an existing book, and a separate LoanID can identify that individual loan.

The important point is what “Composite key” does in a specific situation. To see the difference between this idea and the others in this chapter, compare what each one affects and which result would show that it had been used correctly. Use one concrete detail, such as a number, file name, message or action, to show exactly what you mean and how someone could check it.

182 words

6 Distinguish between Foreign key and One-to-many relationship.

Foreign key references a candidate key in a related table. One-to-many relationship allows one parent row to match several child rows.

A database stores structured facts. Keys connect or identify records, queries select information, forms help with data entry and reports arrange results for people to read. Junction table stores links in a many-to-many relationship. Referential integrity requires valid references between related records. Composite key uses more than one field together to recognise a row.

Example. In a library database, a Books table contains one row per BookID. A Loans table can have several rows with the same BookID because one book can be borrowed many times. A loan must refer to an existing book, and a separate LoanID can identify that individual loan.

Compare the two ideas using the same situation. Describe which part of the situation each idea explains and how the result would differ if you used the other one. This gives the distinction a clearer basis than listing two definitions in isolation.

166 words

7 Design a simple relationship between Customers and Orders.

Use CustomerID as the primary key in Customers and OrderID as the primary key in Orders. Store CustomerID as a foreign key in Orders. One customer may have several orders, and referential integrity prevents an order from referring to a nonexistent customer.

A database stores structured facts. Keys connect or identify records, queries select information, forms help with data entry and reports arrange results for people to read. One-to-many relationship allows one parent row to match several child rows. Junction table stores links in a many-to-many relationship.

Example. In a library database, a Books table contains one row per BookID. A Loans table can have several rows with the same BookID because one book can be borrowed many times. A loan must refer to an existing book, and a separate LoanID can identify that individual loan.

Check your answer against the task. Identify the facts that matter, explain the steps in a sensible order and state the result you would expect. If your result differs from what you expected, revisit the input, condition or decision that produced it.

178 words

Reference book: 402_IT_X_PART_B.pdf