Question: Could you please answer these two questions by provide suggested solutions to write it on the SQL. 1) A query that selects attributes from 3
Could you please answer these two questions by provide suggested solutions to write it on the SQL. Run SQL Command Line OL> CREATE TABLE users user id NUMBER 10 3 user nane VARCHAR2K1B 4 user address UARCHAR2X10 5 user phone NUMBER 10) 6 CONST NT user-pk PRIMARY KEY user id able created QL> CREATE TABLE accounts C NUMBER 16) acct UARCHAR2C15 4 user NUMBER 10) k PRIMARY KEY (acct no users user id able created QL> CREATE TABLE card K 2 ca NUMBER 16) UARCHAR2010 4 user. NUMBER 10> acct NO NUMBER 16 PRIMARY KEY (card no FOREIGN KEY Kuser D> REFERENCES users Cuser id CONSTRAINT card fk2 FOREIGN KEY Kacct NO> accounts Kacct no able created QL> CREATE TABLE transactions 2 T rans-ID NUMBER 15 3 T -Tybee UARCHAR2 18 NUMBER 16 NUMBER 16 acct no CONSTRAINT T 7 CONSTRAINT T REFERENCES card Kcard no> 8 CONSTRAINT Trans fk2 FOREIGN KEY Kacct no REFERENCES accounts Cacct no 9 Table created L> CREATE TABLE receipt receipt id id NUMBER 15> 1 user id NUMBER 10> id ES transactions CTRAN D> CONSTRAINT receipt fk2 FOREIGN KEY Kuser-id> ES users (user id ble created RL> CREATE TABLE user transaction K cust trans id NUMBER 15 user id NUMBER 18 Trans id NUMBER 15 NUMBER 16 acct NUMBER 15 k FOREIGN KEY Kuser id> REFERENCES users (user id 9 .CONSTRAINT user trans f k2 FOREIGN KEY Trans-ID> REFERENCES t ransactions CTR NSLID> 0 CONSTRAINT user trans f k3 FOREIGN KEY Cacct no> REFERENCES accounts Kacct n CONSTRAINT user -fk1 FOREIGN KEY Kreceipt id> REFERENCES receipt r eipt id ble created CREATE TABLE user acct K 2 user acct id NUMBER 18> NUMBER 16 acct no user id NUMBER 18> CONSTRAINT user acct id k PRIMARY KEY Kuser k REFERENCES CONSTRAINT user. id fk2 FOREIGN KEY user id REFERENCES users Cuser. ble created
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
