Skip to content

Instantly share code, notes, and snippets.

View aveek22's full-sized avatar
🏠
Working from home

Aveek aveek22

🏠
Working from home
View GitHub Profile
import json
def greet(user):
print(f'Hello {user}')
def main():
greet('Aveek')
if __name__ == '__main__':
main()
import json
def pos_arg(a,b,c):
print(f'The value of a is: {a}')
print(f'The value of b is: {b}')
print(f'The value of c is: {c}')
def main():
pos_arg(10,20,30)
import json
def greet(*users):
for user in users:
print(f'Welcome {user}')
def main():
greet('Fred', 'Harry', 'Tom')
if __name__ == '__main__':
import json
def greet(**users):
for key,value in users.items():
print(f'{key} => {value}.')
def main():
greet(user='Tom', city='London', pet=['Dog', 'Cat', 'Fish'])
if __name__ == '__main__':
def quicktext():
print('Hello, welcome to QuickSample package.')
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="quicksample", # This is the name of the package
version="0.0.1", # The initial release version
author="Aveek Das", # Full name of the author
description="Quicksample Test Package for SQLShack Demo",

QuickSample

A sample python package deployment utility for SQLShack Demo.

ALTER TABLE mumbai_house_price_raw
ADD COLUMN house_price_category VARCHAR(20);
UPDATE mumbai_house_price_raw
SET house_price_category = CASE WHEN price < 20000 THEN 'Below 20K'
WHEN price >= 20000 AND price < 40000 THEN '20K - 40K'
WHEN price >= 40000 THEN 'Above 50K'
END;
SELECT
house_price_category,
COUNT(1) number_houses
FROM mumbai_house_price_raw
GROUP BY house_price_category;
CREATE OR REPLACE VIEW vw_mumbai_houses_airport_5km
AS
SELECT *
FROM mumbai_house_price_raw
WHERE 1=1
AND ST_DISTANCE(
ST_TRANSFORM(ST_GEOMFROMTEXT('POINT(72.874374 19.096713)',4326), 7755),
ST_TRANSFORM((geometry),7755)
) <= 5000;