ID NAME USER LOCATION
The information in the DESKTOP table stores one row for each desktop in the office. So the contents might look like the following:
ID NAME USER LOCATION 1 vader bob Rm 100 2 kenobi sue Rm 101 3 sidius john Rm 101
Now I'll have another table with all of my possible components of those desktops. Such a COMPONENT table might look like the following:
ID TYPE VALUE 1 Harddrive 100GB 2 Harddrive 200GB 3 Memory 1GB 4 Memory 512MB 5 Memory 2GB
So now all I need is a table in the middle to make a connection between the desktops and their components. Such a table (we'll call it DESKTOP_COMPONENTS) might look like the following:
DESKTOP_ID COMPONENT_ID 1 1 1 3 2 1 2 4 3 2 3 5
Joining all three tables with the following query should reveal the components of each desktop:
SELECT d.name,c.type, c.value FROM desktop d, desktop_components dc, components c WHERE d.id = dc.desktop_id AND dc.component_id = c.id;
Dig Deeper on Oracle database design and architecture
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.