1

I'm pretty new to RDBMS so I'm wondering how I should do this.

Supposed that i have a dictionary-like table with 2 columns: a word and its meaning.

If i want to store a list of emotions and its meaning, it would have the word representing the emotion, and its meaning retrieving from the dictionary-like table.

In other words, the emotions table is a subset of the dictionary table.

What would be the best way to structure/organise this database?

If i use a single table with a column to indicate if it is an emotion, the operation to retrieve the list of emotions will not be efficient.

If i store them on separate tables, there would be duplication of data (meaning of the emotion and meaning of the word).

James
  • 317
  • 2
  • 15
  • 1
    Your Question is fuzzy, not clearly delineated. The first step in designing a database is getting *really* specific on (a) identifying your *entities*, and (b) defining the *relationships* between those entities. You have not done so yet in your Question. For example, an invoicing system: A customer buys stuff from us, each purchase is represented by a single invoice. Each invoice belongs to exactly one customer. No ‘orphan‘ invoices allowed, as each must be assigned to a customer. Each invoice carries one or more invoice line items. Each line item belongs to exactly one invoice. – Basil Bourque Jun 27 '17 at 04:27
  • What do you mean, "best" and "efficient" and "duplication"? And [why do you think "duplication" is bad](https://stackoverflow.com/a/44539858/3404097)? There is no point in worry about things when you don't know anything. You need to learn basics of information modeling & relational database design. Your question is essentially asking for some chapters of some book(s). Find some. Many books/slides/courses are free online. PS Please read [ask] and [mcve]. – philipxy Jul 03 '17 at 07:33

0 Answers0