LAB5 CODE.docx - USE master GO IF EXISTS(SELECT name FROM sys.databases WHERE name ='Lab5 DROP DATABASE Lab5 GO create database Lab5 GO USE Lab5 GO

LAB5 CODE.docx - USE master GO IF EXISTS(SELECT name FROM...

This preview shows page 1 - 2 out of 3 pages.

USE master ; GO IF EXISTS( SELECT name FROM sys . databases WHERE name = 'Lab5' ) DROP DATABASE Lab5 GO create database Lab5 ; GO USE Lab5 ; GO CREATE TABLE DEPARTMENT ( DepartmentName Char ( 35 ) NOT NULL, BudgetCode Char ( 30 ) NOT NULL, OfficeNumber Char ( 15 ) NOT NULL, Phone Char ( 12 ) NOT NULL, CONSTRAINT DEPARTMENT_PK PRIMARY KEY ( DepartmentName ) ); CREATE TABLE EMPLOYEE ( EmployeeNumber Int NOT NULL IDENTITY ( 1 , 1 ), FirstName Char ( 25 ) NOT NULL, LastName Char ( 25 ) NOT NULL, Department Char ( 35 ) NOT NULL DEFAULT 'Human Resources' , Phone Char ( 12 ) NULL, Email VarChar ( 100 ) NOT NULL UNIQUE , CONSTRAINT EMPLOYEE_PK PRIMARY KEY ( EmployeeNumber ), CONSTRAINT EMP_DEPART_FK FOREIGN KEY ( Department ) REFERENCES DEPARTMENT ( DepartmentName ) ON UPDATE CASCADE ); CREATE TABLE PROJECT ( ProjectID Int NOT NULL IDENTITY ( 1000 , 100 ), ProjectName Char ( 50 ) NOT NULL, Department Char ( 35 ) NOT NULL, MaxHours Numeric ( 8 , 2 ) NOT NULL DEFAULT 100 , StartDate Date NULL, EndDate Date NULL, CONSTRAINT PROJECT_PK PRIMARY KEY ( ProjectID ), CONSTRAINT PROJ_DEPART_FK FOREIGN KEY ( Department ) REFERENCES DEPARTMENT (
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Fall '16
  • Cressey

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

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes