Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
i think we did it~~~~~~~
  • Loading branch information
adl13006 committed Oct 29, 2015
1 parent 4540fa7 commit 19fd344
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Chinook_Rev1.sql
@@ -1,5 +1,5 @@
USE `chinook`;

SET SQL_SAFE_UPDATES = 0;

/*******************************************************************************
Create Tables
Expand Down Expand Up @@ -122,10 +122,9 @@ INSERT INTO Person(FirstName, LastName, Address, City, State, Country, PostalCod
SELECT FirstName, LastName, Address, City, State, Country, PostalCode, Phone, Fax, Email,EmployeeId
FROM Employee;

INSERT INTO Employee (PersonId)
SELECT PersonId
FROM Person
WHERE PersonId > @var1;
Update Employee
INNER JOIN Person ON (Person.EmployeeId = Employee.EmployeeId)
SET Employee.PersonId = Person.PersonId;

ALTER TABLE Person
DROP COLUMN EmployeeId;
Expand Down Expand Up @@ -220,7 +219,7 @@ CREATE INDEX `IFK_TrackURLID` ON `TrackURL` (`TrackID`);
ALTER TABLE `Invoice` ADD CONSTRAINT `FK_PayId`
FOREIGN KEY (`PayId`) REFERENCES `Payment` (`PayId`) ON DELETE NO ACTION ON UPDATE NO ACTION;

CREATE INDEX `IFK_PayId` ON `PayId` (`PayId`);
CREATE INDEX `IFK_PayId` ON `Invoice` (`PayId`);



Expand Down

0 comments on commit 19fd344

Please sign in to comment.