Database Reference
In-Depth Information
-----------------------------------------------------------------
All Purpose Trail & Buckeye Trail & Sagamore
Creek Loop Trail
Hemlock Loop Trail & Prairie Loop Trail &
Wildflower Loop Trail
NC1 & NC2
Hinckley Hills Loop Trail & HI3
All Purpose Trail & North Ravine Loop Trail
BR3 & BR4 & Buckeye Trail
Bridle Trail & Hemlock Loop Trail
Hemlock Trail & NC2
Hinckley Hills Loop Trail & HI1
Lake Isaac Trail & Lake to Lake Trail
(10 rows)
This is where the normalization of our table will begin.
How to do it...
Thefirstthingweneedtodoisfindallthefieldsthatdon'thaveampersandsanduse
thoseasouruniquelistofavailabletrails.Inourcase,wecandothis,aseverytrail
has at least one segment that is uniquely named and not associated with another
trailname.Thisapproachwillnotworkwithalldatasets,sobecarefulinunderstand-
ingyourdatabeforeapplyingthisapproachtothatdata.Toselectthefieldswithout
ampersands, we use the following query:
SELECT DISTINCT label_name, res
FROM chp02.trails
WHERE label_name NOT LIKE '%&%';
It will return the following output:
label_name
| res
--------------------------------------------+-------------------
South Quarry Loop Trail |
Search WWH ::




Custom Search