<jupyter_start><jupyter_text>Which users switch level?<jupyter_code>%sql SELECT user_id, COUNT(DISTINCT level) AS level_count FROM songplays GROUP BY user_id HAVING COUNT(DISTINCT level) > 1
%sql SELECT start_time, level FROM songplays WHERE user_id = 85 ORDER BY start_time LIMIT 2;
%sql SELECT * FROM users WHERE user_id = 85;
%sql SELECT * FROM songs LIMIT 5;
#%sql SELECT COUNT(*) FROM songs;
%sql SELECT * FROM artists WHERE latitude is NULL LIMIT 5;
%sql INSERT INTO artists (artist_id, latitude, longitude) \
VALUES ('ARNTLGG11E2835DDB9', NULL, '35.14968') \
ON CONFLICT (artist_id) DO UPDATE SET \
latitude = COALESCE (artists.latitude, EXCLUDED.latitude), \
longitude = COALESCE (artists.longitude, EXCLUDED.longitude);
%sql SELECT * FROM artists WHERE artist_id = 'ARNTLGG11E2835DDB9';
%sql SELECT * FROM time LIMIT 5;
%sql SELECT s.song_id, s.artist_id \
FROM songs AS s JOIN artists AS a ON s.artist_id = a.artist_id \
WHERE s.title = E'I Didn\'t Mean To' \
AND a.name = 'Casual' \
AND s.duration = '218.93179';<jupyter_output>* postgresql://student:***@127.0.0.1/sparkifydb
(psycopg2.ProgrammingError) column s.duration does not exist
LINE 1: ... = E'I Didn\'t Mean To' AND a.name = 'Casual' AND s.duration...
                                                             ^
 [SQL: "SELECT s.song_id, s.artist_id FROM songs AS s JOIN artists AS a ON s.artist_id = a.artist_id WHERE s.title = E'I Didn\\'t Mean To' AND a.name = 'Casual' AND s.duration = '218.93179';"]
{'fraction_non_alphanumeric': 0.11434370771312584, 'fraction_numerical': 0.036535859269282815, 'mean_word_length': 3.7252396166134187, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '654710', 'license': 'MIT', 'n_tokens_mistral': 579, 'n_tokens_neox': 515, 'n_words': 171, 'path': 'test.ipynb', 'repo_name': 'adzugaiev/Udacity-Data-Engineering-1', 'size': '1478'}