Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Proof these three SQL problems. I gave my best attempt--My sql code is listed in each problem. Update discount of all products whose category

Please Proof these three SQL problems. I gave my best attempt--My sql code is listed in each problem. image text in transcribed
image text in transcribed
image text in transcribed
Update discount of all products whose category is 'Sports' to 25 percent. Write your query here Database structure 1 UPDATE Sports SET Pdesc - NULL WHERE PRODID 183 Salesman (Sid, Sname. Location) Product (Prodid. Pdesc Price Category, Discount) Sale (Saleld. Sid. Sldate, Amount) Saledetail (Saleld, Prodid, Quantity) Verify Submit Query Result Expected Result ORA 00920: Invalid relational operator PRODID PDESC PRICE CATEGORY DISCOUNT 101 Basketball 10 Sports 25 102 Shirt 20 Apparel 10 103 NULL 30 Electronics 15 104 Cricket Bat 20 Sports 105 Trouser 10 Apparel 5 106 Television 40 ELECTRONICS20 Type here to search i e Create Match table as per details below. A player cannot play against himself, so player 1 should not be equal to player2. Column Name Data Type Constraint Description Mid INTEGER Unique Match id for a tournament PRIMARY KEY Tid Id INTEGER FOREIGN KEY Existing tournament tournament table present in Player 1 INTEGER FOREIGN KEY Existing player Id present in player table Player should not be equal to Player2 Player2 INTEGER FOREIGN KEY Existing player Id present in player table Matcht DATE NOT NULL Match Date Winner INTEGER FOREIGN KEY Existing player Id present in Player table Score VARCHAR2(30) NOT NULL Match Score Write your query here 1 CREATE TABLE Match 2 MIG INTEGER PRIMARY KEY, 3 TID INTEGER REFERENCES Tournament (Tournamentid), Playeri INTEGER REFERENCES Player(PlayerId), Player2 INTEGER REFERENCES Player(PlayerId), MatchDt DATE NOT NULL, 7 Winner INTEGER REFERENCES Player(PlayerId), 4 5 Score VARCHAR2 (30) NOT NULL, 9 CONSTRAINT playler_id_ck CHECK (Player1 Player2) 10) Verify Submit

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

4. What decision would you make and why?

Answered: 1 week ago

Question

3. Review the evidence. Do you believe the testimony presented?

Answered: 1 week ago

Question

1. What are the marketing implications of this situation?

Answered: 1 week ago