I am developing a library management software in javafx and I am using sqlite as a database for that. I have to store data of almost 50000 books. And all those books would have a barcode. Obviously, the barcode is a going to be an Integer(PS. Correct me if I am wrong) and it would contain many digits. So I am not understanding whether I should go with sqlite integer datatype or use string datatype for my primary key?
You should look into what kind of barcode the books are using you are going to store. Take a look here for more information about bar codes https://barcode.tec-it.com/en/EAN13?data=978020137962
You should also look into if you need to store leading zeros.
And your primary key does not have to be the value from the bar code.