Can you help me with database problems below (with 2 and 3) and also included th
ID: 3745083 • Letter: C
Question
Can you help me with database problems below (with 2 and 3) and also included the data in the question too
Work Study Address Work Study Name Work Study Title Hourly Rate Task Task Hours 234 Main St., Mankato, MN 56001 Tom Jones L1 8.00 Lab Setup 4.2 843 Elm St., North Mankato, MN 56003 Bill Brown L2 8.50 Network Studio 2.0 55 First Ave., Mankato, MN 56001 Lisa Evans L3 9.00 Install Software 3.5 399 Broad St., Mankato, MN 56001 Nancy Williams Supervisor 10.00 Lab Setup 1.0 111 Oak St., North Mankato, MN 56003 Tom Jones L2 8.50 Lab Setup 4.5 234 Main St., Mankato, MN 56001 Tom Jones L3 9.00 Install Software 2.0 843 Elm St., North Mankato, MN 56003 Bill Brown L1 8.00 Lab Setup 4.0 55 First Ave., Mankato, MN 56001 Lisa Evans L3 9.00 Network Studio 5.0 234 Main St., Mankato, MN 56001 Tom Jones L2 8.50 Network Studio 3.0 843 Elm St., North Mankato, MN 56003 Bill Brown L3 9.00 Install Software 2.5 1. Create a re port in zip code order. 2. List all the work study students from a specific state. 3. How many work study students live in Mankato? 4. Change the rates for each level of work study student. 5. Total time spent on each task. 6. Total cost of each project.Explanation / Answer
Background
You can easily get the records from Database with the use of Like Operator, Like operator searches the particular pattern that you specify in ' '.
_ _a_ -----------------> will fix the number of character you want before a and after a in your search
%M% -------------------> Matches the pattern with having M somewhere in the string before or after
'Math' --------------------> Seaches exact pattern.
---------------------------------------------------------------------------------------------------------------------------------------
2. So, I m assuming after street name there should a ', ' then we can form our query as
select * from ex1 where work_study_address like '%, Mankato,%';
Just Replace Mankato with the state name you want
----------------------------------------------------------------------------------------------------------------------------------------
3. We will use aggreate Function Count() so it will return the number of count of the result
select count(*) from ex1 where work_study_address like '%, Mankato,%';
NOTE : Im running these queries on MYSQL, this would be same on other databases too