Stuctured Query Language

last edited Thu, 24 Apr 2025 05:59:09 GMT
backlinks: null


Knowing SQL is essential in various computing domains, everyone uses it, even indirectly in many cases.

The Basics direct link to this section

SELECT * FROM my_table;

The snippet above queries all the entries in my_table. If you want to display a specific column, you can just query the columns by name.

SELECT student_name FROM Students;

SELECT student_id, student_name FROM Students;

Keywords direct link to this section

Clauses must always be listed in the order below:

An example using the WHERE keyword

SELECT * FROM Grades
WHERE student_id = 101

Boolean logic can also be applied to a filter

SELECT student_id, course_name, final_grade FROM Grades
WHERE course_name = 'Intro to ML' AND final_grade > 90;

An example where data is sorted in descending order

SELECT * FROM Grades
ORDER BY final_grade DESC;

Resources direct link to this section