-- CSE 154
-- Setup SQL for Mowgli's Cafe Section Exercises to create a little menu table.

-- Remember to create cafedb in phyMyAdmin!
USE cafedb;

-- This line will delete the menu table whenever we import setup-cafe.sql, which
-- is convenient if we make updates we want to replace the current table with. But
-- use with caution, since we'll lose everything in our menu :(
DROP TABLE IF EXISTS menu;

-- A table for the cafe menu, with menu items for different categories/subcategories.
-- Each menu item has a cost for the cafe to pay, and a price the cafe currently sells
-- for on the menu (for customers to pay).
CREATE TABLE menu(
  id INT AUTO_INCREMENT,
  name VARCHAR(50) NOT NULL, -- remember that 50 denotes the maximum length for the column value
  category VARCHAR(50) NOT NULL,
  subcategory VARCHAR(50),
  price DECIMAL(4, 2),
  cost DECIMAL(4, 2),
  PRIMARY KEY(id)
);
