1. Tuyển Mod quản lý diễn đàn. Các thành viên xem chi tiết tại đây

Tít.....tít......tít........bạn có một tin nhắn!!! :))

Chủ đề trong '1985 Hà Nội (1985 Club)' bởi jemibaby229, 03/05/2004.

  1. 1 người đang xem box này (Thành viên: 0, Khách: 1)
  1. hippi_trex

    hippi_trex Thành viên mới

    Tham gia ngày:
    08/05/2004
    Bài viết:
    802
    Đã được thích:
    0
    create table Students(studentID int, "Name" varchar(50), Age tinyint, stGender bit)
    sp_help students
    insert into students values (''1'', ''Hong Nhung'', ''21'', ''0'')
    insert into students values (''2'', ''Thanh Lam'', ''38'', ''0'')
    insert into students values (''3'', ''Minh Quan'', ''25'', '''')
    insert into students values (''4'', ''Tai Em'', ''26'', ''1'')
    insert into students values (''5'', ''Van Quyen'', ''19'', ''1'')
    create table Books (BookID int, "Name" varchar(50), TotalPage int, Type varchar(15), Quantity int)
    sp_help Books
    insert into Books values(''1'',''VB.NET'', ''99'', ''Null'', ''6'')
    insert into Books values(''2'', ''XML'', ''100'', ''Null'', ''5'')
    insert into Books values(''3'', ''Dream Weaver'', ''101'', ''Null'', ''4'')
    insert into Books values(''4'', ''Core Java'', ''102'', ''Null'', ''3'')
    insert into Books values(''5'', ''LGC'', ''300'', ''Null'', ''1'')
    **
    create table Borrows (BorrowID int, StudentID int, BookID int, BorrowDate datetime)
    sp_help Borrows
    insert into Borrows values(''1'', ''1'', ''1'', ''03/25/2004'')
    insert into Borrows values(''2'', ''2'', ''2'', ''04/24/2004'')
    insert into Borrows values(''3'', ''3'', ''3'', ''05/01/2004'')
    insert into Borrows values(''4'', ''4'', ''4'', ''05/03/2004'')
    insert into Borrows values(''5'', ''4'', ''4'', ''07/26/2004'')
    insert into Borrows values(''6'', ''4'', ''3'', ''08/23/2004'')
    insert into Borrows values(''7'', ''2'', ''4'' ,''09/30/2004'')

    **
    create table DropOuts (DrpID int, StudentID int, "Date" datetime)
    sp_help DropOuts
    2)**
    select StudentID as ''Student Code'', "Name" as ''Full Name'', Age as ''Age'', stGender as ''Gender''
    from Students
    order by right(name, len (name) - charindex('' '', name))
    3)**
    select
    4)**select "Name" from Students
    where stgender like ''''
    5)** select BookID as ''BookCode'', "Name", TotalPage, Quantity
    type = case
    when TotalPage <100 then ''Thin''
    when TotalPage >=100 and TotalPage<200 then ''Normal''
    when TotalPage >200 then ''Thick'' end
    from Books
  2. daizabao

    daizabao Thành viên mới

    Tham gia ngày:
    08/12/2003
    Bài viết:
    1.503
    Đã được thích:
    0
    7Display number of total available books on BookStore (Hint: Total availabale=Total Books-Total Borrowed Books)
    8Display name of the students that do not borrow any book
    9Create a view named ''vwStudentList'' that list all information of Students table as following:
    StudentID (int) | Name(Varchar(50)) | Age(tinyint) | stGender(bit)
    1 |Hong Nhung | 21 | Nu
    2 |Thanh Lam | 38 | Nu
    3 |Minh Quan | 25 | ko co du lieu
    4 |Tai em | 26 | Nam
    5 |Van Quyen | 19 | Nam
  3. troioi_dohoi

    troioi_dohoi Thành viên mới

    Tham gia ngày:
    22/04/2004
    Bài viết:
    39
    Đã được thích:
    0
    Mọi người ơi!! Tôi nhắn cho mọi người một tin nhắn như thế này nhá: Tôi muốn có tin nhắn !! Ko bít như thế có được ko nhi? Tôi chờ tin của mọi người nhá~ Cảm ơn mọi người !!! Hehhehhehhehhe!! Nhất là cảm ơn bác bantinhcatrongdem nhá
  4. NguyenLinhCuong_la_tao

    NguyenLinhCuong_la_tao Thành viên mới

    Tham gia ngày:
    15/09/2004
    Bài viết:
    572
    Đã được thích:
    0
    To Anh Quỷ : Anh đi đâu mà fải tiễn hả anh ? Em chả biết gì cả
  5. daizabao

    daizabao Thành viên mới

    Tham gia ngày:
    08/12/2003
    Bài viết:
    1.503
    Đã được thích:
    0
    Thi xong roài , phù , trượt roài
    1|
    create table Students (StudentID int primary key, Name varchar(50),Age tinyint,stGender bit)
    create table Books (BookID int primary key, Name varchar(50),TotalPage int,Type varchar(10),Quantity int)
    create table Borrows (BorrowID int primary key,StudentID int,BookID int,BorrowDate datetime)
    create table DropOuts (DrpID int primary key , StudentID int , Date datetime)
    insert into Students values(''1'',''Hong Nhung'',''21'',''0'')
    insert into Students values(''2'',''Thanh Lam'',''38'',''0'')
    insert into Students values(''3'',''Minh Quan'',''25'','''')
    insert into Students values(''4'',''Tai Em'',''26'',''1'')
    insert into Students values(''5'',''Van Quyen'',''19'',''1'')
    insert into Books values(''1'',''VB.NET'',''99'','''',''6'')
    insert into Books values(''2'',''XML'',''100'','''',''5'')
    insert into Books values(''3'',''Dream Weaver'',''101'','''',''4'')
    insert into Books values(''4'',''Core Java'',''102'','''',''3'')
    insert into Books values(''5'',''LGC'',''300'','''',''1'')
    insert into Borrows values(''1'',''1'',''1'',''03/25/2004'')
    insert into Borrows values(''2'',''2'',''2'',''04/24/2004'')
    insert into Borrows values(''3'',''3'',''3'',''05/01/2004'')
    insert into Borrows values(''4'',''4'',''4'',''05/03/2004'')
    insert into Borrows values(''5'',''4'',''4'',''07/26/2004'')
    insert into Borrows values(''6'',''4'',''3'',''08/23/2004'')
    insert into Borrows values(''7'',''2'',''4'',''09/30/2004'')
    select StudentID as ''Student Code'',Name as ''Full Name'',Age,stGender as ''Gender'' from StudentList order by
    ----------------------------------------------------
    2|
    select StudentID as ''''Student Code'''', "Name" as ''''Full Name'''', Age as ''''Age'''', stGender as ''''Gender''''
    from Students
    order by right(name, len (name) - charindex('''' '''', name))
    -----------------------------------------------------
    3|
    select
    ----------------------------------------------------
    4|
    select "Name" from Students
    where stgender like ''''''''
    ----------------------------------------------------
    5|
    select BookID as ''''BookCode'''', "Name", TotalPage, Quantity
    type = case
    when TotalPage <100 then ''''Thin''''
    when TotalPage >=100 and TotalPage<200 then ''''Normal''''
    when TotalPage >200 then ''''Thick'''' end
    from Books
    ----------------------------------------------------
    9|
    create view vwStudentList
    ---------------------------------------------------------
    select Name from StudentList where
    ---------------------------------------------------------
    12|
    create procedure
    -------------------------------------------------------
    13|
    Create trigger tgUpdateBook on Books for Update
    as
    if(update(BookID)
    begin
    update borrows set BookID=(select * from inserted)where BookID=(select * from deleted)
    end
    -----------------------------------------------------------
    14|
    creat procedure spDropout
  6. NguyenLinhCuong_la_tao

    NguyenLinhCuong_la_tao Thành viên mới

    Tham gia ngày:
    15/09/2004
    Bài viết:
    572
    Đã được thích:
    0
    To Sad_eye : Em ko bôc fét đâu, anh nhìn nick thằng Phú nhé, từ 0 người bình chọn sẽ lên 31 người bình chọn, thề
    Còn em à ? Anh chửi em chẳng ra gì rồi giờ anh lại còn giả nhân giả nghĩa à ? Cái bản chất của anh thì ko chỉ cái box này biết mà còn rất nhiều box khác nữa cơ, xấu xa nên nó lan truyền kinh lắm ! Hê hê
    To SFC : Tao hôm nay fải đi học nên ko đi ăn được !
  7. Sadeyes

    Sadeyes Thành viên quen thuộc

    Tham gia ngày:
    17/07/2002
    Bài viết:
    721
    Đã được thích:
    0
    Bản chất anh thì nói chung là chả ai biết được cả chú ạ, nói linh tinh cẩn thận toè mỏ. Nói chung là chú muốn gì, nhanh gọn vào.
  8. NguyenLinhCuong_la_tao

    NguyenLinhCuong_la_tao Thành viên mới

    Tham gia ngày:
    15/09/2004
    Bài viết:
    572
    Đã được thích:
    0
    To Sad_eye : Em chả muốn gì cả, em chỉ muốn là anh ăn nói cho cẩn thận thôi, em ko fải loại người bốc fét đâu
  9. Sadeyes

    Sadeyes Thành viên quen thuộc

    Tham gia ngày:
    17/07/2002
    Bài viết:
    721
    Đã được thích:
    0
    Thế thì vote tớ.
  10. datbeo_abc

    datbeo_abc Thành viên mới

    Tham gia ngày:
    17/07/2004
    Bài viết:
    534
    Đã được thích:
    0
    to SFC : thế Sn Trang HIPPI thế nào đây ? có ai post lên cho mọi người biết nhé, nếu không thi goi cho cái mẹt tui biết với nhé

Chia sẻ trang này