SQL Assignment Day6
SQL Assignment Day6
Qureies:
create table MY_CONTACTS(Contact_Id int PRIMARY KEY NOT NULL, Last_Name varchar(20),
First_Name varchar(20), Phone varchar(20), Email varchar(20), Gender varchar(20),
Birthday varchar(20), Prof_Id int FOREIGN KEY REFERENCES PROFESSION(Prof_Id), Zip_Code
varchar(20) FOREIGN KEY REFERENCES ZIP_CODE(Zip_Code), Status_Id int FOREIGN KEY
REFERENCES STATUS(Status_Id));
inner join -- to return matching records only from both the tables--
on a.Contact_Id = b.Prof_Id; --here based on two primary keys from those tables, the
tables are connected