Think of it this way:
You have a table of all your items, and their attributes, including their unique key. All of this stuff:
PartID integer NOT NULL nextval
PartNumber character varying(30) NOT NULL
LotNumber character varying(20)
PartDesc character varying(255)
PartListPrice numeric(10,2)
PartCostPrice numeric(10,2)
PartQtyOnhand integer
PartQtyMin integer
PartQtyTarget integer
Now in addition to that, we are going to add a column called PartParent that shows the relationship. Let's say this is our example data (sorry, I don't know cars):
id | parent | name
1 | 0 | bike
2 | 1 | wheel
3 | 2 | spoke
4 | 1 | innertube
5 | 4 | valve
Look at valve (id: 5)
You can follow its parent ID to innertube, and then to wheel, and then to bike (which is root). If you wanted to get the lineage of valve, then you would recursive query with each parent id until you hit a null value, meaning you are at the top. You can build each layer into a string, or an array depending on what you are doing with the information.
Similarly, you can find all the items that have bike as it's parent by selecting everything with a parent of '1' (2,4). Then for each of those select the items that have that id as their parent.
By writing recursive functions, you can find any level of depth. They keep querying and getting new id's, and feeding that ID back to itself and requerying until you hit a wall (0 results if you are going down, or a null value if you are going up).
That is the concept. Do a little looking around and you will find tuts and sample scripts to do this.