please help me answer a,b and c Assignment #1 DUE: September 6, 2018 Write schem
ID: 3742606 • Letter: P
Question
please help me answer a,b and c
Assignment #1 DUE: September 6, 2018 Write schemas for the following relations. (10 points each) Table Name: PRODUCT 001278-4B Foreign Key: VEND_CODE S 1. a) PROD_DESCRIPT PROD PRICE PROD ON HAND VEND CODE 232 235 12.95 23 Claw hammer Primary Key: PROD CODE 123-21UUY Houselite chain saw, 16-n. bar 189.s9 18.63 QER-34256 Sledge hammer, 16-lb, head SRE-657UG Rat-tail file ZZX/3245Q Steel tape, 12-ft. length 2.99 6.79 232 235 b) VEND_CODE VEND_CONTACT VEND_AREACODE VEND PHONE Table Name: VENDOR Primary Key: VEND_CODE Foreign Key: None 230 Shelly K. Smithson 608 231 James Johnson 615 232 Annelise Crystall 608 555-1234 123-4536 224-2134 c) CLASS_CODE STU NUM ENROLL_GRADE 10014 10014 Primary Key: CLASS_CODE+ STU_NUM 10018 Foreign Key: CLASS_CODE, STU_NUM 10018 321452 C 324257 B 321452 A 324257 B 321452 C 324257 C Table Name: CLASSs 10021 10021 2. Use the INVENTORY table to write SQL statements for the following queries. Make sure to get after executing each of the queryExplanation / Answer
a)
CREATE TABLE PRODUCT (PROD_CODE varchar(10),PROD_DESCRIPT varchar(30),PROD_PRICE decimal(5,2), PROD_ON_HAND int, VEN_CODE int
PRIMARY KEY (PROD_CODE),
FOREIGN KEY (VEN_CODE) REFERENCES VENDOR(VEN_CODE));
b)
CREATE TABLE VENDOR(VEN_CODE int, VEND_CONTACT varchar(20), VEND_AREACODE int, VEND_PHONE char(8), PRIMARY KEY (VEND_CODE));
c)
CREATE TABLE CLASS (
CLASS_COSE int , STD_NUM int , ENROLL_GRADE char(1),
PRIMARY KEY (CLASS_CODE , STU_NUM),FOREIGN KEY(CLASS_CODE,STU_NUM) REFERENCES REF_TABLE_NAME(CLASS_CODE,STU_NUM)
);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.