dear friend i am using mysql and oracle. would you create the tables and send me their code here. Please because i am searching this problem solution from last 3 months. Please i humbly request you help me.
Creating a foreign key is required for refrential integrity and is normally a good practice. It is also true that a foreign key has a say inperformance. To make it better what you can do is to create index on the foreign keys.
As I mentioned creating a foreign key constraint is required for refrential integrety and normally is a good practice. It do have an impact on performance which can be reduced by creating an index. If you craete the index on foreign key it will reduce the lookups.
Creating a foreign key is not mandatory but is advised to create. Here[^] is a link which tells about the importance of it.
Now here[^] is another article which tells about refrential integrity and performance degradation which might give you a bit more idea about this.
i want to convert this days (integer) to years months and days
Well, break it down.. if you have the number of days, how many days in a year? Let's assume 365; so number of years in int(number of days / 365).
Months... let's assume 30 days on average... Months = int((number of days - years * 365) / 30)
And days are then number of days - years * 365 - months * 30
If that doesn't work, better define what you're after.
Given the sample dates you provided, what are the values you calculated for years, months and days?