すべての乗用車タイプのタイヤの Store_Name、Part_ID、Model_Name、Manufacturer_Name、および OnHand を一覧表示するクエリを作成します。リストをメーカー名で並べ替えます。
これは私が置いたものです:
SELECT
STORELOCATION.STORE_NAME,
TIRES.PART_ID,
MODEL_NAME,
MANUFACTURERS.MANUFACTURER_NAME,
INVENTORY.ONHAND
FROM
STORELOCATION, TIRES, MANUFACTURERS, INVENTORY
WHERE
TIRE_TYPE = 'Passenger'
ORDER BY MANUFACTURER_NAME;
私は4100のレコードのようなものを手に入れました。重複は必要ありません。私が得た
クレイグを助けてくれる人に感謝します
+---------+--------------------+----------------+------------+-------------+
| PART_ID | MODEL_NAME | MANUFACTURERID | UNIT_PRICE | TIRE_TYPE |
+---------+--------------------+----------------+------------+-------------+
| C424P | Kestral | M3 | 45.99 | Passenger |
| C434P | Peregrine | M3 | 49.99 | Passenger |
| C435T | Eagle | M3 | 56.99 | Truck |
| C475X | Hawk | M3 | 63.99 | Performance |
| G738P | Cross-Country | M1 | 27.99 | Passenger |
| G812T | All-Terrain | M1 | 39.99 | Truck |
| G814T | Expedition | M1 | 47.99 | Truck |
| G868P | Urban | M1 | 34.99 | Passenger |
| G898X | Performance-Radial | M1 | 56.99 | Performance |
| M225P | Symmetry | M2 | 39.99 | Passenger |
| M235P | Harmony | M2 | 49.99 | Passenger |
| M325X | Energy | M2 | 54.99 | Performance |
| M545X | Grand-Prix | M2 | 89.99 | Performance |
| Y320P | Touring | M4 | 19.99 | Passenger |
| Y430P | Assurance | M4 | 29.99 | Passenger |
| Y435P | Freedom | M4 | 24.99 | Passenger |
| Y440T | Cargo | M4 | 29.99 | Truck |
| Y450T | Heavy-Duty | M4 | 24.99 | Truck |
+---------+--------------------+----------------+------------+-------------+
18 rows in set (0.00 sec)
Query OK, 0 rows affected (0.06 sec)
Query OK, 4 rows affected (0.03 sec)
Records: 4 Duplicates: 0 Warnings: 0
+----------------+-------------------+-------------------+------------------+
| MANUFACTURERID | MANUFACTURER_NAME | MANUFACTURER_CITY | MANUFACTURER_REP |
+----------------+-------------------+-------------------+------------------+
| M1 | GoodTread | Akron | Ben |
| M2 | Michelle | Columbus | Sarah |
| M3 | ChickenCoop | Findlay | George |
| M4 | Yomama | Toledo | Steve |
+----------------+-------------------+-------------------+------------------+
4 rows in set (0.00 sec)
Query OK, 0 rows affected (0.07 sec)
Query OK, 3 rows affected (0.02 sec)
Records: 3 Duplicates: 0 Warnings: 0
+----------+-------------+-----------+---------------+
| STORE_ID | STORE_NAME | LOCATION | STORE_MANAGER |
+----------+-------------+-----------+---------------+
| DT | LUCKY ONE | Downtown | Robert |
| ES | LUCKY TWO | Eastside | Megan |
| NS | LUCKY THREE | Northside | Harold |
+----------+-------------+-----------+---------------+
3 rows in set (0.00 sec)
Query OK, 0 rows affected (0.13 sec)
+----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+-------+
| PART_ID | char(5) | NO | PRI | | |
| STORE_ID | char(3) | NO | PRI | | |
| ONHAND | decimal(5,0) | YES | | NULL | |
+----------+--------------+------+-----+---------+-------+