Create table salary brackettype varchar25 not null

Info icon This preview shows pages 3–4. Sign up to view the full content.

Create table Salary ( BracketType Varchar(25) Not Null, SalaryBracket INT Not Null, SalaryLow INT Not Null, SalaryHigh InT Not Null, Constraint Salary_PK PRIMARY KEY(SalaryBrack) Step 2 - After creating the table, insert the data values. Bracket Type Salary Bracket Salary Low Salary High Unemployed 1 500 10,000 Retired 2 10,000 20,000 Middle Class 3 60,000 100,000 Upper-Middle Class 4 100,000 300,000 Celebrity 5 300,000 1,000,000 Insert into Salary(BracketType, SalaryLow, SalaryHigh) Values("Unemployed", 500, 10000); Insert into Salary(BracketType, SalaryLow, SalaryHigh) Values("Retired", 10000, 20000); insert into Salary(BracketType, SalaryLow, SalaryHigh) Values("Middle Class", 60000, 100000); Insert into Salary(BracketType, SalaryLow, SalaryHigh) Values("Upper-Middle Class", 100000, 300000); Insert into Salary(BracketType, SalaryLow, SalaryHigh) Values("Celebrity", 300000, 1000000); Step 3 – Now that you have created a table, use an ALTER statement to modify the SALARY table to have Salary Bracket become a foreign key referencing Salary Bracket in the PEOPLE table.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Alter table Salary ADD CONSTRAINT Salary_FK FOREIGN KEY(SalaryBracket); References People(SalaryBracket);
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '08
  • MCCONN,CHARLOTTERYOO,JUNGWOO
  • Foreign key

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern