0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【SQL】第3回勉強日記 問題解答 難易度★★☆☆☆ 内容:サブクエリ

Posted at

こんにちは!

はい、今日も早速やっていきます!

SQL練習問題-問3

image.png
サブクエリの問題ですね~
FROM句はplayersテーブルと指定がありますので
そこには注意ですね

【私の解答】
image.png
SELECT句にサブクエリを使用して国名を引っ張ってきてます
サブクエリ内で国名を呼びだして
FROM句にはもちろんcountriesを置きます
何回もcountriesと打つのが面倒なのでcと名付けておきます
WHERE句には条件を入れます
SELECT句の中で使用するときは
大抵WHEREにJOINの時の条件を書きます
そしてこれには「国名」と名付けておきます

忘れてはいけないのが平均身長ですね
サブクエリを書き終えて安心して
こういうのが結構抜けがちです
その後はほとんど難しいところはないですね

【解答】
image.png

よっしゃーいけました!
今日は腹痛いのでこのあたりで...
また明日の朝にSQLやります!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?