Converting Json to SQL table
<p>I'm trying to learn how to get the following format of json to sql table. I used python pandas and it is converting the json nodes to dictionary.</p>
<p>Same json:</p>
<pre><code>{
    &quot;Volumes&quot;: [
        {
            &quot;AvailabilityZone&quot;: &quot;us-east-1a&quot;,
            &quot;Attachments&quot;: [
                {
                    &quot;AttachTime&quot;: &quot;2013-12-18T22:35:00.000Z&quot;,
                    &quot;InstanceId&quot;: &quot;i-1234567890abcdef0&quot;,
                    &quot;VolumeId&quot;: &quot;vol-049df61146c4d7901&quot;,
                    &quot;State&quot;: &quot;attached&quot;,
                    &quot;DeleteOnTermination&quot;: true,
                    &quot;Device&quot;: &quot;/dev/sda1&quot;
                }
            ],
            &quot;Tags&quot;: [
            {
                &quot;Value&quot;: &quot;DBJanitor-Private&quot;,
                &quot;Key&quot;: &quot;Name&quot;
            },
            {
                &quot;Value&quot;: &quot;DBJanitor&quot;,
                &quot;Key&quot;: &quot;Owner&quot;
            },
            {
                &quot;Value&quot;: &quot;Database&quot;,
                &quot;Key&quot;: &quot;Product&quot;
            },
            {
                &quot;Value&quot;: &quot;DB Janitor&quot;,
                &quot;Key&quot;: &quot;Portfolio&quot;
            },
            {
                &quot;Value&quot;: &quot;DB Service&quot;,
                &quot;Key&quot;: &quot;Service&quot;
            }
        ],
            &quot;VolumeType&quot;: &quot;standard&quot;,
            &quot;VolumeId&quot;: &quot;vol-049df61146c4d7901&quot;,
            &quot;State&quot;: &quot;in-use&quot;,
            &quot;SnapshotId&quot;: &quot;snap-1234567890abcdef0&quot;,
            &quot;CreateTime&quot;: &quot;2013-12-18T22:35:00.084Z&quot;,
            &quot;Size&quot;: 8
        },
        {
            &quot;AvailabilityZone&quot;: &quot;us-east-1a&quot;,
            &quot;Attachments&quot;: [],
            &quot;VolumeType&quot;: &quot;io1&quot;,
            &quot;VolumeId&quot;: &quot;vol-1234567890abcdef0&quot;,
            &quot;State&quot;: &quot;available&quot;,
            &quot;Iops&quot;: 1000,
            &quot;SnapshotId&quot;: null,
            &quot;CreateTime&quot;: &quot;2014-02-27T00:02:41.791Z&quot;,
            &quot;Size&quot;: 100
        }
    ]
}
</code></pre>
<p>until now.. this what I was trying... in python:</p>
<pre><code>asg_list_json_Tags=asg_list_json[&quot;AutoScalingGroups&quot;]
Tags=pandas.DataFrame(asg_list_json_Tags)
n = []
for i in Tags.columns:
    n.append(i)
print n

engine = create_engine(&quot;mysql+mysqldb://user:&quot;+'pwd'+&quot;@mysqlserver/dbname&quot;)
Tags.to_sql(name='TableName', con=engine, if_exists='append', index=True)
</code></pre>