LoslegenKostenlos loslegen

STATISTICS TIME in queries

A friend is writing a training course on how the command STATISTICS TIME can be used to tune query performance and asks for your help to complete a presentation. He requires two queries that return NBA team details where the host city had a 2017 population of more than two million.

NBA team details can be queried from the NBA Season 2017-2018 database and city populations can be queried by adding in tables from the Earthquakes database.

Each query uses a different filter on the Teams table.

Query 1

  • Filters the Teams table using IN and three sub-queries

Query 2

  • Filters the Teams table using EXISTS

Diese Übung ist Teil des Kurses

Improving Query Performance in SQL Server

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

___ ___ ___ ___ -- Turn the time command on
Code bearbeiten und ausführen