IMPORTANT NOTICE!!!
For scholars on the e-commerce store designs, please see the link to the task Dufuna-CodeCamp/Dufuna-CodeCamp20#656 (comment)
Please use the PR title seen on the app and not GitHub
Scholars working on the FOODBAG eCommerce mockups can proceed with the Database task below.
Design a relational database for the food bag that satisfies the listed needs/criteria.
Success Criteria
- First the food table should contain its id and type. There are four different food categories on the homepage that would be added to this table. All these columns are required.
- The food bag has different vendors selling different kinds of food on the platform. The vendor_food table is the relationship between the vendor itself and the food they sell. This table will contain all they need to know about the food they sell. There will be a relationship between the food table and this table so as to know the type/category the food falls on. The table should contain the following:
- id
- admin_id
- food_id
- name
- amount
Note: All these columns are required.
- The admins table will contain both the system admins of the food bag platform and the vendors. They both will be differentiated by type. The admin table should contain the following:
- id
- name
- type
- email_address
- phone_number
- password.
The system admins can have a type of 0 and vendors a type of 1 when they are saved for differentiation.
Note: All these columns are required.
- Needless to say that the customer does not need to have an account on the platform to make an order. But in the case that they register, these would be on the table:
- id
- name
- phone_number
- address
- payment_method, etc as seen on the payment verification page.
The first four columns mentioned are required and the other columns regarding payment are optional. We’d only want to save the payment details of a registered customer so that whenever they want to make a payment again, we can just fetch out their data.
- The orders table will contain the details regarding the orders of the customer. The table needs id, vendor_id, customer_id. The vendor_id is to know which type of food the customer ordered, it is easy to know the amount of the food and which vendor they made their order from based on the relationship between the admin table and the vendor_food table.
- The customer_id is optional because a guest user of the platform would not have an id, not until they pass through the payment verification page.
- Ensure your PR is created with the task title as seen on the mobile App
NOTE
_1. Your id should be an auto-increment integer
2. Ensure your description is a string with 250 character max value and not null-able.
3. Ensure your table names are all in lower cases.
Submission
To submit,
create a database folder.
in the folder, create an sql file called init.sql.
In the init.sql. file, add all your SQL queries.
Using comments, specify each section of your query.
IMPORTANT NOTICE!!!
For scholars on the e-commerce store designs, please see the link to the task Dufuna-CodeCamp/Dufuna-CodeCamp20#656 (comment)
Please use the PR title seen on the app and not GitHub
Scholars working on the FOODBAG eCommerce mockups can proceed with the Database task below.
Design a relational database for the food bag that satisfies the listed needs/criteria.
Success Criteria
Note: All these columns are required.
The system admins can have a type of 0 and vendors a type of 1 when they are saved for differentiation.
Note: All these columns are required.
The first four columns mentioned are required and the other columns regarding payment are optional. We’d only want to save the payment details of a registered customer so that whenever they want to make a payment again, we can just fetch out their data.
NOTE
_1. Your id should be an auto-increment integer
2. Ensure your description is a string with 250 character max value and not null-able.
3. Ensure your table names are all in lower cases.
Submission
To submit,
create a database folder.
in the folder, create an sql file called init.sql.
In the init.sql. file, add all your SQL queries.
Using comments, specify each section of your query.