LoslegenKostenlos starten

Applying SQL to a local CSV file

Sometimes the data manipulation we want to do is just easier to do with SQL. In this situation, we want to find the shortest duration song in Spotify_MusicAttributes.csv by applying the SQL below directly to the data file.

SELECT * FROM Spotify_MusicAttributes ORDER BY duration_ms LIMIT 1

Let's go through this step by step.

Diese Übung ist Teil des Kurses

<Kurs>Data Processing in Shell</Kurs>
Kurs ansehen

Interaktive praktische Übung

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

# Preview CSV file
ls

# Apply SQL query to Spotify_MusicAttributes.csv
___ --___ "SELECT * FROM Spotify_MusicAttributes ORDER BY duration_ms LIMIT 1" ___.csv
Code bearbeiten und ausführen