My account
Book a demo
Search
Product
Key Features
Data Catalog
Catalog all your data, reports, and collaborate with your data community.
Data Lineage
Create a map of your data flow with automated lineage on object and column level.
Data Quality & Profiling
Improve data quality and increase trust in your data with data profiling, lineage & more.
Dataedo AI
Create auto object descriptions and get help from AI chat in finding tables & writing queries.
Business Glossary
Build and share a universal glossary of business terms, policies and rules.
Data Classification
Find and tag sensitive data in your databases to comply with data protection regulation.
See all features →
More Features
Data Community
Domains
Reference Data Management
StewardHub
Schema Change Tracking
Workflows
Technologies
Connectors
SQL Server
Snowflake
Power Bi
Tableau
Qlik Sense
soon
Databricks
Microsoft Fabric
Azure
AWS
Oracle
All Connectors →
Learn More
Metadata Scanning
Solutions
By Use Case
Data Governance
Data Quality
Selft-Service Analytics
Data Protection
Business Intelligence
Data Warehousing
Metadata Management
All Use Cases →
By Industry
Financial Services
Healthcare
Public & Government
Education
Technology
Retail
Energy & Utilities
All Industries →
Pricing
Resources
Learn About Dataedo
Documentation
Roadmap
Tutorial Videos
Dataedo Bootcamp
Downloads
Learn About Data
Blog
Webinars
Tutorials
Knowledge Base
Data Events
After Hours
Data Cartoons
Cartoon Ebooks
About us
About us
Why Dataedo
Our Customers
Our Partners
Careers
Contact Us
Book a demo
Try Dataedo
Database Query Toolbox
List all primary keys (PKs) and their columns in popular relational databases
Piotr Kononow
5th October, 2018
Queries below list all primary keys (PKs) and their columns from popular relational databases:
SQL Server: List all primary keys (PKs) and their columns
Azure SQL Database: List all primary keys (PKs) and their columns
Oracle database: List all primary keys (PKs) and their columns
Amazon Redshift: List all primary keys (PKs) and their columns
IBM Db2: List all primary keys (PKs) and their columns
Teradata: List all primary keys (PKs) and their columns in Teradata database
Vertica: List all primary keys (PKs) and their columns
PostgreSQL: List all primary keys (PKs) and their columns
MySQL: List all primary keys (PKs) and their columns
MariaDB: List all primary keys (PKs) and their columns