Skip to content

Develop the FoodBag Store Database #118

Description

@Dufuna-Fem

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

  1. 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.
  2. 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.
  1. 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.
  1. 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.
  1. 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.
  2. 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.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions