diff --git a/examples/sql/books/bookwindow.cpp b/examples/sql/books/bookwindow.cpp
index d85b438956..3aac5b55b7 100644
--- a/examples/sql/books/bookwindow.cpp
+++ b/examples/sql/books/bookwindow.cpp
@@ -115,6 +115,11 @@ BookWindow::BookWindow()
     ui.genreEdit->setModelColumn(
                 model->relationModel(genreIdx)->fieldIndex("name"));
 
+    // Lock and prohibit resizing of the width of the rating column:
+    ui.bookTable->horizontalHeader()->setSectionResizeMode(
+                model->fieldIndex("rating"),
+                QHeaderView::ResizeToContents);
+
     QDataWidgetMapper *mapper = new QDataWidgetMapper(this);
     mapper->setModel(model);
     mapper->setItemDelegate(new BookDelegate(this));