Skip to content

Instantly share code, notes, and snippets.

@uhpd
uhpd / quanli_thuvien.sql
Last active August 29, 2015 14:16
Câu 4.1 --câu4.5
--4.1 sp_ThongtinDocGia
create proc sp_ThongtinDocGia
(@ma_docgia smallint)
as
begin
if(exists(select * from NguoiLon where ma_docgia=@ma_docgia))
select * from DocGia d join NguoiLon n on d.ma_docgia=n.ma_docgia where n.ma_docgia=@ma_docgia
else
select * from DocGia d join TreEm k on d.ma_docgia=k.ma_docgia where k.ma_docgia=@ma_docgia
end
@uhpd
uhpd / de-6.sql
Created December 24, 2014 16:28
de-6
create database de6
use de6
alter table mon add
constraint cheack_e cheack (sotinchi between 1 and 4)
create trigger temp
on sinhvien
for insert,update
as
begin
@uhpd
uhpd / DE-3.sql
Last active August 29, 2015 14:11
De_3
CREATE DATABASE DE_3
USE DE_3
--Tao cac bang
--NHAN_VIEN
CREATE TABLE NHANVIEN(
MaNV INT,
TenVN VARCHAR(30),
MaVT INT,
MaPB INT,
@uhpd
uhpd / Quan_Ly_Ban_Hang.sql
Last active November 5, 2024 06:20
Quản Lý Bán Hàng _coppy share
CREATE DATABASE QLBH
-----------------------------------------------------
-----------------------------------------------------
---------------------------------------------USE QLBH
-- KHACHANG
CREATE TABLE KHACHHANG(
MAKH char(4) not null,
HOTEN varchar(40),
DCHI varchar(50),
SODT varchar(20),