Skip to Content
SQLポケットガイド 第4版
book

SQLポケットガイド 第4版

by Alice Zhao, 原 隆文
July 2024
Intermediate to advanced
328 pages
3h 24m
Japanese
O'Reilly Japan, Inc.
Content preview from SQLポケットガイド 第4版

3章SQL言語

この章では、SQLの標準規格、主要な用語サブ言語など、SQLの基礎について解説し、次のような疑問に答えます。

3.1 他の言語との比較

テクノロジーの世界にいる人の中には、SQLを真のプログラミング言語とは見なさない人もいます。

SQLは「Structured Query Language」(構造化照会言語)の略ですが、Python、Java、C++などの他の一般的なプログラミング言語と同じように使うことはできません。それらの言語では、コードを記述することで、タスクを完了するためにコンピューターが取るべきステップを正確に指定することができます。これは命令型プログラミング(imperative programming)と呼ばれます。

たとえばPythonでは、値のリストの合計を求めたければ、それを「どのように」行いたいかをコンピューターに正確に伝えることができます。次のサンプルコードは、リストの中を項目ごとに巡回し、それぞれの値をその時点までの合計に加え、最後に合計を出力します。

calories = [90, 240, 165]
total = 0
for c in calories:
    total += c
print(total)

このように、何かを「どのように」行いたいかをコンピューターに正確に伝える代わりに、SQLでは「何を」行いたいか——この例では合計を計算する——を単に記述します。SQLは舞台裏で、そのコードを最適に実行する方法を考え出します。これは宣言型プログラミング(declarative ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Pythonクイックリファレンス 第4版

Pythonクイックリファレンス 第4版

Alex Martelli, Anna Martelli Ravenscroft, Steve Holden, Paul McGuire, 鈴木 駿, 株式会社クイープ
推薦システム実践入門 ―仕事で使える導入ガイド

推薦システム実践入門 ―仕事で使える導入ガイド

風間 正弘, 飯塚 洸二郎, 松村 優也

Publisher Resources

ISBN: 9784814400805Publisher Website