UrbanPro
true
default_background

Learn MS SQL General from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Beginner SQL: Learn SQL from Scratch

Prachi
3 hrs ago 0 0

This beginner-friendly SQL lesson is designed for students who want to learn how to work with databases and build a strong foundation in SQL. No prior SQL experience are also eligible.

 

1. What is SQL?

SQL (Structured Query Language) is a language used to communicate with databases.

For example, a company may have an Employee table:

Employee_ID Name Department Salary
101 Rahul IT 60000
102 Priya HR 50000
103 Amit IT 75000
104 Neha Finance 65000

Using SQL, we can ask questions such as:

  • Who works in the IT department?
  • What is Amit's salary?
  • How many employees are there?
  • Which employees earn more than ₹60,000?

2. Understanding the Basic SQL Structure

The simplest SQL query is:

SELECT column_name
FROM table_name;

For example:

SELECT Name
FROM Employee;

This returns the names of all employees.

To retrieve multiple columns:

SELECT Name, Department, Salary
FROM Employee;

To retrieve all columns:

SELECT *
FROM Employee;

Key Concept

Think of SQL as asking a question:

SELECT → What information do I want?
FROM → Where is that information stored?


3. Filtering Data Using WHERE

Suppose we only want employees from the IT department.

SELECT Name, Salary
FROM Employee
WHERE Department = 'IT';

Result:

Name Salary
Rahul 60000
Amit 75000

The WHERE clause is used to filter records based on a condition.

Another Example

Find employees earning more than ₹60,000:

SELECT Name, Salary
FROM Employee
WHERE Salary > 60000;

4. Using Multiple Conditions

We can combine conditions using AND and OR.

AND

Find employees from IT earning more than ₹60,000:

SELECT Name, Salary
FROM Employee
WHERE Department = 'IT'
AND Salary > 60000;

OR

Find employees who work in either IT or HR:

SELECT Name, Department
FROM Employee
WHERE Department = 'IT'
OR Department = 'HR';

5. Practical Exercise

Try writing SQL queries for the following:

Exercise 1

Display the names and departments of all employees.

Exercise 2

Display employees who work in Finance.

Exercise 3

Display employees earning more than ₹60,000.

Exercise 4

Display employees from IT whose salary is greater than ₹60,000.

Exercise 5

Display the names and salaries of employees earning exactly ₹50,000.


6. Quick Recap

Today we learned:

  • What SQL is
  • What a database table looks like
  • SELECT
  • FROM
  • WHERE
  • Comparison operators such as =, >, and <
  • Using AND and OR
  • How to write basic SQL queries

Next Lesson

In the next lesson, we can build on these concepts with ORDER BY, DISTINCT, aggregate functions such as COUNT and SUM, GROUP BY, and HAVING, followed by practical business/analytics problems.

0 Dislike
Follow 1

Please Enter a comment

Submit

Looking for MS SQL General Training?

Learn from Best Tutors on UrbanPro.

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for MS SQL General Classes?

The best tutors for MS SQL General Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn MS SQL General with the Best Tutors

The best Tutors for MS SQL General Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more