Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DB Structure Question - Tell me your suggestions!

Featured Replies

Hey Everyone,

I am creating a database that has 4 tables:

customers

orders

orderitems

catalog_items

A customer will log into this site and ONLY the catalog items that have been applied to that customer's account can be listed.

In other words, let's say there are 400 catalog_items but that customer only can sell 90 of them, that is all that will appear.

I am debating what is the best way to do this.

I could create a table called allowed_items that is the same as catalog_items but with an extra field that says who this is approved for, but that table will be huge, and there will be duplicates (if 5 customers sell the same product there will be 5 records).

The other solution I came up with is to create a blob field in the customers table called allowed_items that just put a table or comma delineated list of all the items.

I could also create a blob field in the catalog_items and list the users who are allowed.

Does this seem reasonable?

Suggestions are appreciated.

Dave

Join table between customers and catalog_items?

As far as good database design, you need another table. Any time you identify a many-to-many relationship, you should strongly consider adding a table. This table may be long, but it only needs two feilds:

customer_id

item_number

Then, your layouts (or scripts) that show products to customers when they log in would iterate through the 'join table' (maybe called "approved_items") for any lines that match the customer_id.

Now, I am speaking from the world of relational database design, not FileMaker Pro design. I would hope they are the same, but I am very new to FileMaker. Good Luck!

Edited by Guest
Clarity

  • Newbies

I agree that creating a separate table is the best solution from a database design view. In FMP however, it is possible to enter multiple key values in one field, each on its own line. If your only purpose is to limit the choice of items (and the itemlist is limited anyway), this may be a very practical solution.

That said, using an extra table also gives you extra options, such as adding a validity (expiration date), that you can include in the relation definition. It depends on what your needs are.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.