Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.78 KB | None | 0 0
  1.  
  2. CREATE TABLE NA(a nvarchar(5));
  3. CREATE TABLE NT(a nvarchar(5));
  4. CREATE TABLE SA(a nvarchar(5));
  5. CREATE TABLE Q(a nvarchar(5));
  6. CREATE TABLE NSW(a nvarchar(5));
  7. CREATE TABLE V(a nvarchar(5));
  8. CREATE TABLE T(a nvarchar(5));
  9.  
  10.  
  11.  
  12. INSERT INTO NA values ('red'),('green'),('blue');
  13. INSERT INTO NT values ('red'),('green'),('blue');
  14. INSERT INTO SA values ('red'),('green'),('blue');
  15. INSERT INTO Q values ('red'),('green'),('blue');
  16. INSERT INTO NSW values ('red'),('green'),('blue');
  17. INSERT INTO V values ('red'),('green'),('blue');
  18. INSERT INTO T values ('red'),('green'),('blue');
  19.  
  20.  
  21. SELECT * FROM NA, NT, SA, Q, NSW, V, T
  22. WHERE NA.a != NT.a and NA.a != SA.a and NT.a != SA.a
  23.     and NT.a != Q.a and SA.a != Q.a and SA.a != NSW.a
  24.     and SA.a != V.a and Q.a != NSW.a and NSW.a != V.a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement