I have three tables:
POP(country, year, pop)
FOOD(country, year, food)
INCOME(country, year, income)
I am trying to create a view such as:
V(country, year, pop, food, income)
This is my code so far. I don't think its correct:
CREATE VIEW V AS
(SELECT * FROM POP
UNION
SELECT * FROM FOOD
UNION
SELECT * FROM INCOME);
One issue is, a country that is present in POP
may not be present in FOOD
. Same goes for year. A year that is present in POP
may not be present in FOOD
. So, I keep thinking that the above code will not work.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…