AIで学ぶ中級SQLクエリ
Jasmin Ludolf
Senior Data Science Content Developer
$$
💻 SQL と AI スキルを活用:
並べ替え グループ化 フィルター 要約
カスタム分類
$$
すべてプロンプトで!


⚠️ AI に文脈を共有する前に、必ず許可を得る

プロンプト: すべての映画タイトルをアルファベット順で表示
SELECT title
FROM films
ORDER BY title ASC;
|title |
|--------------------------|
|#Horror |
|10 Cloverfield Lane |
|10 Days in a Madhouse |
|10 Things I Hate About You|
|10,000 B.C. |
|102 Dalmatians |
...
$$
$$
ASC 昇順:プロンプト: 映画タイトルを降順で表示
SELECT title
FROM films
ORDER BY title DESC;
|title |
|--------------------------|
|Æon Flux |
|xXx: State of the Union |
|xXx (Triple X) |
|eXistenZ|
...
$$
$$
DESC$$
⬆ 昇順
$$
⬇ ️ 降順
SELECT title
FROM films
ORDER BY release_year;
|title |
|------------------------------|
|Intolerance: Love's Struggl...|
|Over the Hill to the Poorhouse|
|The Big Parade |
|Metropolis |
...
プロンプト: タイトルと公開年を、公開年で並べ替えて表示
SELECT title, release_year
FROM films
ORDER BY release_year;
|title |release_year|
|------------------------------|------------|
|Intolerance: Love's Struggle |1916 |
|Over the Hill to the Poorhouse|1920 |
|The Big Parade |1925 |
|Metropolis |1927 |
...
SELECT title, oscar
FROM awards
ORDER BY oscar DESC;
|title |oscar|
|-------------------------------|-----|
|Lord of the Rings:Return of ...|11 |
|Titanic |11 |
|Ben-Hur |11 |
SELECT title, oscar, bafta
FROM awards
ORDER BY oscar DESC, bafta DESC;
|title |oscar|bafta|
|--------------------|-----|-----|
|Lord of the Rings...|11 |2 |
|Ben-Hur |11 |1 |
|Titanic |11 |0 |
プロンプト: 映画タイトルと公開年を、年は降順、タイトルは昇順で並べ替えて表示
SELECT title, release_year
FROM films
ORDER BY release_year DESC, title ASC;
|title |release_year|
|----------------|------------|
|10,000 B.C. | |
|A Touch of Frost| |
|Anger Management| |
|Animal Kingdom | |
...
AIで学ぶ中級SQLクエリ