mysql> SELECT book_name author_name FROM book_table;
+----------------+
| author_name |
+----------------+
| TwoPeace |
| 名探偵金田二 |
| 坊ちゃま |
| 西方見聞録 |
| 吾輩は犬である |
+----------------+
5 rows in set (0.00 sec)
mysql> SELECT book_name, author_name FROM book_table;
+----------------+-------------+
| book_name | author_name |
+----------------+-------------+
| TwoPeace | 三田英一郎 |
| 名探偵金田二 | 青山ふみや |
| 坊ちゃま | 冬目漱石 |
| 西方見聞録 | 不明 |
| 吾輩は犬である | 冬目漱石 |
+----------------+-------------+
5 rows in set (0.00 sec)
mysql> UPDATE book_table SET author_name = 'マール=コー=ポロ'SET sales_flag = 0 where book_id = 10004;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET sales_flag = 0 where book_id = 10004' at line 1
mysql> UPDATE book_table SET author_name = 'マール=コー=ポロ' where book_id = 10004;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ']SET sales_flag = 0 where book_id = 10004' at line 1
mysql> UPDATE book_table SET sales_flag = 0 where book_id = 10004;
mysql> SELECT * FROM book_table where author_name = '冬目漱石'AND price = 420;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND price = 420' at line 1
mysql> SELECT * FROM book_table where author_name = '冬目漱石' AND price = 420;
CREATE TABLE item_category(category_id INT PRIMARY KEY AUTO_INCREMENT, category_name VARCHAR(256) NOT NULL);
INSERT INTO item_category (category_name) VALUES(1,'家具');
INSERT INTO item_category (category_name) VALUES('飲料');
INSERT INTO item_category (category_name) VALUES('食品');
問2
CREATE TABLE item(item_id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(256) NOT NULL, price INT NOT NULL,category_id INT, FOREIGN KEY(category_id) REFERENCES item_category(category_id));
問3
SELECT item.category_id, item.item_id, item.name, item.price,item_category.category_name FROM item INNER JOIN item_category ON item.category_id = item_category.category_id;
問4
SELECT item.category_id, item.item_id, item.name, item.price,item_category.category_name FROM item INNER JOIN item_category ON item.category_id = item_category.category_id ORDER BY price ASC;
問5
SELECT item.category_id, item.item_id, item.name, item.price,item_category.category_name FROM item INNER JOIN item_category ON item.category_id = item_category.category_id WHERE category_name ='家具';
問6
SELECT item.category_id, item.item_id, item.name, item.price,item_category.category_name FROM item INNER JOIN item_category ON item.category_id = item_category.category_id WHERE item.price >= 1000 AND item.price <= 50000;
問7
SELECT COUNT(*) AS data_count FROM item;
問8
SELECT item.category_id, item.item_id, item.name, item.price,item_category.category_name FROM item INNER JOIN item_category ON item.category_id = item_category.category_id WHERE item.price = 150000;
問9
SELECT item.category_id, item.item_id, item.name, item.price,item_category.category_name FROM item INNER JOIN item_category ON item.category_id = item_category.category_id WHERE item.name LIKE '%の%'
mysql> SELECT book_name author_name FROM book_table;
+----------------+
| author_name |
+----------------+
| TwoPeace |
| 名探偵金田二 |
| 坊ちゃま |
| 西方見聞録 |
| 吾輩は犬である |
+----------------+
5 rows in set (0.00 sec)
mysql> SELECT book_name, author_name FROM book_table;
+----------------+-------------+
| book_name | author_name |
+----------------+-------------+
| TwoPeace | 三田英一郎 |
| 名探偵金田二 | 青山ふみや |
| 坊ちゃま | 冬目漱石 |
| 西方見聞録 | 不明 |
| 吾輩は犬である | 冬目漱石 |
+----------------+-------------+
5 rows in set (0.00 sec)
mysql> UPDATE book_table SET author_name = 'マール=コー=ポロ'SET sales_flag = 0 where book_id = 10004;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET sales_flag = 0 where book_id = 10004' at line 1
mysql> UPDATE book_table SET author_name = 'マール=コー=ポロ' where book_id = 10004;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ']SET sales_flag = 0 where book_id = 10004' at line 1
mysql> UPDATE book_table SET sales_flag = 0 where book_id = 10004;
mysql> SELECT * FROM book_table where author_name = '冬目漱石'AND price = 420;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND price = 420' at line 1
mysql> SELECT * FROM book_table where author_name = '冬目漱石' AND price = 420;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, '家具')' at line 1
mysql> INSERT INTO item_category (1, '家具');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, '家具')' at line 1
mysql> INSERT INTO item_category VALUES (1, '家具');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO item_category VALUES (2, '飲料');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO item_category VALUES (3, '食品');
mysql> INSERT INTO items VALUES (1, 'ローマのテーブル'150000, 1);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '150000, 1)' at line 1
mysql> INSERT INTO items VALUES (1, 'ローマのテーブル', 150000, 1);
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO items VALUES (2, 'げーたるーど2000 500ml', 370, 2);
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO items VALUES (3, '原子肉', 2500, 3);
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO items VALUES (4, '魅惑の椅子', 100000, 1);
mysql> SELECT item.category.category_id AS items.category_id FROM item_category INNER JOIN item ON item_category.category_id = items.category_id;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.category_id FROM item_category INNER JOIN item ON item_category.category_id = i' at line 1
mysql> SELECT * FROM item_category INNER JOIN items ON item_category.category_id = items.category_id;
mysql> SELECT * FROM item_category INNER JOIN items ON USING (category_id);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING (category_id)' at line 1
mysql> SELECT * FROM item_category INNER JOIN items ON USING (category_id);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING (category_id)' at line 1
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id);
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) OEDER BY price ASC;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OEDER BY price ASC' at line 1
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) ORDER BY price ASC;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) AS data_count from items' at line 1
mysql> SELECT COUNT () AS data_count from items;
ERROR 1630 (42000): FUNCTION rezodb.COUNT does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
mysql> SELECT COUNT (*) AS data_count from items;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) AS data_count from items' at line 1
mysql> SELECT COUNT (*) AS data_count FROM items;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) AS data_count FROM items' at line 1
mysql> SELECT COUNT (*) FROM items;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) FROM items' at line 1
mysql> SELECT COUNT(*) FROM items;
+----------+
| COUNT(*) |
+----------+
| 4 |
+----------+
1 row in set (0.01 sec)
mysql> SELECT COUNT(*) AS data_count FROM items;
+------------+
| data_count |
+------------+
| 4 |
+------------+
1 row in set (0.00 sec)
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) s
-> ^C
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) WHERE score = MIN (score)
-> ^C
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) WHERE score = MIN (score);
ERROR 1054 (42S22): Unknown column 'score' in 'where clause'
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) WHERE score = (MIN (score) FROM items);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM items)' at line 1
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) WHERE score = (MIN(score) FROM items);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM items)' at line 1
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) WHERE score = (MAX(price) FROM items);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM items)' at line 1
mysql> mysql> SELECT * FROM items WHERE price = (SELECT MAX(price) FROM items);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> SELECT * FROM items WHERE price = (SELECT MAX(price) FROM items)' at line 1
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id);
mysql> SELECT * FROM items INNER JOIN item_category USING (category_id) WHERE price = (MAX(price) FROM items);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM items)' at line 1
mysql> SELECT * FROM items WHERE price = (SELECT MAX(price) FROM items);
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.