Wednesday, July 19, 2023

SQL tut

 select c1,c2 from t;


--Query data in columns c1,c2 from a table


Select * from t;


--Query all rows and columns from a table


select c1,c2 from t where condition;


--Query data and filer rows with a condition


select distinct c1 from t whwre condition;


--Query distinct rows from a table


select c1, c2 from t order by c1 ASC[DESC];


--Sort the result set in ascending or descanding order


select c1, c2 from t order by c1 limit n offset offset;


--Skip offset of rows and return the next n rows


select c1, aggregate(c2) form t group by c1;


--Group rows using an aggregate function


select c1, aggregate(c2) from t goup by c1 having condition;


--Filter groups using HAVING clause


select c1, c2 from t1 inner join t2 on condition;


--Inner join t1 and t2


select c1, c2 form t1 left join t2 on condition;


--Left join t1 and t2


select c1, c2 form t1 right join t2 on condition;


--Right join t1 and t2


select c1, c2 from t1 full outer join t2 on condition;


--Perform full outer join


select c1, c2 from t1 cross join t2;


--Produce a Cartesian product of rows in tables



select t1, t2 form t1, t2;


--Another way to perform cross join



select c1, c2 from t1 A inner join t2 B on condition;


--Join t1 to itself using inner join clause



select c1, c2 form t1 union [ALL] select c1, c2 from t2;


--Combine rows from two queries



select c1, c2 from t1 intersect select c1, c2 from t2;


--Return the intersection of two queries



select c1, c2 from t1 minus select c1, c2 from t2;


--Subtract a result set from another result set



select c1, c2 form t1 where c1 [NOT] LIKE pattern;


--Query rows using pattern maching %, _



select c1, c2 form t1 ehere c1 [NOT] IN value_list;


--Query rows in a list



select c1, c2 from t where c1 between low and high;


--Query rows between two values



select c1, c2 from t where c1 IS [NOT] NULL;


--Check if values in table is NULL or not



MORE TIPS:


https://trumpexcel.com/number-rows-in-excel/


https://support.microsoft.com/en-gb/office/automatically-number-rows-76ce49e3-d8d2-459b-bd85-ee1d3973e6e6


Probaj Framer framer.com Promptovi: prompts.framer.ai Nauči Dizajn: naucidizajn.com

https://webflow.com/



No comments:

Post a Comment

Коментар: