Hello, I'm doing a sql database as a school project, the database will be a book catalogue of sorts. What I would like to do is store a biography for the authors and a summary for each book only I'm not sure what the best way to go about storing these in my database are. The databases in school we've done have been limited to 'varchar' and 'int' fields for the most part which I believe will be insufficient to store a block of text.

Thanks.

Recommended Answers

All 3 Replies

If you want to store long text need to expand your limitations.

Use the "text" data type to store long texts.
If you are stuck with the varchar type you can either store longer texts in external files and store the file names in the database, or you can set up a system of linked varchar entries which you concatenate to get a whole text entry. But both solutions are, from a database point of view, unnecessary and inefficient.

No, I'm not stuck using varchar, I just wasn't sure what I should use instead having never needed to store more than a variable name and value. So by using the text data type I should be able to store a blurb about the book, etc. Excellent. Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.