In your first Approach you simply mixed up the keys.
Primary Key:
UserName VARCHAR(30) NOT NULL PRIMARY KEY,
Email VARCHAR(30) NOT NULL PRIMARY KEY,
vs. Foreign:
UserName VARCHAR(30) FOREIGN KEY (UserName) REFERENCES Signup (UserName),
password VARCHAR(50) FOREIGN KEY (password) REFERENCES Signup (password)
Anyway I prefer this way (approved with MSSQL 2014):
CREATE TABLE Signup (
UserName VARCHAR(30) NOT NULL,
Email VARCHAR(30) NOT NULL,
password VARCHAR(50),
CONSTRAINT PK_Signup PRIMARY KEY (UserName, password)
)
CREATE TABLE Sigin (
UserName VARCHAR(30),
password VARCHAR(50),
CONSTRAINT FK_Signup FOREIGN KEY (UserName, password) REFERENCES Signup (UserName, password)
)
Note 1: For "key-fields" I usually define a type for them. E.g:
CREATE TYPE DOM_USERNAME FROM VARCHAR(30)
CREATE TYPE DOM_PWD FROM VARCHAR(50)
Note 2: What should be the Primary
Think about using only UserName as Primary. E.g: Imagine here in CP what confusion came up in case same "user name" would be allowed for different users and the only difference would be the password...