計算機科学のブログ

ほしい物リスト

SQL - SQLite - 複数テーブルのデータベース設計 - 現行テーブルからの脱却 - likeキーワード

Head First SQL ―頭とからだで覚えるSQLの基本Lynn Beighley(著)、 佐藤 直生(監訳)、 松永 多苗子(翻訳)、 オライリージャパンの 7章(複数テーブルのデータベース設計 - 現行テーブルからの脱却)、p.283(自分で考えてみよう)の解答を求めてみる。

sample1.sql

select * from my_contacts
where gender = '女性'
and status = '独身'
and state = 'テキサス州'
and seeking laike '%独身男性'
and birthday > '1970-08-28'
and birthday < '1980-08-28'
and interests like '%動物%'
and interests like '%乗馬%'
and interests like '%映画%';