SHARE
TWEET

Untitled

a guest Feb 27th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE comments
  2. (
  3.     id NUMBER(2) NOT NULL,
  4.     article_comment VARCHAR2(30),
  5.     idarticle NUMBER(2),
  6.     iduser NUMBER(2)
  7. );
  8.  
  9. CREATE TABLE users
  10. (
  11.     id NUMBER(2) NOT NULL,
  12.     username VARCHAR2(10),
  13.     password VARCHAR2(10)
  14. );
  15.  
  16. CREATE TABLE tags
  17. (
  18.     id NUMBER(2) NOT NULL,
  19.     tagname VARCHAR2(10)
  20. );
  21.  
  22. CREATE TABLE articles
  23. (
  24.     id NUMBER(2) NOT NULL,
  25.     iduser NUMBER(2),
  26.     title VARCHAR2(10),
  27.     content VARCHAR2(10)
  28. );
  29.  
  30. CREATE TABLE tags_articles
  31. (
  32.     idarticle NUMBER(2) NOT NULL,
  33.     idtag NUMBER(2) NOT NULL
  34. );
  35.  
  36. ALTER TABLE comments ADD CONSTRAINT pk_constraints PRIMARY KEY (id);
  37. ALTER TABLE users ADD CONSTRAINT pk_users PRIMARY KEY (id);
  38. ALTER TABLE tags ADD CONSTRAINT pk_tags PRIMARY KEY (id);
  39. ALTER TABLE articles ADD CONSTRAINT pk_articles PRIMARY KEY (id);
  40. ALTER TABLE tags_articles ADD CONSTRAINT pk_tags_articles PRIMARY KEY (idarticle, idtag);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top