mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-11-29 14:45:51 +03:00
modifying example scripts for SQLite3.
This commit is contained in:
parent
06e054e91c
commit
ca5bba45e3
@ -1,7 +1,7 @@
|
||||
#! /bin/bash
|
||||
|
||||
psql testdb -c "
|
||||
sqlite3 test.db "
|
||||
SELECT account_id, product_cd, cust_id, avail_balance
|
||||
FROM LEARNINGSQL.account
|
||||
FROM account
|
||||
WHERE product_cd IN ('CHK', 'SAV', 'CD', 'MM')
|
||||
;"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#! /bin/bash
|
||||
|
||||
psql testdb -c "
|
||||
sqlite3 test.db "
|
||||
SELECT e.fname, e.lname, d.name
|
||||
FROM LEARNINGSQL.employee e INNER JOIN LEARNINGSQL.department d
|
||||
FROM employee e INNER JOIN department d
|
||||
USING (dept_id)
|
||||
;"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#! /bin/bash
|
||||
|
||||
psql testdb -c "
|
||||
sqlite3 test.db "
|
||||
SELECT e.fname, e.lname, e_mgr.fname mgr_fname, e_mgr.lname mgr_lname
|
||||
FROM LEARNINGSQL.employee e INNER JOIN LEARNINGSQL.employee e_mgr
|
||||
FROM employee e INNER JOIN employee e_mgr
|
||||
ON e.superior_emp_id = e_mgr.emp_id
|
||||
;"
|
||||
|
@ -1,12 +1,12 @@
|
||||
#! /bin/bash
|
||||
|
||||
psql testdb -c "
|
||||
sqlite3 test.db "
|
||||
SELECT emp_id, assigned_branch_id
|
||||
FROM LEARNINGSQL.employee
|
||||
FROM employee
|
||||
WHERE title = 'Teller'
|
||||
UNION
|
||||
SELECT open_emp_id, open_branch_id
|
||||
FROM LEARNINGSQL.account
|
||||
FROM account
|
||||
WHERE product_cd = 'SAV'
|
||||
ORDER BY emp_id
|
||||
;"
|
||||
|
@ -1,8 +1,8 @@
|
||||
#! /bin/bash
|
||||
|
||||
psql testdb -c "
|
||||
sqlite3 test.db "
|
||||
SELECT open_emp_id, COUNT(*) how_many
|
||||
FROM LEARNINGSQL.account
|
||||
FROM account
|
||||
GROUP BY open_emp_id
|
||||
ORDER BY open_emp_id
|
||||
;"
|
||||
|
Loading…
Reference in New Issue
Block a user