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 7 days ago
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