Before coming up the Spring Festival of China on 2020 I finally finish building a simple SQL Demo as my Annual Report 2019. Here I use two tables (one is parent table “work_category”, another is child table “daily_work”) to build my funny demo, their ERD (Entity Relationship Diagram) is as follows.
At the same time I use another two SEQUENCES to build AutoNumber where there has a separate ID column (“WC_ID” and “DW_ID”) on respective those two tables.
Next I will use several SQL statements to create those two tables mentioned previously. In other words it briefly contains the following 4 portions.
- dropping table (“work_category”, “daily_work”) if they exist
- dropping sequence (“work_cgy_seq”, “daily_work_seq”) if they exist
- creating sequence (“work_cgy_seq”, “daily_work_seq”)
- creating table (“work_category”, “daily_work”) and inserting real data