sql-ecology-lesson icon indicating copy to clipboard operation
sql-ecology-lesson copied to clipboard

Lesson Contribution - datatypes INTEGER and SMALLINT

Open Talishask opened this issue 4 years ago • 1 comments

I'm a member of The Carpentries staff and I'm submitting this issue on behalf of another member of the community. In most cases, I won't be able to follow up or provide more details other than what I'm providing below.


In the Introduction to Database and SQL lesson(https://datacarpentry.org/sql-ecology-lesson/00-sql-introduction/index.html), I am recommending an addition(s). In the datatype section, two datatypes INTEGER and SMALLINT, were mentioned. However, their description is exactly the same and can create confusion. Hence, I propose adding an explanation such as INTEGER data type has 32 bits and can represent whole numbers from [(-2 power 31)-1] through [(2 power 31)-1]. In contrast, the SMALLINT data type has only 16 bits.

Similarly, two datatypes, CHAR and VARCHAR, were mentioned. However, it has not been explained when to use which one. Such as:

    1. Char when the sizes of the column data entries are consistent.
    1. Varchar when the sizes of the column data entries vary considerably.

I think these two additions will be helpful for the learners.

Talishask avatar Feb 09 '21 22:02 Talishask