Last active
June 10, 2021 09:10
-
-
Save liopic/c78e536822db89df58dd8689ca030ad4 to your computer and use it in GitHub Desktop.
Ways to display tables' names in diferent DB
This file contains 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
-- redshift/postgres | |
select column_name,data_type | |
from information_schema.columns | |
where table_name = 'table_name'; | |
-- databricks | |
describe table tablename; |
This file contains 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
-- sqlite | |
select | |
name | |
from sqlite_master | |
where type ='table' | |
and name not like 'sqlite_%'; | |
-- redshift/postgres | |
select tablename | |
from pg_table_def | |
where schemaname = 'public'; | |
-- Databricks | |
show tables; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment