Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribedCould you please answer these two questions by provide suggested solutions to write it on the SQL.
1) A query that selects attributes from 3 tables
2) A query that calculate one value. This value could be calculated using a function or a certain formula.
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

If ( A^2 - A + I = 0 ), then inverse of matrix ( A ) is?

Answered: 1 week ago

Question

What is computer neworking ?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago