The Queries in this page solved at the library database. It is a sample database generated by randomly records. You can download it from the link. You will see more than 500 examples in the future. You can filter from the search panel above by selecting sql statements. I hope you will like it
Solution 1)
Select name + surname from students
Solution 2)
Select name + surname as ns from students
Solution 3)
Select name + ' ' + surname as ns from students
ETİKETLER
Select - Alias -Solution 1)
Select gender,count(*) as StudentCount
from students
group by gender
ETİKETLER
Select - Group By - Aggragate - Alias -Solution 1)
Select sinif,gender,count(*) as StudentCount
from students
group by gender,sinif
ETİKETLER
Select - Group By - Aggragate - Alias -Solution 1)
Select sinif,gender,count(*) as StudentCount
from students
where gender = 'F'
group by gender,sinif
ETİKETLER
Select - Where - Group By - Aggragate - Alias -Solution 1)
Select sinif,count(*) as StudentCount
from students
group by sinif
having count(*) >= 30
ETİKETLER
Select - Group By - Having - Alias -Solution 1)
Select name,surname,count(*) BookCount
from students,borrows
where students.studentId = borrows.studentId
group by students.studentId,name,surname
Solution 2)
Select name,surname,count(*) BookCount
from students
join borrows on students.studentId = borrows.studentId
group by students.studentId,name,surname
ETİKETLER
Select - Join - Where - Group By - Aggragate - Alias - Çoklu Tablo -Solution 1)
Select name,surname,count(*) BookCount
from students
join borrows on students.studentId = borrows.studentId
group by students.studentId,name,surname
order by BookCount desc
Solution 2)
Select name,surname,count(*) BookCount
from students,borrows
where students.studentId = borrows.studentId
group by students.studentId,name,surname
order by BookCount desc
ETİKETLER
Select - Join - Where - Group By - Order By - Aggragate - Alias - Çoklu Tablo -Solution 1)
Select Year(birthdate) as Year, datepart(qq,birthdate) as Quarter,count(*) as Count
from students
group by Year(birthdate),datepart(qq,birthdate)
ETİKETLER
Select - Group By - SQL Functions - Alias -