I don't know how much info you need to be able to answer this but... I've looked through constraints and stuff and I just dont know what to do.
So I had to make a small database with stocks, customers, holdings etc.... and I got three queries before making it that had to be tested (and are supposed to fail), the problem is the two fails as expected but one of them that should be failing is working.
Quick recap: I have 3 tables; Customer(customer name, SSN, account number, available money)
Stock(name of shares, ticker(the stock ID), stockmarket, last payment made)
Holdings (SSN, ticker(stock ID), number of shares)
Primary keys are: SSN, ticker. Where ticker is a foreign key in Holdings.
UPDATE Stocks SET ticker='NONO' WHERE ticker='AAPL' This one updates Stocks and Holdings because they are linked so i don't know what I'm supposed to do to not make it go through.
These ones fail like they are supposed to: UPDATE Customer SET ssn='390401-2035' WHERE ssn='820101-7014';
UPDATE Holdings SET ticker='NONO' WHERE ticker='HM B';
Aucun commentaire:
Enregistrer un commentaire