-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviews.sql
More file actions
10 lines (5 loc) · 805 Bytes
/
Copy pathviews.sql
File metadata and controls
10 lines (5 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
CREATE OR REPLACE VIEW cust_details AS (SELECT cust_name, cust_address, cust_dob, cust_phnum, login_uname FROM (customer NATURAL JOIN cust_phoneNum natural join credentials_cust natural join credentials)); -- for customer view
create or replace view view_accounts as (SELECT acc_num,login_uname from cust_account natural join credentials_cust natural join credentials);
create or replace view show_transaction_log as (select trans_type,trans_amt, trans_date, s_acc_num, r_acc_num from transactions);
CREATE OR REPLACE VIEW emp_details AS (SELECT emp_name, emp_add, emp_dob, emp_salary, emp_uname, emp_id FROM employee); -- for employee view
CREATE OR REPLACE VIEW pending_loans AS (SELECT ln_status, cust_phnum FROM loan NATURAL JOIN cust_account NATURAL JOIN cust_phonenum ); -- for employee view