@adib007 nice
this is  what in Perl is a DBI (database interface) or in Ruby is called "migration"

I'm not sure but maybe Rails sth like this

class User < ActiveRecord::Migration
  def change
    create_table :users do |t|
      t.string :userid
      t.text :username
 
      t.timestamps
    end
  end
end

http://guides.rubyonrails.org/getting_started.html#creating-the-blog-application