Skip to content

The seem to be no need to add auto increment on 1st problem for songs table #14

Open
@Mzamomelo

Description

@Mzamomelo

/* For song Table, I dont think auto increment was necessary, because when values were inserted, code was not running
Below is what I think should be solution to the problem. */

CREATE TABLE songs (
id INT NOT NULL,
name VARCHAR(255) NOT NULL,
length FLOAT NOT NULL,
album_id INT NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (album_id) REFERENCES albums(id)
);

/*well for me, I'm on sql server hence I didn't add IDENTITY(1,1) on my code it it worked well, this identity is doing the same thing as auto increment on sql server */
If I'm wrong I'm open to correction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions