Skip to content

Instantly share code, notes, and snippets.

View hironomiu's full-sized avatar
🍕
🍔 🍔 🍔 🍔

hironomiu hironomiu

🍕
🍔 🍔 🍔 🍔
View GitHub Profile
@hironomiu
hironomiu / 1.md
Created August 21, 2016 08:41
Treasure2016:DB Part4 解答

Part4 解答 SQL Exercise

回答は全てSQL文と実行結果を日報に添付しQ毎にPUSHしましょう

解答は事前課題4のデータがinsertされた状態で結果を取得しています

Q1(5分)

商品シャツの売り上げ合計金額を算出しましょう

解答

# twitter
https://twitter.com/tech_voyage
# blog
http://techlog.voyagegroup.com/entry/2015/11/26/094922
# techtrain
https://tech-train.dojo-voyage.net/
techtrain
@hironomiu
hironomiu / gist:189c5304e34b5893ad31
Last active November 28, 2017 07:48
Treasure2016:DB トランザクション&ロック初級(公開版)

トランザクション&ロック初級

本演習はDatabase:testを用いて行うこと。演習では2つのターミナルで各々mysql clientでDatabase:testに接続すること。

タイムスケジュール目安(122分)

演習:自動コミット(演習分)(解説2分)
演習:手動コミット(commit編)(演習5分)(解説2分)
演習:手動コミット(rollback編)(演習5分)(解説2分)
演習:悲観ロック(SELECT FOR UPDATE)(演習5分)(解説2分)
演習:ロック(一般的なINSERT、UPDATE)(演習5分)(解説2分)
Question ロストアップデート対策(回答15分)(解説5分)

@hironomiu
hironomiu / gist:fa80b622538412580ee4
Last active August 29, 2015 14:27
Treasure2015:日報

日報

Treasure期間中、みなさんは毎日、日報を書きます。後半戦ではチーム開発する際に日報で行っている 「issue -> branch -> 開発 -> push -> pull request」 の開発サイクルで全員開発するので日報で、このサイクルに慣れましょう!

Step0 準備

$ cd ~/Treasure2015/daily_report
$ git checkout master
@hironomiu
hironomiu / gist:f4643e5d679cea1f4f72
Created March 5, 2015 01:53
SQLアンチパターン:14章アンビギュアスグループ(曖昧なグループ)

14章 アンビギュアスグループ(曖昧なグループ)

準備

drop table Bugs;

CREATE TABLE `Bugs` (
      `bug_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
      `reported_by` int,
      `date_reported` date,
@hironomiu
hironomiu / gist:18ed8a3205110fe52852
Created February 12, 2015 00:32
SQLアンチパターン:6章ポリモーフィック関連

6章 ポリモーフィック関連

準備

create database chapter6;
user chapter6;

6.2.2 ポリモーフィック関連へのクエリ実行

準備

@hironomiu
hironomiu / gist:6e8cf7af96ba9776e136
Created February 5, 2015 01:33
SQLアンチパターン:5章EAV(エンティティ・アトリビュート・バリュー)
# 5章 EAV(エンティティ・アトリビュート・バリュー)
## intro
```
SELECT date_reported, COUNT(*)
FROM Bugs
GROUP BY date_reported;
```
## 5.2 アンチパターン:汎用的な属性テーブルを使用する
@hironomiu
hironomiu / gist:18e67de38341a16e7f08
Created January 22, 2015 01:33
SQLアンチパターン:1章ジェイウォーク

1章 ジェイウォーク

準備

create database chapter1;
use chapter1;

1.1 目的:複数の値を持つ属性を格納する

テーブルの作成、サンプルデータの挿入

@hironomiu
hironomiu / gist:efe2b42fdc284d663239
Last active August 29, 2015 14:13
JSじゃんけん 事前準備

JSじゃんけん 事前準備

必須とついているものは必ず準備しましょう

テキストエディタ(必須)

GitHubアカウント(必須)

  • アカウントの無い人はGitHub公式にてアカウントを取得しましょう
@hironomiu
hironomiu / gist:4f23da6be771be5b5afa
Last active August 29, 2015 14:02
ネクストキーロックの検証

ネクストキーロックの検証

準備

テーブルの作成

create table test_next_key_lock (
id int(8) not null AUTO_INCREMENT,
col1 char(1) not null,
col2 int(8),
rec_date datetime,
PRIMARY KEY (id),