All right, in this lab, we had some set up for you, it was a StudentQueryTest java. When you brought that in, see it creates the entity manager, and it closes it's familiar code to you now. It also gave you this test some more fees, a little query. So it gives you an example of creating a query from the entity manager. That's my query object, in here is JPQR. This is student object, so it's case sensitive, it's java. And we're basically saying there is a property called fees, student.fees, there's my alias, so SUM (student.fees). So when we're riding what seems to be select statements in this lab, we're writing against classes and properties, not tables and columns. So here gets single result against the query, it executes it, it brings back an object. So I'll cast it to a double, and I'll assert it to what I think the total number of Visa now that was given to you. So in the same vein you can have a go yourself, create a query by selecting the average fees. Create the query, execute the single result, cast to a double, and assert it to what you think the average fees are going to be. Now we start to get into more interesting things with our JPQL, we're writing queries that return more than just a double. So here I creating a query JPQL, select everything from the alias student. So everything all student entities, where the student.depth that is a property, it's not a column on a database equals this name parameter. Saying to say the name parameter is chemistry, so that JPQL is going to be converted to sequel once it hits hybrid ink, and then executed through a JDC connection not getting a single result. This time we're getting a result list back, the result set which will be marshaled into a list of students. Yes, you get a little warning, it's not type safe, we'll see what we can do about that later on. And it looks like we may be having a couple of students in the chemistry department, and then we had one more query for you, tight query. Once again, create a query there's some JPQL, select all students alias students, where student.first name is like the main parameter first. And then I cast what comes back from the result set into student classes as far as the queries concerned. So I set my parameter 1st percent E percent, so that is kind of the syntax we need for likes. Execute the results that warning this time because the type query, you get a list of students back, and we hope that is for students in this case. So one of the things here is that you may have played around with interacting with the database, so you may have to change these numbers for the J unit to pass. You might have added new students, you might have updated their fees, but let's run it. Looks like mine worked, probably change those numbers myself. Here we can take a look at what's happening here, we can see the select statement for the sum, select the average. Then select statement there for getting a list of students where the first name is like, see it right there. And if I come down here, I can see the select statement for the department. I'm not dictating the order that the J units ran in this time, so it's basically up to the runner.