I'm a beginner in SQL.
I'm thinking of developing a household account book app at home to study, but I can't decide the name of the table.
Specifically, I am worried about XXX below.
"Monthly_expense" is mentioned as a candidate, but
It doesn't fit me well, so please give me some advice.
■ Table name
1.XXX—Table that manages annual expense information
■ Column name
ID id
Year_month
Category catg_id
Category name catg_name
Name
Quantity item_num
Price
■ Table name
2.catg_master —Table for managing expense categories
■ Column name
Category ID catg_id
Category Name catg_name
Dear Kabichan,
Thank you for pointing it out.
I have corrected it as follows.
The correction part is ○ and the deletion part is x.
■ Table name
○1.expense: Table for managing expenditure information by year
■ Column name
ID id
○ Date of expenditure: expense_date
Category catg_id
x Category name catg_name
Name
Quantity item_num
Price
■ Table name
2.catg_master —Table for managing expense categories
■ Column name
Category ID catg_id
Category Name catg_name
Perhaps this kind of question is not a stack overflow, but a software engineering question, but it seems that there is no Japanese version of software engineering, so I will answer it just in case.
Naming conventions vary from person to person and company, so it's just my personal opinion, but first of all, year_month
data type is datetime
and ExpenseDate
.I think that it will be more flexible to take out data such as daily, monthly, and yearly.
In that case, I think Expense
would be good for the table name (in the sense that it is not limited to monthly).
Also, although this is not mentioned in the question, you do not need to include catg_name
in the Expense
table.The advantage of relational database
is that catg_name
is to extract catg_name
by join
the two tables.
566 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
871 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
570 Understanding How to Configure Google API Key
594 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.