Blog Content

  • 34.MS_SQL 2008 - 카테고리 ( Category ) 응용(2)

    Category DataBase/MS SQL on 2009. 9. 15. 11:20

    뷰 부분 수정 --[!] 뷰에다가직접데이터입력 Insert Into GetTopCategory(CategoryName) Values('가전') Go Select *From Categories Go --[!] 뷰의모든것을변경 Alter View dbo.GetTopCategory As Select * From dbo.Categories Where SuperCategory Is Null With Check Option --조건절에해당하는데이터만입력/수정가능 Go --추가후다시실행하면애러: Identity값입력x, SuperCategory => Null 입력 Insert Into GetTopCategory Values('오디오', 5, 2) Go --기본 Set Identity_Insert Categories ..

    Read more
  • 33.MS_SQL 2008 - 카테고리 ( Category ) 응용(2)

    Category DataBase/MS SQL on 2009. 9. 15. 10:20

    --[4] 수정: Modify / Edit Update Categories Set CategoryName = '콤퓨타' Where CategoriesID = 1 --[5] 삭제: Delete Delete Categories Where CategoriesID = 2 --[6] 검색: Search / Find --Like와is Null 사용 Select *From Categories Where CategoryName Like '%퓨%' And SuperCategory is Null --널(NULL)값비교 --[7] 뷰(View) 생성: Select문전용 --[a] 대분류데이터를출력하는구문을줄여서출력 Select CategoriesID, CategoryName From Categories Where Super..

    Read more
  • 32.MS_SQL 2008 - 카테고리 ( Category ) 응용(1)

    Category DataBase/MS SQL on 2009. 9. 15. 09:25

    --카테고리(상품카테고리응용프로그램설계 --[0] 테이블설계 Create Table dbo.Categories ( CategoriesID Int Identity(1, 1) Not Null Primary Key, --카테고리번호 CategoryName VarChar(50), --카테고리명 -- SuperCategory Int Null, --부모카테고리번호(확장용) Align SmallInt Default(0) --카테고리보여지는순서(확장용) ) Go --[!] 4개 SQL문연습 --[1] 입력: Add / Write Insert Categories Values('컴퓨터',Null, Default) --('상품명자리', 부모CategoriesID로들어가는데위에서컴퓨터 --CategoriesID가1이여서컴퓨터..

    Read more
이전 1 다음