本文主要向大家介绍了MySQL数据库之MySQL 查找价格最高的图书经销商的几种SQL语句 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。
mysql> use test;
Database changed
mysql> CREATE TABLE shop (
-> article INT(4) UNSIGNED ZEROFILL DEFAULT ‘0000’ NOT NULL,
-> dealer CHAR(20) DEFAULT ” NOT NULL,
-> price DOUBLE(16,2) DEFAULT ‘0.00’ NOT NULL,
-> PRIMARY KEY(article, dealer));
Query OK, 0 rows affected (0.13 sec)
mysql> INSERT INTO shop VALUES
-> (1,’A’,3.45),(1,’B’,3.99),(2,’A’,10.99),(3,’B’,1.45),
-> (3,’C’,1.69),(3,’D’,1.25),(4,’D’,19.95);
Query OK, 7 rows affected (0.03 sec)
Records: 7 Duplicates: 0 Warnings: 0
mysql> select * from shop;
+———+——–+——-+
| article | dealer | price |
+———+-