working with json and sql data

 to read json data:

   df=pd.read_json("train.json")

to real sql data:

    sql data consists query that have insert command and those command you need to fetch in your ide of python using xampp server

   step 1: download the data to your local machine

  step 2: open xampp server

  step 3: create database and upload the file of your designed file

  step 4: install sql conector in your ide by typing the given code

             !pip install mysql.connector

  step 5: import mysql.connector

  step 6: conn=mysql.connector.connect(host='localhost',user='root',password='',database='world')

      this creates an object of sql format : localhost= host ip name, user=name of database, password=database password

  step 7: pd.read_sql_query("SELECT * FROM CITY",conn)

      select * from city is the query you want to show you can show any rquery as you want according to your need

  

Comments