CUSTOMER ORDER CODE.docx - create table CUSTOMER CustomerID LastName FirstName State constraint create table ORDERS OrderID ORDERSDesc CustomerID

CUSTOMER ORDER CODE.docx - create table CUSTOMER CustomerID...

This preview shows page 1 out of 1 page.

create table CUSTOMER ( CustomerID int NOT NULL, LastName varchar ( 35 ) NOT NULL, FirstName varchar ( 35 ) NULL, State char ( 2 ) NOT NULL default 'NH' , constraint CUSTOMER_PK primary key ( CustomerID ) ); create table ORDERS ( OrderID int NOT NULL, ORDERSDesc varchar ( 35 ) NOT NULL, CustomerID int NOT NULL, constraint ORDERS_PK primary key ( OrderID ), constraint ORDERS_FK foreign key ( CustomerID ) references CUSTOMER ( CustomerID ) on update cascade ); insert into CUSTOMER values ( '1000' , 'Smith' , 'Michael' , 'NY' ); insert into CUSTOMER values ( '1001' , 'Jones' , 'George' , 'FL' ); insert into CUSTOMER values ( '1002' , 'Murphy' , 'Rebecca' , '' ); insert into CUSTOMER values ( '1003' , 'Seidman' , 'Susan' , 'MA' ); insert into
Image of page 1

Unformatted text preview: CUSTOMER values ( '1004' , 'Zahar' , 'John' , 'FL' ); insert into ORDERS values ( '1' , 'Seiko Watch' , '1001' ); insert into ORDERS values ( '2' , 'Citizen Watch' , '1000' ); insert into ORDERS values ( '3' , 'Tiffany Lamp' , '1001' ); insert into ORDERS values ( '4' , 'Pocket Protector for iPhone 4' , '1004' ); insert into ORDERS values ( '5' , 'Seiko Ladies Watch' , '1002' ); insert into ORDERS values ( '6' , 'Oneida Flatware Set' , '1004' ); USE CUSTOMER_ORDER ; GO SELECT * FROM [CUSTOMER] , [ORDERS] WHERE [CUSTOMER] . CustomerID = [ORDERS] . CustomerID ;...
View Full Document

  • 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