Utilizing constraint to create a new table in sql : <p>I am trying to create a query based off of the following information below. While attempting to create this, I keep violating the primary key.</p>



<pre class="lang-js prettyprint-override"><code>CREATE TABLE writers
    (authorid VARCHAR2(4), 
    lname VARCHAR2(10), 
    fname VARCHAR2(10), 
    isbn VARCHAR2(10), 
    title VARCHAR2(30) CONSTRAINT title_nn NOT NULL,
    CONSTRAINT wt_pk PRIMARY KEY (authorid),
    CONSTRAINT wt_fk FOREIGN KEY (isbn) REFERENCES books (isbn)); 
INSERT INTO writers 
(SELECT authorid, fname, lname, isbn, title
     FROM author
     JOIN bookauthor USING (authorid)
     JOIN books USING (isbn));
ALTER TABLE employees
ADD CONSTRAINT et_pk
PRIMARY KEY (ssn);
</code></pre>

<p><a href="https://i.stack.imgur.com/yHTVt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yHTVt.png" alt=""></a></p>
