I have managed to break my X server, and am trying to attempt the solution offered in this page. I only have one user on the system, but I have no idea what its group name is, which means I can't execute the solution offered on the page.

Pressing Ctrl+Alt+F(x) just brings up a flashing white cursor, but I can't type anything. I only have Ctrl+Alt+F7 at my disposal, but unable to login and bring up a prompt with Ctrl+Alt+T.

The only access I have to a shell of any description seems to be by booting into recovery mode and dropping to the shell. However, I then don't get any response from the shell when I type users (as suggested by this page as a way to find out my groupname).

A valid answer to this question would either:

a) Allow me to find out the groupname so that I can execute the sudo chown username:groupname .Xauthority command, or

b) Provide an alternative way to fix the XServer issue, which sounds very similar to the one here.


Question: Perform Insert operation when two tables are related by foreign key?
Answer: Well, to answer to your question sql data are manipulated by sql language. But sql server is just a way to saved structured data.

So, when you are building an application, and you are listing products available to order, you know the ids of thoses products. And then you can do something like :

INSERT INTO tblOrder(OName, Pid)
VALUES ('name_choosen', [product_id_selected])


In your case, for sql training, you do :

INSERT INTO tblOrder(OName, Pid)
SELECT 'name_of_order', Pid
FROM tblProduct
WHERE PName='IPhone'


Or

INSERT INTO tblOrder(OName, Pid)
SELECT 'name_of_order'
      , (SELECT Pid from tblProduct WHERE PName='IPhone')


Or 

INSERT INTO tblOrder(OName, Pid)
VALUES ('name_of_order'
      , (SELECT Pid from tblProduct WHERE PName='IPhone'))