Mechanism to validate the cardinality of SQL joins
When using SQL (Snowflake) I often join tables. I can never be 100% sure that the join is a one-to-one, one-to-many, many-to-many, etc... In Python pandas this is a setting in merge statements that will assert that the join is of the expected kind. Is there an equivalent in SQL? This is the pandas API: table1 = pd.DataFrame({ 'userId': [1,2,3], 'age':[20,30,40] }) #| userId | age | #|---------:|------:| #| 1 | 20 | #| 2 | 30 | #| 3 | 40 | table2 = pd.DataFrame({ 'userId': [1,2,2,3], 'gender':['M','M','F', 'F'], 'gender_valid_to_date': [None, '2020-01-01', None, None] }) #| userId | gender | ge
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.