0

I have a come up with the following schema for a client of mine. Does anything look off here especially the Order Line Items. Should i use inheritance. I'm pretty sure that this site will only allow you to order courses, lessons, and giftcards, and that's it

Any feedback would be appreciated

enter image description here

2 Answers 2

1

Just my thinking on the design:

  1. You have Courses, Lessons and GiftCards tables for the possible purchase objects, and OrderLines contains IDs for each of the tables. But in case a customer will purchase a Lesson and a GiftCard, they should be shown as 2 lines in the order. Also, what you will do if your client will want to trade more objects?

    Therefore I think it might be better to redesign this part, like this:

    • OrderLines rename to OrderItems;
    • add ItemType table with 3 rows: Courses, Lessons, GiftCards;
    • add Items table with (ItemId, ItemType, Title, Price, LanguageCode, SortOrder, etc.) fields.

    This way it will also be possible to add reviews not only for Lessons, but for all possible items.

    You will have to come up with the preferred way to keep fields for the Items details. Right now Courses and Lessons share a lot of fields, therefore it might be reasonable to move all of them into the new Items table, as such fields seems also to be valid for the GiftCards also. And in case you have some specific details, like for GiftCards, you might add specific tables, like GiftCardItems with Items.id and a set of special fields not shared with other Item types.

  2. A minor note: I would split Users into a couple of tables, as I suppose that this table will contain both, customers and support stuff. This means that this table might grow big (depending on how many customers are expected). Maintaining so many fields in a single table might be problematic when table will grow in number of rows.

And I agree with Matt — it is difficult to tell anything without requirements.

Sign up to request clarification or add additional context in comments.

Comments

0

It is really hard to tell without knowing the requirements from your client. Everything looks good but I can't really tell if it is all inclusive of what the client wants without their requirements documentation.

2 Comments

The website is basically allow users to purchase courses, lessons, or giftcards i am specifically asking about the orderline table. Show i have a more generic table product or is it fine how i did it thanks in advance
are you using Top Down approach? I fell they should be able to view the courses and lessons before they decide on what they want to purchase. Not just pop up an order screen and let them research from there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.