#URI | #LubySoftware | #MRV |
---|
SP_COLUMNS
GO
SP_HELP
GO
CREATE DATABASE NAME_DB
USE NAME_DB
GO
CREATE TABLE NAME_TABLE_DB(
/*Atributos*/
)
GO
ALTER TABLE NAME_TABLE_DB
ADD CONSTRAINT CK_SEXO CHECK (
SEXO IN('M','F')
)
GO
ALTER TABLE NAME_TABLE_DB
ADD CONSTRAINT
FK_ENDERECO
FOREIGN KEY(ID_ALUNO)
REFERENCES ALUNO(IDALUNO)
GO
SP_COLUMNS NAME_TABLE_DB
GO
SP_HELP NAME_TABLE_DB
GO
CREATE TRIGGER TRG_ATUALIZA_PRECO
ON DBO.NAME_DB
FOR UPDATE
AS
DECLARE @IDPRODUTO INT
GO
CREATE PROC CONTA @NUM1 INT, @NUM2 INT
AS
SELECT @NUM1 + @NUM2 AS RESULTADO
GO
EXEC CONTA 90, 78
GO
INSERT INTO NAME_TABLE_DB VALUES()
GO