Question: Write a program to take as input rollnumber.code and perform the following DBMS action Internally create your own data structure for a table and operate

  1. Write a program to take as input rollnumber.code and perform the following DBMS action
  2. Internally create your own data structure for a table and operate on the same
  1. Create_table(tabname)-should create a table in a separate file
  2. Add_attribute(t,attr_type,attr_name)-should add an attribute to the table data in the file
  3. Insert_into(t,datarow)-should insert data into table data file
  4. T=load_table (tabname)-should load the table from file
  5. Save_table(t)-should save the table after insertion of rows from file
  6. Save_table(t) should save the table after insertion of rows

For example,

Query)

Create table mytab 2

Int a

Float b

Insert into mytab(12,23,4)

Would have generated intermediate code as below code

Create table mytab

Add_attribute mytab int a

Add_attribute mytab float b

Insert into mytab(12,23,4)

The corresponding function call sequence when executing

Execute)

Create table (mytab)

t=load table(mytab)

add_attribute (t, int a)

add_attribute (t, float b)

t=load table(mytab)

save_table(t)

insert into (t,(12,23,4))

save_table(t)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!