-- Get Employee FullName
SELECT FirstName + ' ' + LastName as FullName FROM Employees
Soal yang pertama kita diminta untuk menggabungkan nama depan dan nama belakang di dalam satu field, ini kita tinggal gabung pakai tanda + trus kasih spasi didalam tanda ' '.
-- Get Data Employee Name and Address where Title as Sales Manager
SELECT FirstName + ' ' + LastName as FullName, Address
FROM Employees
WHERE Title = 'Sales Manager'
-- Get Employee Name, Position, and Address where BirthDate = 1952-02-19 00:00:00:00
SELECT FirstName + ' ' + LastName, Title, Address
FROM Employees
WHERE BirthDate = '1952-02-19'
-- Get All EMployees where hiredate between '1992-05-01' AND '1993-05-01'
SELECT * From Employees
WHERE HireDate BETWEEN '1992-05-01' AND '1993-05-01'
-- Find the number of sales representative in each city that contains at least 1 sales representatives.
Order by the number of employees
SELECT City, count(Title) as TotalEmployee from Employees
where Title = 'Sales Representative'
Group by City
Untuk soal yang ini kita diminta untuk menampilkan pegawai yang jabatannya 'Sales Representative' dari masing - masing kota. Untuk itu, menggunakan count(title) untuk menghitung jumlah titlenya. Kemudian setelah where ada group by city, jadi yang count(title) tadi akan di group berdasarkan masing - masing kota sehingga didapat hasil seperti diatas.
Mens Titanium Watches | TITanium-ART
BalasHapusMens titanium watches. Made raft titanium in Solingen. titanium cerakote Germany. Product benjamin moore titanium details. where is titanium found A high-quality quality suppliers of metal watch made of titanium in Germany.