Littlebear, although your first sentence is completely correct, I am not so sure your second one is; as far as I am aware, nobody from the European Commission has confirmed exactly what would happen.
Your second sentence is more in line with the message coming from certain media outlets. I would have thought that an independent Scotland would stay in the EU and not have to apply to join, but it would not have an automatic right to use the UK's terms of membership negotiated in 1973. But who knows... not me anyway.
As Greenland left the EEC rather than the EU, I am unsure that the situation would be identical as times have moved on, but I agree with Oldlady, I think there would be no expulsion.
Oldlady, I can only apologise for the nastiness on this thread about Scotland, as an Englishwoman I feel embarrassed by it [pack it in folks eh?] Even though I don't want the country to split, you can still respect the views of people who do.
Apologies OP, I am veering off the subject in your question 