[go: up one dir, main page]

0% found this document useful (0 votes)
20 views1 page

SQL Basics Practice

Uploaded by

Yash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

SQL Basics Practice

Uploaded by

Yash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL Basics & Practice Questions

SQL (Structured Query Language) is used to store, manage, and retrieve data from relational
databases.
Key Commands:
- SELECT → Retrieve data
- WHERE → Apply conditions
- ORDER BY → Sort data
- GROUP BY → Group rows
- JOIN → Combine tables
- INSERT → Add data
- UPDATE → Modify data
- DELETE → Remove data

Sample Practice Questions


1. Get all student names and ages from 'students' table.
SELECT name, age FROM students;

2. Find all employees who earn more than 50,000.


SELECT * FROM employees WHERE salary > 50000;

3. Count how many students are in each department.


SELECT department, COUNT(*) FROM students GROUP BY department;

4. Show student names with their enrolled course names (using JOIN).
SELECT s.name, c.course_name FROM students s INNER JOIN courses c ON
s.course_id = c.id;

5. Increase salary of employee with id=101 by 10%.


UPDATE employees SET salary = salary * 1.10 WHERE id = 101;

You might also like