{"id":4856,"date":"2022-09-27T05:48:21","date_gmt":"2022-09-27T05:48:21","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=4856"},"modified":"2022-09-27T05:48:21","modified_gmt":"2022-09-27T05:48:21","slug":"what-are-the-different-types-of-relationships-in-sql","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/","title":{"rendered":"What are the different types of relationships in SQL ?"},"content":{"rendered":"<ul>\n<li style=\"text-align: justify;\">Data base collects different types of data that uses tables, record, and columns.<\/li>\n<li style=\"text-align: justify;\">For easy storage of data, a well-defined relationship is created between tables and databases.<\/li>\n<li style=\"text-align: justify;\">Data in a table is based on a relational model.<\/li>\n<li style=\"text-align: justify;\">A unique Id and the key is created for each row.<\/li>\n<li style=\"text-align: justify;\">Data attributes are held in the column of the table.<\/li>\n<\/ul>\n<h2 id=\"different-types-of-relational-database-tables\" style=\"text-align: justify;\">Different Types of Relational DataBase Tables<\/h2>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-4858 aligncenter\" src=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1.jpg\" alt=\"\" width=\"675\" height=\"464\" srcset=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1.jpg 675w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1-300x206.jpg 300w, https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1-390x268.jpg 390w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/p>\n<h3 id=\"one-to-one-relationship\" style=\"text-align: justify;\">One to One Relationship<\/h3>\n<ul style=\"text-align: justify;\">\n<li>This relationship helps to create a relationship between tables where a single row of the first table can only be related to one and only one record of the second row.<\/li>\n<li>The same way one record of the second table can be related to one and only one record of the first table.<\/li>\n<\/ul>\n<h3 id=\"one-to-many-relationship\" style=\"text-align: justify;\">One to many Relationship<\/h3>\n<ul style=\"text-align: justify;\">\n<li>This helps to create a relationship between the two tables.<\/li>\n<li>Any single row of a table can be connected to one or more rows in a second table.<\/li>\n<li>Rows from the second table can relate to only one row in the first table. This relationship is known as one to many relationship.<\/li>\n<\/ul>\n<h3 id=\"many-to-many-relationship\" style=\"text-align: justify;\">Many to Many Relationship<\/h3>\n<ul style=\"text-align: justify;\">\n<li>Here relationship is created between two tables.<\/li>\n<li>Each record in the first table can be related to many records in the second table.<\/li>\n<li>Similarly, each record from the second row can relate to any records in the first row.<\/li>\n<li>It is represented as N: N.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>Data base collects different types of data that uses tables, record, and columns. For easy storage of data, a well-defined relationship is created between tables and databases. Data in a table is based on a relational model. A unique Id and the key is created for each row. Data attributes are held in the column [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6547],"tags":[18604,18610,18612,18608,18601,18605,18602,18611,18609,18606,18603,18607],"class_list":["post-4856","post","type-post","status-publish","format-standard","hentry","category-sql","tag-database-relationships","tag-one-to-many-relationship-sql","tag-relationship-in-sql","tag-relationship-in-sql-with-example","tag-relationships-in-sql","tag-tables-relations-in-sql-server","tag-types-of-relationship-in-database-table","tag-types-of-relationship-in-database-with-example","tag-types-of-relationships-in-database","tag-what-are-the-3-types-of-relationships-in-a-database","tag-what-are-the-different-types-of-relationships-in-dbms","tag-what-is-relationship-in-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What are the different types of relationships in SQL ? - Wikitechy<\/title>\n<meta name=\"description\" content=\"What are the different types of relationships in SQL ? - Data base collects different types of data that uses tables, record, and columns.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are the different types of relationships in SQL ? - Wikitechy\" \/>\n<meta property=\"og:description\" content=\"What are the different types of relationships in SQL ? - Data base collects different types of data that uses tables, record, and columns.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-27T05:48:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1.jpg\" \/>\n<meta name=\"author\" content=\"webmaster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webmaster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/\"},\"author\":{\"name\":\"webmaster\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\"},\"headline\":\"What are the different types of relationships in SQL ?\",\"datePublished\":\"2022-09-27T05:48:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/\"},\"wordCount\":235,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/types-of-relationship-in-sql-1.jpg\",\"keywords\":[\"Database Relationships\",\"one-to-many relationship sql\",\"relationship in sql\",\"relationship in sql with example\",\"Relationships in SQL\",\"Tables Relations in SQL Server\",\"Types of Relationship in Database Table\",\"types of relationship in database with example\",\"types of relationships in database\",\"what are the 3 types of relationships in a database\",\"What are the different types of relationships in DBMS ?\",\"what is relationship in sql\"],\"articleSection\":[\"SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/\",\"name\":\"What are the different types of relationships in SQL ? - Wikitechy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/types-of-relationship-in-sql-1.jpg\",\"datePublished\":\"2022-09-27T05:48:21+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\"},\"description\":\"What are the different types of relationships in SQL ? - Data base collects different types of data that uses tables, record, and columns.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/sql\\\/what-are-the-different-types-of-relationships-in-sql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/types-of-relationship-in-sql-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/types-of-relationship-in-sql-1.jpg\",\"width\":675,\"height\":464},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/f785ba3ecc599133e65ab6138042a3e4\",\"name\":\"webmaster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g\",\"caption\":\"webmaster\"},\"sameAs\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\"],\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/author\\\/webmaster\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are the different types of relationships in SQL ? - Wikitechy","description":"What are the different types of relationships in SQL ? - Data base collects different types of data that uses tables, record, and columns.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/","og_locale":"en_US","og_type":"article","og_title":"What are the different types of relationships in SQL ? - Wikitechy","og_description":"What are the different types of relationships in SQL ? - Data base collects different types of data that uses tables, record, and columns.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/","og_site_name":"Wikitechy","article_published_time":"2022-09-27T05:48:21+00:00","og_image":[{"url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1.jpg","type":"","width":"","height":""}],"author":"webmaster","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webmaster","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/"},"author":{"name":"webmaster","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"headline":"What are the different types of relationships in SQL ?","datePublished":"2022-09-27T05:48:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/"},"wordCount":235,"commentCount":0,"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1.jpg","keywords":["Database Relationships","one-to-many relationship sql","relationship in sql","relationship in sql with example","Relationships in SQL","Tables Relations in SQL Server","Types of Relationship in Database Table","types of relationship in database with example","types of relationships in database","what are the 3 types of relationships in a database","What are the different types of relationships in DBMS ?","what is relationship in sql"],"articleSection":["SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/","name":"What are the different types of relationships in SQL ? - Wikitechy","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/#primaryimage"},"image":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1.jpg","datePublished":"2022-09-27T05:48:21+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4"},"description":"What are the different types of relationships in SQL ? - Data base collects different types of data that uses tables, record, and columns.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/sql\/what-are-the-different-types-of-relationships-in-sql\/#primaryimage","url":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1.jpg","contentUrl":"https:\/\/www.wikitechy.com\/interview-questions\/wp-content\/uploads\/2022\/09\/types-of-relationship-in-sql-1.jpg","width":675,"height":464},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/f785ba3ecc599133e65ab6138042a3e4","name":"webmaster","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/155b77fd8cdda3d0913fcb7e7ee63543b0c345d2d8f6dcebda5b0583ab61f967?s=96&d=mm&r=g","caption":"webmaster"},"sameAs":["https:\/\/www.wikitechy.com\/interview-questions"],"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/webmaster\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=4856"}],"version-history":[{"count":1,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4856\/revisions"}],"predecessor-version":[{"id":4859,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/4856\/revisions\/4859"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=4856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=4856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=4856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}