[SOLVED] DBMS Assignment 5

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon DBMS-5-vp001t.zip (791.4 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

Modifications to Datastore (UPDATE and DELETE)

In this lab session, you will implement UPDATE and DELETE in Personal Data Store (PDS) based on a key field.

Storage Structure Changes

1. Data file change: For every record being saved, store the key explicitly followed by the data record 2. Index file change: Store 100 integers as a placeholder for offset of deleted records

Main PDS functions

A) pds_open

Changes as needed for Storage Structure Changes noted above

B) put_rec_by_key

Changes as needed for Storage Structure Changes noted above

C) get_rec_by_ndx_key

Changes as needed for managing deleted objects

D) pds_close

Changes as needed for Storage Structure Changes noted above

E) get_rec_by_non_ndx_key

Changes as needed for managing deleted objects

G) bst.c

Impletement bst_delete to delete node from BST

H) New Functions in pds.c

// update
// Search for index entry in BST
// Seek to the file location based on offset in // Overwrite the existing record with the given // In case of any error, return PDS_MODIFY_FAILED int update_by_key( int key, void *newrec );

// pds_delete
// Search for index entry in BST
// store the offset value in to free list
int delete_by_key( int key );

Testing

  1. Use contact_loader.c program to import contacts in bulk for testing. Input file with data is given to you.
  2. The following driver program is given to you:
     pds_tester.c (generic testing with input data file like testcase.in).
index entry
record

 This file takes a file with commands such as (CREATE, STORE, RETRIEVE, OPEN, CLOSE) inside.

c. Test your program thoroughly with the above driver program with the test input file d. Do additional testing by creating your own test input files

Commands

  1. Use the following command for creating contact_loader executable:

    gcc -o contact_loader contact_loader.c bst.c contact.c pds.c

    Use contact loader to import data using the following command:

    contact_loader scandemo contact_dump.txt

  2. Use the following command for creating pds_tester executable:

    gcc -o pds_tester bst.c contact.c pds.c pds_tester.c

    For testing using pds_tester, use the following command:

               pds_tester testcase.in
    

1 file · 791.4 KB

  • DBMS-5-vp001t.zip 791.4 KB