Tags | sql spring-boot jdbc |
Hard Prerequisites | |
IMPORTANT: Please review these prerequisites, they include important information that will help you with this content. | |
|
I hope at this point you should have already read up on JDBC templates, JPA and Hibernate.
In this project we wil re-visit you SQl project. Instead of only using scripts to create and interact with your database you are doing to do this using Java. You will be using dataSources to configured your connection to your database and query your tables.
Revise PROJECT: Shop Database using sql and make sure all tables are created and populated
Use vanilla Java (no Springboot) connect to your database and perform the queries in part 2 but only number [1-7]
Use Springboot JDBC templates to connect to your database and perform the queries in part2 but only number [1-9]
Lastly I would like you to use Hibernate + JPA to connect to your database and perform the queries in part 2 [1-17]
Don’t forget to test your application
Save all of your instructions in a script file. You will need to submit that file.
SELECT ALL records from table Customers.
SELECT records only from the name column in the Customers table.
Show the name of the Customer whose CustomerID is 1.
UPDATE the record for CustomerID = 1 on the Customer table so that the name is “Lerato Mabitso”.
DELETE the record from the Customers table for customer 2 (CustomerID = 2).
Select all unique statuses from the Orders table and get a count of the number of orders for each unique status.
Return the MAXIMUM payment made on the PAYMENTS table.
Select all customers from the “Customers” table, sorted by the “Country” column.
Select all products with a price BETWEEN R100 and R600.
Select all fields from “Customers” where country is “Germany” AND city is “Berlin”.
Select all fields from “Customers” where city is “Cape Town” OR “Durban”.
Select all records from Products where the Price is GREATER than R500.
Return the sum of the Amounts on the Payments table.
Count the number of shipped orders in the Orders table.
Return the average price of all Products, in Rands and in Dollars (assume the exchange rate is R12 to the Dollar).
Using INNER JOIN create a query that selects all Payments with Customer information.
Select all products that have turnable front wheels.