SHARE
TWEET

Untitled

a guest Feb 16th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE [dbo].[INGREDIENTE](
  2.     [ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
  3.     [NOME] [varchar](20) NOT NULL,
  4.     [CALORIA] [decimal](18, 2) NOT NULL
  5. )
  6.  
  7. CREATE TABLE [dbo].[RECEITA](
  8.     [ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
  9.     [TITULO] [varchar](20) NOT NULL,
  10.     [DESCRICAO] [varchar](20) NOT NULL,
  11.     [TEMPO] time NOT NULL
  12. )
  13.  
  14. CREATE TABLE [dbo].[INGREDIENTE_RECEITA](
  15.     [ID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
  16.     [ID_INGREDIENTE] [int] NOT NULL FOREIGN KEY REFERENCES INGREDIENTE,
  17.     [ID_RECEITA] [int] NOT NULL FOREIGN KEY REFERENCES RECEITA
  18. )
  19.  
  20. ------------------------------------------------------------------
  21. --Preencher dados
  22.  
  23. INSERT INTO INGREDIENTE VALUES ('A├žucar', 200)
  24. INSERT INTO INGREDIENTE VALUES ('Farinha', 250)
  25. INSERT INTO INGREDIENTE VALUES ('Ovo', 200)
  26. INSERT INTO INGREDIENTE VALUES ('Cenoura', 100)
  27.  
  28. INSERT INTO RECEITA VALUES ('Bolo de Cenoura', 'blablablá', '00:25:00.000')
  29.  
  30. INSERT INTO INGREDIENTE_RECEITA VALUES (1, 1)
  31. INSERT INTO INGREDIENTE_RECEITA VALUES (2, 1)
  32. INSERT INTO INGREDIENTE_RECEITA VALUES (3, 1)
  33. INSERT INTO INGREDIENTE_RECEITA VALUES (4, 1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top