564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
This will generate the database that you'll need to use in order to do this exercise (remember to refresh your list of databases to see it!). Note that any files provided are only to be used for exercises published on this website, and may not be reused or distributed in any form without the prior written permission of Wise Owl.
Create a Python program called Listing films.py. Type in a variation of the following code to link to the SQL Server Movies database in the above folder:
# the main Python module to link to SQL Server
# connect to the movies database (this uses Windows
# authentication and assumes your SQL Server instance
# is called sql2019 on your currnet computer)
movies_database_connnection = pyodbc.connect(
# create an SQL command to show 100 longest films
sql_query = "SELECT Title, RunTimeMinutes, OscarWins FROM Film ORDER BY RunTimeMinutes DESC"
# create a cursor to get this data
movies_cursor = movies_database_connnection.cursor()
# for each of these 100 longest films, show ones winning more than 7 Oscars
films = movies_cursor.fetchmany(100)
You can copy and paste this code into any Python program which you write whenever you want to link to a SQL Server database.
Now extend the program so that - out of the 100 longest films - it lists out those which won more than 7 Oscars:
Correlation in this case IS causation: long films really do win more Oscars!
Remember that no Intellisense will help you to complete your commands when referencing fields from an ODBC connection - it's up to you to remember what the columns are called, and type in their names correctly.
Save your program and close it down.
25 Aytoun Street