Conclusion

Our main goal in this book was to introduce you to the SQL language. We covered a bit of database theory such as normalization, and also advanced topics such as indexes and importing/exporting data.

You will need to practice SQL and try out queries on your own. Be sure to refer to this book, and the PostgreSQL manual if you get stuck. Another place you can practice your queries is SQLFiddle.

More query ideas.

We would like to leave you with some query ideas that you can try out on the library database that we have walked through in this book. In many cases, you may need to insert more data into your tables before you can create these queries.

  • Select books that have never been checked out
  • Select user that has the most books checked out
  • Select users that are most active
  • Select users with the most books
  • Select users with the most reviews
  • Select queries with =, vs in, vs Not IN, vs Like
  • SQL queries with wild card search and limit