♫♥♫...:::Nhóm Học Sinh Fpt-Aptech:::...♫♥♫
Đăng Kí Thanh Viên Nào Mọi Người

Join the forum, it's quick and easy

♫♥♫...:::Nhóm Học Sinh Fpt-Aptech:::...♫♥♫
Đăng Kí Thanh Viên Nào Mọi Người
♫♥♫...:::Nhóm Học Sinh Fpt-Aptech:::...♫♥♫
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
Đăng Nhập

Quên mật khẩu

Latest topics
» Tài Liệu java và Dream8
LAB7 hoàn thành I_icon_minitimeMon Dec 02, 2013 6:22 pm by hoangthai0302

» [Tham khảo] Đề thi BDW FPT
LAB7 hoàn thành I_icon_minitimeWed Aug 14, 2013 8:08 pm by yowisu

» Nhận giúp làm đồ án, project cuối kỳ, bài tập lớn cho sinh viên học lập trình dotNet tại Hà Nội
LAB7 hoàn thành I_icon_minitimeMon Jul 08, 2013 11:44 am by aiglevnpro

» Đây là tài liệu học RDBMS mời download
LAB7 hoàn thành I_icon_minitimeFri Nov 09, 2012 9:51 am by laiconghung

» [Tham Khảo] Ass 4 của tui :)
LAB7 hoàn thành I_icon_minitimeFri Oct 26, 2012 10:21 pm by dat21892

» Giới thiệu Đại học FPT-Greenwich
LAB7 hoàn thành I_icon_minitimeThu Oct 11, 2012 2:02 pm by comnhom.it

» De Ly Thuyet 134 cau day. Chuan luon do cua aptech nha
LAB7 hoàn thành I_icon_minitimeTue Jun 26, 2012 10:33 pm by PhucBach

» THÔNG BÁO CƠ HỘI NGHỀ NGHIỆP
LAB7 hoàn thành I_icon_minitimeTue Jun 05, 2012 10:48 am by yenns

» Khóa học miễn phí thiết kế diễn đàn bằng Vbulletin tại ICODE
LAB7 hoàn thành I_icon_minitimeTue May 01, 2012 12:15 pm by mr_icode


LAB7 hoàn thành

Go down

LAB7 hoàn thành Empty LAB7 hoàn thành

Bài gửi by Bonstar Tue Nov 30, 2010 10:38 pm

create database BookLibrary
go
use BookLibrary
go
--Làm một Table book nhập giá trị mặc định là 1 cho cột Edition
create table book

(
BookCode int ,
BookTitle varchar(40),
Author varchar(40),
BookPrice money,
Copies int,
constraint ck_bookprice check (BookPrice>10 and BookPrice<100)

)
go
select* from book
go
alter table book
add Edition int default (1)
go
select * from book
go
--Create Members Table
create table Members
(
MemberCode int,
Name varchar(40),
[Address] varchar(40),
PhoneNumber int,
constraint pk_membercode primary key (MemberCode)
)
go
select *from Members
go
--Create IssueDetails table
create table IssueDetails
(
Bookcode int,
MemberCode int,
IssueDate datetime,
ReturnDate datetime,
constraint fk_MemberCode foreign key (MemberCode) references Members(MemberCode)
)
go
select *from IssueDetails
go
--Remove BookPrice
alter table book
drop constraint ck_bookprice
go
--Remove FOREIGN KEY contraint
alter table IssueDetails
drop constraint fk_MemberCode
go
--Drop table BOOK and Members
drop table book
go
drop table Members
go





[quote]
Bonstar
Bonstar
Khỉ Trưởng Lão
Khỉ Trưởng Lão

Tổng số bài gửi : 80
Join date : 15/09/2010
Age : 32
Đến từ : Tp.HCM

Về Đầu Trang Go down

LAB7 hoàn thành Empty Re: LAB7 hoàn thành

Bài gửi by Bonstar Tue Nov 30, 2010 10:40 pm

Bài chỉ mang tính chất tham khảo !
Bonstar
Bonstar
Khỉ Trưởng Lão
Khỉ Trưởng Lão

Tổng số bài gửi : 80
Join date : 15/09/2010
Age : 32
Đến từ : Tp.HCM

Về Đầu Trang Go down

Về Đầu Trang

- Similar topics

 
Permissions in this forum:
Bạn không có quyền trả lời bài viết