Search code examples
mysqllimit

Create table with limited to only one record


Can we create a table in mysql that limited to only one record. E.g.: to enter interest rate. There should be only one record.


Solution

  • Alternative option: why don't you keep the interest rate by date?

    date (DATE, primary) | interest_rate (FLOAT)
    

    That way you even have the history of interest rates available, no need to restrict the amount of rows, and you still get the limit of one interest rate per day.