Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Database: Microsoft SQL Server 2017
- -- color f0
- -- chcp 65001
- -- chcp 950
- -- sqlcmd -E -i "KuoHsiangYu_three_table_with_recipe.sql"
- CREATE DATABASE icook
- GO
- USE icook
- GO
- CREATE TABLE recipe
- (
- pk_recipe_id INT IDENTITY(1, 1) NOT NULL,
- file_name VARCHAR(255) NULL,
- recipe_click_rate INT NULL,
- recipe_date DATE NULL,
- recipe_display INT NULL,
- recipe_image VARBINARY(MAX) NULL,
- recipe_name VARCHAR(255) NULL,
- recipe_note VARCHAR(255) NULL,
- recipe_quantity VARCHAR(255) NULL,
- recipe_summary VARCHAR(255) NULL,
- recipe_time VARCHAR(255) NULL,
- PRIMARY KEY(pk_recipe_id)
- )
- GO
- CREATE TABLE recipe_ingredients
- (
- pk_recipe_ingredients_id INT IDENTITY(1, 1) NOT NULL,
- ingredients VARCHAR(255) NULL,
- quantity VARCHAR(255) NULL,
- fk_recipe_id INT NULL,
- PRIMARY KEY(pk_recipe_ingredients_id),
- FOREIGN KEY(fk_recipe_id) REFERENCES recipe(pk_recipe_id)
- )
- GO
- CREATE TABLE recipe_unit
- (
- pk_recipe_unit_id INT IDENTITY(1, 1) NOT NULL,
- EXPLAIN VARCHAR(255) NULL,
- stepNo INT NULL,
- unit_image VARBINARY(MAX) NULL,
- fk_recipe_id INT NULL,
- PRIMARY KEY(pk_recipe_unit_id),
- FOREIGN KEY(fk_recipe_id) REFERENCES recipe(pk_recipe_id)
- )
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement