insert 5 records into your Courses_xxxx table The fid, rid, aid should not be all the same among the 5 records. The enrollment number should be less than the room size. mysql> select * from Hotel; +---------+---------------+--------+ | hotelno | hotelname | city | +---------+---------------+--------+ | ch01 | Omni Shoreham | London | | ch02 | Phoenix Park | London | | dc01 | Latham | Berlin | | fb01 | Grosvenor | London | | fb02 | Watergate | Paris | +---------+---------------+--------+ mysql> select * from Room; +--------+---------+--------+-------+ | roomno | hotelno | type | price | +--------+---------+--------+-------+ | 501 | fb01 | single | 19.00 | | 601 | fb01 | double | 29.00 | | 701 | ch02 | single | 10.00 | | 701 | fb01 | family | 39.00 | | 801 | ch02 | double | 15.00 | | 901 | dc01 | single | 18.00 | | 1001 | ch01 | single | 29.99 | | 1001 | dc01 | double | 30.00 | | 1001 | fb02 | single | 58.00 | | 1101 | ch01 | family | 59.99 | | 1101 | dc01 | family | 35.00 | | 1101 | fb02 | double | 86.00 | +--------+---------+--------+-------+ 12 rows in set (0.00 sec)
insert 5 records into your Courses_xxxx table The fid, rid, aid should not be all the same among the 5 records. The enrollment number should be less than the room size.
mysql> select * from Hotel;
+---------+---------------+--------+
| hotelno | hotelname | city |
+---------+---------------+--------+
| ch01 | Omni Shoreham | London |
| ch02 | Phoenix Park | London |
| dc01 | Latham | Berlin |
| fb01 | Grosvenor | London |
| fb02 | Watergate | Paris |
+---------+---------------+--------+
mysql> select * from Room;
+--------+---------+--------+-------+
| roomno | hotelno | type | price |
+--------+---------+--------+-------+
| 501 | fb01 | single | 19.00 |
| 601 | fb01 | double | 29.00 |
| 701 | ch02 | single | 10.00 |
| 701 | fb01 | family | 39.00 |
| 801 | ch02 | double | 15.00 |
| 901 | dc01 | single | 18.00 |
| 1001 | ch01 | single | 29.99 |
| 1001 | dc01 | double | 30.00 |
| 1001 | fb02 | single | 58.00 |
| 1101 | ch01 | family | 59.99 |
| 1101 | dc01 | family | 35.00 |
| 1101 | fb02 | double | 86.00 |
+--------+---------+--------+-------+
12 rows in set (0.00 sec)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images