madochan

Untitled

Nov 11th, 2025
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 1.06 KB | Software | 0 0
  1.  
  2.         create table produto (
  3.         id_produto tinyint primary key identity,
  4.         nome_produto nvarchar(255) not null,
  5.         valor_unidade decimal(6,2) not null,
  6.         descricao nvarchar(255) null
  7.         )
  8.  
  9.         create table cliente (
  10.         id_cliente smallint primary key identity,
  11.         nome nvarchar(255) not null,
  12.         email nvarchar(255) not null unique,
  13.         cpf_cnpj varchar(18) not null unique,
  14.         cep varchar(9) not null,
  15.         num_residencia nvarchar(20) not null,
  16.         id_cliente_asaas nvarchar(255) null
  17.         )
  18.  
  19.         create table pedido (
  20.         id_pedido smallint primary key identity,
  21.         quantidade tinyint not null default 1,
  22.         valor_total decimal(7,2) not null,
  23.         status_pagamento nvarchar(50) not null default "pendente",
  24.         data_compra date not null default current_date(),
  25.         id_pagamento_asaas varchar(255) null unique,
  26.         id_cliente smallint not null references cliente(id_cliente),
  27.         id_produto tinyint not null references produto(id_produto)
  28.         )
  29.  
Advertisement
Add Comment
Please, Sign In to add comment