MatthijsFontys

Create database no null contrains, no keys (For testing)

Mar 18th, 2019
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. CREATE TABLE Release (
  2. id INT PRIMARY KEY IDENTITY,
  3. categoryName VARCHAR(100) ,
  4. ownerId INT ,
  5. releaseName VARCHAR(200) ,
  6. releaseDescription VARCHAR(2000),
  7. imgLocation VARCHAR(200) ,
  8. releaseDate DateTime ,
  9. creationDate DateTime DEFAULT GETDATE()
  10. followerCount int DEFAULT 0
  11. );
  12.  
  13. CREATE TABLE Category (
  14. categoryName VARCHAR(100) PRIMARY KEY,
  15. imgLocation VARCHAR(200)
  16. );
  17.  
  18. CREATE TABLE Comment(
  19. id INT PRIMARY KEY IDENTITY,
  20. releaseId INT ,
  21. userId INT ,
  22. postDate DateTime ,
  23. replyId INT,
  24. commentText VARCHAR(1000)
  25. );
  26.  
  27. CREATE TABLE releaseUser(
  28. id INT PRIMARY KEY IDENTITY,
  29. username VARCHAR(20) ,
  30. passHash VARCHAR(200) ,
  31. imgLocation VARCHAR(200),
  32. accountCreationDate DateTime DEFAULT GETDATE()
  33. );
  34.  
  35. CREATE TABLE User_Release(
  36. userId INT ,
  37. releaseId INT
  38. );
Advertisement
Add Comment
Please, Sign In to add comment