Skip to content

Instantly share code, notes, and snippets.

INSERT INTO employees(employeeid, lastname, firstname, payment)
VALUES (1, 'McDonald', 'Carl', 1000)
SELECT xmin, xmax, employeeid, lastname, firstname, payment
FROM employees WHERE firstname = 'Carl';
BEGIN;
SELECT txid_current();
UPDATE employees
SET payment=5000
WHERE employeeid = 1
SELECT xmin, xmax, employeeid, lastname, firstname, payment
FROM public.employees;
SELECT employeeid, lastname, firstname, payment
FROM public.employees;
@kubawieczorek
kubawieczorek / insert.sql
Last active December 27, 2022 10:03
SQL employees insert
INSERT INTO employees(
employeeid, lastname, firstname, payment)
VALUES (1, 'John', 'Smith', 3000);
{
"_embedded": {
"accounts": [
{
"number": "100",
"money": 1500,
"clientName": "Thomas Johnson",
"_links": {
"self": {
"href": "http://localhost:8080/accounts/1"
@Projection(name = "accountProjection", types = {Account.class})
public interface AccountProjection {
@Value("#{target.getClient().getName()}")
String getClientName();
Integer getMoney();
String getNumber();
}
@Repository
public interface AccountRepository extends CrudRepository<Account, Integer> {
}
@RestController
@RequestMapping("/accounts")
public class AccountsController {
private final AccountService accountService;
@Autowired
public AccountsController(AccountService accountService) {
this.accountService = accountService;
}