Last active
October 10, 2020 20:26
-
-
Save exy02/f907401b46f2d9790b118837010cb829 to your computer and use it in GitHub Desktop.
Simplified PostgreSQL querying (with or without SSH) - General Queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql_statement = """ | |
SELECT column_name, data_type | |
FROM information_schema.columns | |
WHERE table_name = 'ey_test_table' | |
; | |
""" | |
query_df = pgres.query(db='database_name', query=sql_statement) | |
query_df | |
#returns the results of an sql statement as a pandas dataframe. | |
#This example returns the column names and data types of table 'ey_test_table'. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment