In this video, we dive deeper into essential SQL clauses using a practical example: a bookstore database. Whether you're new to SQL or looking to sharpen your skills, this crash course is designed to help you master the fundamentals quickly and efficiently. We cover the SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, and LIMIT clauses, providing clear explanations and real-world examples tailored to the bookstore dataset. By the end of this tutorial, you'll have a solid understanding of how to retrieve, filter, group, and sort data using PROC SQL in SAS. Join us on this learning journey and unlock the power of SQL for your data analysis needs! Don't forget to like, share, and subscribe for more tutorials on SAS and data analytics. Let's dive in!
Part 1: • SAS PROC SQL CRASH COU...
Code:
proc sql;
select *
from testsql.sales;
run;
proc sql;
select distinct genre
from testsql.books;
run;
proc sql;
select sum(sales) as total_sales, genre
from testsql.sales
group by genre;
run;
proc sql;
select *
from testsql.sales
where sales greater than symbol 50;
run;
proc sql outobs=2;
select *
from testsql.sales
order by sales desc;
run;
proc sql;
select sum(sales) as nf_sales, genre
from testsql.sales
where genre = 'Non-Fiction'
group by genre;
run;
#sql #sasprogramming #sqlforbeginners
29 сен 2024