Hello everyone.
Please tell me what type of data in the database would be more correct to use.
I need to define seasonal intervals within a year. For example: Low season (September 1 - November 15, February 1 - March 15) and Medium season (November 16 - December 20) and High season (December 21 - January 31). Apply them to each current year.
Create a seasons table:
id,
name,
start,
end,
price,
company_id
What is the best data type to use in a database: start and end?
Type Date: 2022-09-01 - 2022-11-15
Type Float: 09.01 - 11.15 (M.D - M.D)
Type Integer: 901 - 1115 (901/100 = 9.01 (m.d) - 1115/100 = 11.15 (m.d))
Validation:
When creating a record in the database, you need to check whether the periods overlap each other.
When updating a record, ignore the current company ID
When creating a query, get prices depending on the season.