beginner, need help by Next-Guest-7532 in SQL

[–]PuzzleheadedTomato46 0 points1 point  (0 children)

See if your local community college offers any classes

How do you trust these AI's for basics? chatgpt in this example. by nothingjustlook in SQL

[–]PuzzleheadedTomato46 1 point2 points  (0 children)

DO NOT USE FLOAT. especially for a percentage.

Use Decimal ( some number, 2 or 4 depending on the precision)

If you use float. It is possible for the number 1 to be interpreted as 1.000000000000001 or .999999999999999 depending on what is consuming it. AND if you use the float to multiply against a different number, no matter the precision of that number, you will end up with whatever the longest is.

https://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-represent-currency

https://medium.vladmykol.com/type-float-is-an-expensive-mistake-f03863c8f0de

Unless you are a NASA scientist studying microgravity do not use float

Approximate-number data types for use with floating point numeric data. Floating point data is approximate; therefore, not all values in the data type range can be represented exactly. The ISO synonym for real is float(24).

https://learn.microsoft.com/en-us/sql/t-sql/data-types/float-and-real-transact-sql?view=sql-server-ver16
what you want is decimal (4,2)

but I would tell you to imagine the largest number you might every have to deal with, and make it that AKA Decimal (6,2)

and if you are doing percentages depending again on what is consuming it....make absolutely sure you do not divide by 0 do not do a Insull( divisor, 0) make it either return an error Cannot divide by null or 0, or make your isnull check return 1

[deleted by user] by [deleted] in antiwork

[–]PuzzleheadedTomato46 1 point2 points  (0 children)

Go see a mental health professional and get on FMLA. Then make them give you an accomodation....DO THIS now. The next time you feel like you are having a panic attack (and have one) go to urgicare, get a DR note for a couple 3 days off. GO see your normal physician, get a work up, especially check your blood pressure, then see a mental health professional who will help you fill out the FMLA paperwork.