Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
データベースで沼った話
Search
K1mu21
March 12, 2024
Programming
95
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
データベースで沼った話
めぐろLT#8の資料です
K1mu21
March 12, 2024
More Decks by K1mu21
See All by K1mu21
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
390
dependabotを導入して失敗した話
k1mu21
0
190
Rust勉強会1回目の資料
k1mu21
0
100
ギャレトレ勉強会
k1mu21
0
120
リプレイスでやったこと
k1mu21
1
110
Cloudflareいいぞ
k1mu21
1
180
静的解析ツールを導入した話
k1mu21
1
260
WebGLを触ってみよう
k1mu21
1
71
GoのAirを使ってみた話
k1mu21
0
170
Other Decks in Programming
See All in Programming
気持ちぃ〜角丸 Squircle
ryu1013
0
310
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
580
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
290
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
AWSに止められる覚悟してますか?
morizo_1984
2
530
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
270
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
4
3.4k
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6.3k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
530
Darren the Foodie - Storyboard
khoart
PRO
4
4k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
360
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
How to train your dragon (web standard)
notwaldorf
96
6.9k
Transcript
データベースで 沼った話
自己紹介
• 木村 宗吾(k1mu) • 所属 ◦ 株式会社ラクーンホールディングス技 術戦略部 • 領域
◦ バックエンド(+フロントエンド) • 言語 ◦ 業務 ▪ Java PHP ◦ 業務外 ▪ Go C(++) • X ◦ @detunote
なぜこの話をするのか • テーマが初めてのLTとの事で、せっかくなら1年目として印象に残ったことを話す と面白いのでは • DBを触る方は多いと思うので、知らなかったのであればこれからの知見として ほしい
DBに関して
皆さんDBは何を使った事があります?
今回の説明で使うDB
沼った問題
前提 (テーブル)
前提 (データ)
テーブルをUPDATE UPDATE users SET name = '木村' WHERE id =
3; ID3の名前を木村に変更するUPDATEを実行する
結果 ID3の名前が変わっている MySQL ORACLE
別のSQLエディター 等で確認 Oracleの方ではID3の Nameが変わっていない ORACLE MySQL
内容が反映されていな い...!?
最後にCommitした?
解決方法 UPDATE users SET name = '木村' WHERE id =
3; commit;
結果 別のエディターで見ても データが入っていて UPDATEもされている。
DBに反映された!
原因 • コミットしていなかったため、利用中のトランザクションでしかUPDATEが反映さ れていなかった。 • 正直MySQL = ORACLE のように考えていた。 ◦
MySQLなどにはAuto Commitがあり、標準ではONになっているので最後に自分で Commitを 明示的に宣言する必要がない。 ◦ OracleにもAuto Commitがあるが標準ではOFFになっている。
他にも • バージョンによってOracleにはオートインクリメントがない ◦ シーケンスを利用して連番を生成する必要がある。 • LimitがないのでRowNumを利用して行数を制限 • SELECT句にGROUP BY句にない列を含めることができるが、その列は集約関
数の中で使用される必要がある。 • Oracleでは空文字はNullと同等に扱える
仕様はちゃんと 調べてから使おう
宣伝 弊社のconnpassページ https://raccoon-holdings.connp ass.com