Question Title: Advanced Database Features
- Compare and contrast manual and electronic databases in terms of efficiency and security.
- Why is it important to set an appropriate field size when designing a manual database table?
- What problems might arise if data types are mismatched during conversion to an electronic database?
- How would you design a relational database with two tables for a library system tracking books and borrowers?
- What happens if a foreign key references a non-existent primary key in a DBMS?
Ruwan Suraweera Changed status to publish May 23, 2025
Answers and Descriptions:
- Answer: Manual databases (e.g., paper records) are less efficient due to slow retrieval and prone to loss, while electronic databases are faster and more secure with backups and passwords.
Description: Searching a filing cabinet takes time and risks damage, whereas an electronic database can instantly find data and restrict access with security features. - Answer: An appropriate field size (e.g., 10 characters for a name) prevents wasted space and ensures data fits correctly without truncation.
Description: If โNameโ is set to 5 characters, โRobertโ would be cut to โRober,โ causing errors. A size of 20 allows flexibility without excess. - Answer: Mismatched data types (e.g., text instead of number for โAgeโ) prevent calculations or sorting, leading to errors.
Description: If โAgeโ is text, you canโt calculate an average. Correcting this during conversion ensures functionality. - Answer: Create a โBooksโ table (Primary Key: Book ID) and a โBorrowersโ table (Primary Key: Borrower ID, Foreign Key: Book ID) to link borrowed books to borrowers.
Description: This setup tracks which borrower has which book, using Book ID as the foreign key to connect the tables. - Answer: The DBMS rejects the entry or shows an error, as relational integrity requires valid links between tables.
Description: If a โGradesโ table references a โStudent IDโ that doesnโt exist in the โStudentsโ table, the system flags it to maintain data accuracy.
Ruwan Suraweera Changed status to publish May 22, 2025