Advertisement
Guest User

Untitled

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