Skip to content

Commit

Permalink
Create SQLQuery.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
HakanKorkz committed Oct 18, 2022
1 parent 5d2e6d1 commit 8fc168f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions youtubeLearing/sql/SQLQuery.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--Select
Select ContactName Adi,CompanyName Sirketadi,City Sehir from Customers
Select ContactName,CompanyName,City from Customers

Select*from Customers where City = 'Berlin'

case insensitive

sElEcT * from Products where CategoryID =1 or CategoryID=3

sElEcT * from Products where CategoryID =1 and UnitPrice<10

Select*from Products order by CategoryID, ProductName

Select*from Products order by UnitPrice desc

select count(*) adet from Products where CategoryID=2

select CategoryID, count(*)from Products where UnitPrice>20 group by CategoryID having Count(*)<10

select Products.ProductID,Products. ProductName,Products.UnitPrice,Categories.CategoryName from Products inner join Categories on Products.CategoryID = Categories.CategoryID
where Products.UnitPrice<10


--DTO Data Transformation object
select*from Products p left join [Order Details] od on p.ProductID=od.ProductID

Select* from Customers c left join Orders o on c.CustomerID= o.CustomerID

select * from Customers c left join Orders o on c.CustomerID= o.CustomerID
where o.CustomerID is null

0 comments on commit 8fc168f

Please sign in to comment.