MisterTootor M.S., B.S., A.S., A.S.B
I'm a paragraph. Click here to add your own text and edit me. It's easy.
Query: Pull in Five Columns
Select ID, First Name, Last Name, Title, Department
From tbl_Company;
​
Output:
​
​
​
​
​
​


Select ID, First Name, Last Name, Address, City, State, Zip Code, Company, District, Title, Department
From tbl_Company
Where District = 5a;
​
​
​
​
​
​
Query: Find all Districts equal to 5A
Select Amounts
Select * From tbl_Amounts

Select Specific Amounts
Select ID, County, Case #, Last Name, First Name, DOB, Amount, Owed, Balance
From tbl_Amounts
Where Owed = 500;

Group By
SELECT ID, Sum(Amount) AS SumOfAmount, Sum(Owed) AS SumOfOwed, Sum(Balance) AS SumOfBalance
FROM [tbl_Amounts]
GROUP BY ID;

Here we are going to query for those employees whose first name starts with an 'S' character and works in the Operation department.
​
-- Query the employee whose first name starts with S.
​
Select Emp.Emp_Id
Emp.First_Name
Emp.Last_Name
Emp.Dept_Id
From Employee Emp
Where Emp.First_Name Like 'S%';
-- Query the employee whose first name starts with S.
-- and work in Operation department. Dept_Id = 1.
Select Emp.Emp_Id
Emp.First_Narme
Emp.Last_Name
,mp.Dept_Id
From Employee Emp
Where Emp.First_Name Like 'S%'
And Emp.Dept_Id = 1;
​
​
This is the result after running the queries:
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
