(1)社員表:employee で、salary 列が「未定」(NULL)、または、salary 列が「300000」未満の name 列、salary 列のデ ータを表示する。この問題には、必ず論理演算子で複数条件を指定すること。 mysql> select name,salary from employee -> where salary is NULL or salary<300000; +----------+--------+ | name | salary | +----------+--------+ | 山田太郎 | NULL | | 佐藤次郎 | 250000 | | 鈴木花子 | 250000 | +----------+--------+ 3 rows in set (0.00 sec) (2)社員表:employee で、birthday 列が 1990 年以降でない、name 列、birthday 列のデータを表示する。この問題 の条件指定には、必ず論理演算子の否定を使用すること。 mysql> select name,birthday from employee -> where birthday<='1990-01-01'; +----------+------------+ | name | birthday | +----------+------------+ | 田中三郎 | 1975-11-03 | | 高橋良子 | 1985-11-23 | | 鈴木良枝 | 1970-05-03 | | 佐藤健次 | 1980-05-05 | +----------+------------+ 4 rows in set (0.00 sec) (3)社員表:employee で、salary列が\300,000 以上、かつ、\400,000 未満の name 列、salary 列のデータを表示す る。 mysql> select name,salary from employee -> where salary>=300000 and salary<400000; +----------+--------+ | name | salary | +----------+--------+ | 高橋良子 | 300000 | | 佐藤健次 | 350000 | +----------+--------+ 2 rows in set (0.00 sec) (4)社員表:employee で、salary 列が\300,000 と\399,999 の範囲の name 列、salary 列のデータを表示する。この 問題の範囲指定には、必ず between を使用すること mysql> select name,salary from employee -> where salary between 300000 and 399999; +----------+--------+ | name | salary | +----------+--------+ | 高橋良子 | 300000 | | 佐藤健次 | 350000 | +----------+--------+ 2 rows in set (0.00 sec) (5)社員表:employee で、gender 列が「男」、または、salary 列が\400,000 以上、または、dep_id 列が「D001」の name 列、gender 列、salary 列、dep_id 列のデータを表示する。この問題の条件指定には、必ず複数の論理演 算子を使用すること mysql> select name,gender,salary,dep_id from employee -> where gender='男' or salary>=400000 or dep_id='D001'; +----------+--------+--------+--------+ | name | gender | salary | dep_id | +----------+--------+--------+--------+ | 山田太郎 | 男 | NULL | NULL | | 佐藤次郎 | 男 | 250000 | D001 | | 田中三郎 | 男 | 400000 | D003 | | 鈴木良枝 | 女 | 450000 | D003 | | 佐藤健次 | 男 | 350000 | D001 | +----------+--------+--------+--------+ 5 rows in set (0.00 sec)