Decimal values stored as INTEGER type

In the New York Restaurants project, the review column of the nomnom table is of type INTEGER, but it has decimal values like 3.5 stored in it - how is this possible? Why was INTEGER data type chosen for this column?

… it shouldn’t be, as you’ve spotted.

I can’t review the project myself as I’m not a Pro subscriber… @midlindner, can you double-check that for me? :slight_smile:

Well the course material does say SQLite doesn’t enforce data types, but still why use INTEGER if there’s actually decimal values here?

You answered your own question? The data type should be a decimal/float. You get away with integer because SQLite doesn’t enforce data types, but that should not be the target/objective when programming.

Well I guess it’s confusing for learners, maybe it would make sense to correct this in the exercise.

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.