Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 804491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:55:44+00:00 2026-05-14T23:55:44+00:00

I am coding a classifieds ad web app. What is the optimal way to

  • 0

I am coding a classifieds ad web app.

What is the optimal way to structure the database for this?
Because of the high repeatability, would it be faster (in terms of searching/indexing) to have a separate table in the database for each city?

Or would it be okay to just have one table for every city (it would have a lot of rows..).

The classifieds table has id, user_id, city_name, category,[description and detail fields].

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:55:45+00:00Added an answer on May 14, 2026 at 11:55 pm

    You should break up the elements in your table into 4 tables.

    The first table, a city table, would have city_id and city_name. This table would need a unique index on city_name, city_id, as well as a primary index on city_id.

    The second table, a category table, would have category_id, and category. This table would need a unique index on category, category_id, as well as a primary index on category_id.

    The third table, a user table, would have user_id, user identification.

    The fourth table, an ad table, would have ad_id, title, description, and date_inserted. City_id, category_id, and user_id would be foreign keys to your ad table,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When coding web services, how do you structure your return values? How do you
Our coding guidelines prefer const_iterator , because they are a little faster compared to
I´m coding a native objective-c app for my regularly webdev work. It´s a CSS
I´m coding a CSS menu for Wordpress and I have this stupid problem: I
***Coding in C# This works: NpgsqlConnection conn = new NpgsqlConnection(conx.getConexion()); conn.Open(); NpgsqlDataAdapter da =
When coding with databases on the web with say php and mysql you have
This coding i got from here. I get error in log cat view like
Coding in VB.Net Hi guys I've got this problem where I'm trying to assign
While coding with UITableView, I encounter this bug that I couldn't understand. I got
For coding reasons which would horrify you (I'm too embarrassed to say), I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.