vakho

SQL

Mar 27th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.79 KB | None | 0 0
  1. /*select * from spt_values where number>10*/
  2.  
  3. /*
  4. create table student
  5. (
  6. st_kodi int primary key not null,
  7. saxeli varchar(20) not null,
  8. gvari varchar(30) not null,
  9. strip int check(strip between 0 and 150),
  10. city varchar(10) null,
  11. tel varchar(20),
  12. fakulty_kodi int,
  13. date_of_birth datetime
  14. )
  15.  
  16. create table university
  17. (
  18. uni_kodi int primary key,
  19. un_name varchar(20),
  20. un_address varchar(30)
  21. )
  22. */
  23. /*
  24. insert into university(uni_kodi, un_name)
  25. values
  26. (111, 'tsu'),
  27. (222, 'esm'),
  28. (333, 'tsmu'),
  29. (444, 'gtu'),
  30. (555, 'gau'),
  31. (666, 'free_uni')
  32. */
  33.  
  34. /*exec sp_rename 'student.fakulty_kodi', 'fakulty', 'column'*/
  35.  
  36. ALTER TABLE student
  37. ALTER COLUMN fakulty VARCHAR(20)
  38.  
  39. ALTER TABLE student
  40. ADD
  41. CONSTRAINT df_city DEFAULT 'tbilisi' FOR city
  42.  
  43. ALTER TABLE student
  44. DROP COLUMN date_of_birth
Advertisement
Add Comment
Please, Sign In to add comment