<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hierarchical structure example - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/hierarchical-structure-example/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/hierarchical-structure-example/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Thu, 09 Sep 2021 06:17:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>hierarchical structure example - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/hierarchical-structure-example/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Design a database for a hierarchical data like country, state, zone, street etc., The tags and length of the hierarchy are not specific and they can change anytime ?</title>
		<link>https://www.wikitechy.com/interview-questions/dbms/design-a-database-for-a-hierarchical-data-like-country-state-zone-street-etc-the-tags-and-length-of-the-hierarchy-are-not-specific-and-they-can-change-anytime/</link>
					<comments>https://www.wikitechy.com/interview-questions/dbms/design-a-database-for-a-hierarchical-data-like-country-state-zone-street-etc-the-tags-and-length-of-the-hierarchy-are-not-specific-and-they-can-change-anytime/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 19 Jul 2021 10:31:55 +0000</pubDate>
				<category><![CDATA[DBMS]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[advantages and disadvantages of hierarchical model]]></category>
		<category><![CDATA[advantages and disadvantages of hierarchical structure]]></category>
		<category><![CDATA[advantages of hierarchical model]]></category>
		<category><![CDATA[advantages of hierarchical structure]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[characteristics of hierarchical database model]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[dawnbit interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[ehierarchical data model]]></category>
		<category><![CDATA[explain hierarchical data model with example]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[hierarchical data model example]]></category>
		<category><![CDATA[hierarchical data structure]]></category>
		<category><![CDATA[hierarchical databas]]></category>
		<category><![CDATA[hierarchical database advantages and disadvantages]]></category>
		<category><![CDATA[hierarchical database example]]></category>
		<category><![CDATA[hierarchical database model]]></category>
		<category><![CDATA[hierarchical database model advantages and disadvantages]]></category>
		<category><![CDATA[hierarchical database model diagram]]></category>
		<category><![CDATA[hierarchical model]]></category>
		<category><![CDATA[hierarchical model advantages and disadvantages]]></category>
		<category><![CDATA[hierarchical model example]]></category>
		<category><![CDATA[hierarchical queriesdis]]></category>
		<category><![CDATA[hierarchical structure definition]]></category>
		<category><![CDATA[hierarchical structure example]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mavenir interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[Prokarma Softech Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[RBS India Development Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Ruboid Technovision Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Shell Infotech interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what is hierarchical database]]></category>
		<category><![CDATA[what is hierarchical model]]></category>
		<category><![CDATA[Xoriant Solutions Pvt Ltd interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=1037</guid>

					<description><![CDATA[Answer : Hierarchical data is a common relational data pattern for representing tree-like data structures...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="hierarchical-data" class="color-pink" style="text-align: justify;">Hierarchical data</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Hierarchical data is a common relational data pattern for representing tree-like data structures, such as an organizational structure, a project breakdown list, or even a family tree.</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>In relational database model, One thing to remember is that flexibility in keys.</li>
<li>We have the flexibility to design the database, it might be worth having multiple geometry types for certain data types.</li>
<li>For example, having a city represented as a polygon would be useful to perform spatial queries to determine all points of interest within that city.</li>
<li>At the same time, it is oftentimes more desirable to represent a city as a point on a map. The database allows you to do this by separating the attribute data from the features into their own table, and linking them together with a Primary Key/Foreign Key structure.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/dbms/hierarchical-data.png" alt=" Hierarchical data" /></div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="primary-key" class="color-blue">Primary Key:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>A Primary Key is an identifier for a record in a table.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="foreign-key" class="color-blue">Foreign Key:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>A Foreign Key is a reference to that same identifier in a different table, thus linking them together.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="create-database-testdb" class="color-blue">CREATE DATABASE testDB:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn"></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>We want to includes this tables to the database:</li>
<li>Continent &#8211; Fields &#8211; Geom (Polygon), ID(Primary Key), Name, Etc</li>
</ul>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code id="code1" class="hljs scss" data-lang=""><span class="nt"><strong>CREATE <span class="hljs-tag">TABLE</span> Continent (
    ID int NOT NULL PRIMARY KEY,
    Name <span class="hljs-function">varchar</span>(255) NOT NULL,
    Geom_Polygon <span class="hljs-function">varchar</span>(255),
    Age int
);
</strong></span></code></pre>
</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<p>Country &#8211; Fields &#8211; Geom (Polygon), ID, Name, Continent ID(Foreign Key)</p>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code id="code2" class="hljs scss" data-lang=""><span class="nt"><strong>CREATE <span class="hljs-tag">TABLE</span> Country (
    ID int NOT NULL PRIMARY KEY,
    Name <span class="hljs-function">varchar</span>(255) NOT NULL,
    Geom_Polygon <span class="hljs-function">varchar</span>(255),
    Continent_id int FOREIGN KEY REFERENCES Continent (ID)
);</strong></span></code></pre>
</figure>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="region" class="color-blue">Region:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>If there are different levels of regions within a country, then we would have them as different layers.</li>
<li>So, if a country has regions called districts, and a number of districts combine to form a state, which then combine to form the country, you would have a layer for each type.</li>
<li>Reg_State &#8211; Fields &#8211; Geom (Polygon), ID (Primary Key), Name, Country ID, Etc</li>
</ul>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code id="code3" class="hljs scss" data-lang=""><span class="nt"><strong>CREATE <span class="hljs-tag">TABLE</span> Reg_State (
    ID int NOT NULL PRIMARY KEY,
    Name <span class="hljs-function">varchar</span>(255) NOT NULL,
    Geom_Polygon <span class="hljs-function">varchar</span>(255),
    Country_id int FOREIGN KEY REFERENCES <span class="hljs-function">Country</span>(ID)
);</strong></span></code></pre>
</figure>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="cities" class="color-blue">Cities:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Have a table that contains attributes for each city, but no geometry.</li>
<li>Have geometry tables with different geometries, like point or polygon, that link to the main city table.</li>
<li>City_Info &#8211; Fields &#8211; CityID (Primary key), Name,Reg_District ID (Foreign Key), Etc,</li>
</ul>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><strong><code id="code4" class="hljs scss" data-lang=""><span class="nt">CREATE <span class="hljs-tag">TABLE</span> City_Info (
    CityID int NOT NULL PRIMARY KEY,
    Name <span class="hljs-function">varchar</span>(255) NOT NULL,
    Reg_District_id int FOREIGN KEY REFERENCES <span class="hljs-function">District</span>(ID)
);</span></code></strong></pre>
</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<p>City_Pt &#8211; Fields &#8211; Geom (Point), ID, Name, CityID (Foreign Key)</p>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><strong><code id="code5" class="hljs scss" data-lang=""><span class="nt">CREATE <span class="hljs-tag">TABLE</span> City_Pt (
    ID int NOT NULL,
    Name <span class="hljs-function">varchar</span>(255) NOT NULL,
    Geom_Point <span class="hljs-function">varchar</span>(255),
    CityID int FOREIGN KEY REFERENCES <span class="hljs-function">City_Info</span>(CityID )
);</span></code></strong></pre>
</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<p>City_Poly &#8211; Fields &#8211; Geom (Polygon), ID, Name, CityID (Foreign Key)</p>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code id="code6" class="hljs scss" data-lang=""><span class="nt"><strong>CREATE <span class="hljs-tag">TABLE</span> City_Poly (
    ID int NOT NULL,
    Name <span class="hljs-function">varchar</span>(255) NOT NULL,
    Geom_Polygon <span class="hljs-function">varchar</span>(255),
    CityID int FOREIGN KEY REFERENCES <span class="hljs-function">City_Info</span>(CityID )
);</strong></span></code></pre>
</figure>
</div>
</div>
<div class="Content">
<div class="hddn">
<p style="text-align: justify;">This is the one of the ways of setting up the database, again it depends on your specific needs for being able to link different pieces of data together.</p>
<ul>
<li style="text-align: justify;">Once the table structure is determined, the next part will be to set up queries to retrieve the information you want, for inclusion in a report or some sort of viewing application.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/dbms/design-a-database-for-a-hierarchical-data-like-country-state-zone-street-etc-the-tags-and-length-of-the-hierarchy-are-not-specific-and-they-can-change-anytime/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
