Access over 20 million homework & study documents

Lastname Firstname Ddl

Content type
User Generated
Subject
MySQL
Type
Homework
Rating
Showing Page:
1/7

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/7

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/7

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 7 pages?
Access Now
Unformatted Attachment Preview
----drop any related objects and tables DROP TABLE EMPLOYEE ; DROP TABLE MEMBER ; DROP TABLE SCHEDULE ; DROP TABLE PORDER; DROP TABLE PRODUCT ; -----create table employee CREATE TABLE EMPLOYEE ( EMPID INT NOT NULL , EMPNAME VARCHAR2(100) , EMPGENDER VARCHAR2(20) , EMPADDRESS VARCHAR2(100) , EMPCITY VARCHAR2(50) , CONSTRAINT EMPLOYEE_PK PRIMARY KEY ( EMPID ) ENABLE ); -----create table member CREATE TABLE MEMBER ( MEMBERID INT NOT NULL , EMPID INT , MEMBERNAME VARCHAR2(50) , MEMBERGENDER VARCHAR2(20) , MEMBERADDRESS VARCHAR2(100) , MEMBERCITY VARCHAR2(20) , CONSTRAINT MEMBER_PK PRIMARY KEY ( MEMBERID ) ENABLE ); -----create table schedule CREATE TABLE SCHEDULE ( SCHEDID INT NOT NULL , SCHEDNAME VARCHAR2(20) , SCHEDDATE DATE , SCHEDTIME DATE , EMPID INT , CONSTRAINT SCHEDULE_PK PRIMARY KEY ( SCHEDID ) ENABLE ); -----create table porder CREATE TABLE PORDER ( ORDERID INT NOT NULL , PRODUCTID INT , ORDERDATE DATE , ORDERDESC VARCHAR2(100) , SHIPADDESS VARCHAR2(100) ,EMPID INT , CONSTRAINT PORDER_PK PRIMARY KEY ( ORDERID ) ENABLE ); -----create table product CREATE TABLE PRODUCT ( PRODUCTID INT NOT NULL , PRONAME VARCHAR2(50) , SUPPLIER VARCHAR2(25) , QTY INT , PRICE DECIMAL , CONSTRAINT PRODUCT_PK PRIMARY KEY ( PRODUCTID ) ENABLE ); -----adding the foreign keys alter table MEMBER add constraint fkemp foreign key("EMPID") references "EMPLOYEE"("EMPID"); alter table SCHEDULE add constraint fkemp2 foreign key("EMPID") references "EMPLOYEE"("EMPID"); alter table PRODUCT add constraint ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
I was struggling with this subject, and this helped me a ton!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4