Skip to content

Tag: primary-key

MYSQL no duplicate of 2 values

I couldn’t find an answer for this exact question although I am sure the information is on here somewhere. I have a python script that is adding stock data into a database. For each stock database has ~1000 lines where ‘ticker’ is the stock name and ‘time’ is the date(1 for each day). When I run my update script I

H2 Db, ID NextVal

I have a sequence as: CREATE SEQUENCE OWNER_SEQ START WITH 1; I need to trigger this sequence for OWNER table’s ID column CREATE TABLE METADATA.OWNER ( OWNER_ID NUMBER NEXTVAL(…

Oracle SQL Unique Constraint Violated

I need to create tables and input values. All but two rows when inserted give me an error, Unique Constraint Violated. The last row in DEPT_LOCATIONS table and the second to the last row in DEPENDENT table. I’m not sure why these rows aren’t being added because other rows in the same table are. Here’s my code so far: The