ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 15th, 2009, 11:02 PM
gavy gavy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 63 gavy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 41 m 9 sec
Reputation Power: 1
Logic help required

I have one categories table which have catid, category and parentID.

and i have zips table which list states and city.

now i am trying to load the categories based on city selection. do i need to add cityID to the categories table.

1. will that not make duplicate categories for every city.
2. if 10 cities, every city has 5 common categories. there will be a buch of duplicate categories.

So is there any way you guys can provide me a suggestion. how i do this.

Reply With Quote
  #2  
Old May 16th, 2009, 08:15 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 20,691 r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level)r937 User rank is General 22nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 1 Week 3 Days 9 h 48 m 4 sec
Reputation Power: 2459
how many categories do you want each city to have?

if only one, then add a category foreign key column to the city table

if more than one, you need a new many-to-many table, containing the category FK as well as the city FK
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
  #3  
Old May 17th, 2009, 01:53 PM
kiteless kiteless is offline
Moderator
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 4,260 kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 2 Weeks 5 h 39 m 34 sec
Reputation Power: 896
Gavy I see you tend to ask a fair number of SQL-related questions, so I have to ask: have you actually read a book on SQL or database design? I think something like that would help you a lot going forward, and make it much easier for you to tackle problems like this.
Comments on this post
cfSearching agrees!

Reply With Quote
  #4  
Old May 23rd, 2009, 03:59 PM
gavy gavy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 63 gavy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 41 m 9 sec
Reputation Power: 1
yes but currently i am reading book on mysql beginning. i just started.

Reply With Quote
  #5  
Old May 24th, 2009, 02:11 PM
kiteless kiteless is offline
Moderator
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 4,260 kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level)kiteless User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 2 Weeks 5 h 39 m 34 sec
Reputation Power: 896
I mean just an SQL book for starters. MySQL is far more complex than the SQL language itself. Something like this, which is very cheap and short, that you can read in a day or two and is an excellent resource: Teach Yourself SQL in 10 Minutes
Comments on this post
medialint agrees!
Arty Ziff agrees!
hiker agrees!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Logic help required


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
Stay green...Green IT