Title: Difference between Primary key and Unique key - GeeksforGeeks
Open Graph Title: Difference between Primary key and Unique key - GeeksforGeeks
Description: Your All-in-One Learning Portal. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
Open Graph Description: Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
Keywords:
Opengraph URL: https://www.geeksforgeeks.org/dbms/difference-between-primary-key-and-unique-key/
Domain: www.geeksforgeeks.org
{"@context":"https://schema.org","@type":"Article","mainEntityOfPage":{"@type":"WebPage","id":"https://www.geeksforgeeks.org/dbms/difference-between-primary-key-and-unique-key/"},"headline":"Difference between Primary key and Unique key","datePublished":"2018-12-27 06:15:09","dateModified":"2025-07-11 05:22:25","image":{"@type":"ImageObject","url":"https://media.geeksforgeeks.org/wp-content/uploads/20230515131058/pk.webp","width":"480","height":"179"},"author":{"@type":"Organization","name":"GeeksforGeeks","url":"https://www.geeksforgeeks.org/","logo":{"@type":"ImageObject","url":"https://media.geeksforgeeks.org/wp-content/cdn-uploads/logo-new-2.svg","width":"301","height":"40"}},"publisher":{"@type":"Organization","name":"GeeksforGeeks","url":"https://www.geeksforgeeks.org/","logo":{"@type":"ImageObject","url":"https://media.geeksforgeeks.org/wp-content/cdn-uploads/logo-new-2.svg","width":"301","height":"40"}},"description":"Keys play a crucial role in relational databases by ensuring data integrity and efficient access to records. Keys help to identify individual rows in a table prevent from data being duplicated and also enable reliable relationships between tables. There are several types of Keys - Primary Key, Candidate Key, Super","about":[{"@type":"Thing","name":"TechnicalScripter"},{"@type":"Thing","name":"Dbms"},{"@type":"Thing","name":"DifferenceBetween"},{"@type":"Thing","name":"DbmsRelationalAlgebra"},{"@type":"Thing","name":"DbmsSql"}]}
{"@context":"https://schema.org","@type":"WebSite","name":"GeeksforGeeks","url":"https://www.geeksforgeeks.org/","potentialAction":{"@type":"SearchAction","target":"https://www.geeksforgeeks.org/search/{search_term_string}/","query-input":"required name=search_term_string"}}
{"@context":"https://schema.org","@type":"Organization","name":"GeeksforGeeks","url":"https://www.geeksforgeeks.org/","logo":"https://media.geeksforgeeks.org/wp-content/cdn-uploads/20200817185016/gfg_complete_logo_2x-min.png","description":"Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.","founder":[{"@type":"Person","name":"Sandeep Jain","url":"https://in.linkedin.com/in/sandeep-jain-b3940815"}],"sameAs":["https://www.facebook.com/geeksforgeeks.org/","https://twitter.com/geeksforgeeks","https://www.linkedin.com/company/1299009","https://www.youtube.com/geeksforgeeksvideos/"]}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"DBMS","item":{"@type":"Thing","@id":"https://www.geeksforgeeks.org/category/dbms/"}},{"@type":"ListItem","position":2,"name":"difference-between-primary-key-and-unique-key","item":{"@type":"Thing","@id":"https://www.geeksforgeeks.org/dbms/difference-between-primary-key-and-unique-key/"}}]}
| theme-color | #308D46 |
| image | https://media.geeksforgeeks.org/wp-content/cdn-uploads/gfg_200x200-min.png |
| og:image:type | image/png |
| og:image:width | 200 |
| og:image:height | 200 |
| facebook-domain-verification | xo7t4ve2wn3ywfkjdvwbrk01pvdond |
| og:site_name | GeeksforGeeks |
| og:image | https://media.geeksforgeeks.org/wp-content/uploads/20230515131058/pk.webp |
| article:section | Technical Scripter |
| article:tag | DBMS-SQL |
| og:type | article |
| og:locale | en_US |
| article:published_time | 2018-12-27 06:15:09+00:00 |
| article:modified_time | 2025-07-11 17:22:25+00:00 |
| og:updated_time | 2025-07-11 17:22:25+00:00 |
| og:image:secure_url | https://media.geeksforgeeks.org/wp-content/uploads/20230515131008/uk.webp |
| msapplication-TileImage | https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png |
| next-head-count | 44 |
Links:
Viewport: width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0
Robots: index, follow, max-image-preview:large, max-snippet:-1