Skip to content

Shailesh-python/Case-Study-7-Pandas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Case Study #7 Balanced Tree

The following are my solutions to the Case Study 7 Balanced Tree questions in Danny Ma's Serious SQL course

There are 4 data tables available to us in balanced_tree schema which we can use to run our SQL queries with:

  1. Product Details

  2. Product Sales

  3. Product Hierarcy

  4. Product Price

import pandas as pd
import numpy as np
import pyodbc as py
import numpy as np

import warnings
warnings.filterwarnings('ignore')
conn = py.connect(
    "DRIVER={SQL Server};SERVER=SHAILESH-PC\SQLEXPRESS;DATABASE=DannyMa;"
)

df_sales = pd.read_sql_query('select * from balanced_tree.sales',conn)
df_pp = pd.read_sql_query('select * from balanced_tree.product_prices',conn)
df_ph = pd.read_sql_query('select * from balanced_tree.product_hierarchy',conn)
df_pd = pd.read_sql_query('select * from balanced_tree.product_details',conn)

conn.close()

Check my solution

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published