Unique Order Number
Learn to avoid the redundancy of rows.
We'll cover the following...
Delete the wrong order
Let’s first delete the wrong order:
1 mysql> delete from orders where id = 2;
2 Query OK, 1 row affected (0.01 sec)
3
4 mysql> select * from orders;
5 +----+--------------+---------------------+-------------+
6 | id | order_number | ordered_at | customer_id |
7 +----+--------------+---------------------+-------------+
8 | 1 | ABC001 |
...Access this course and 1400+ top-rated courses and projects.