Hi all! while reading the SEO techniques in google, I came through the robots.txt file and have made such a file for my website as per instructions, which contains the following lines:

User-Agent: *
Allow: /

User-Agent: Googlebot
Disallow: /

Are the syntax are correct for any website? I can't understand those two conflicting lines. Could anyone, who is an expert in SEO, explain those two sets of lines?
Would this file be uploaded to my root directory and how it will help in google search ranking?