CS 60 

Database Concepts Code Segments

 

College Level Homework Assignments CS 15 Code  CS 17 Code CS 60 Code Discussion
Inputs
Final Schedule Email to Instructor  Student Sign-up Form

Table of Contents

1. Oracle tables by Ashoo Jain

2. Oracle Guide

3. Oracle Links

1. Oracle tables by Ashoo Jain

Drop table Product;
Drop table Vendor;



Create Table Vendor(
V_Code integer Not Null  Unique,
V_Name Varchar(35) Not Null,
V_Contact Varchar(15) Not Null,
V_Areacode Char(3) Not Null,
V_Phone Char(8) Not Null,
V_State Char(2) Not Null,
V_Order Char(1) Not Null,
Constraint Pk_Vendor Primary Key (V_Code));



Create table Product (
P_Code Varchar(10) Not Null  Unique,
P_Description Varchar(35) Not Null,
P_Indate Date Not Null,
P_Onhand Smallint Not Null,
P_Min Smallint Not Null,
P_Price Number(8,2) Not Null,
P_Discont Number(5,2) Not Null,
V_Code integer,
Constraint Pk_Product Primary Key (P_Code),
Constraint Fk_Product_Vendor Foreign Key (V_Code)
references Vendor(V_Code));



We give names to the constraints as we can use these names to drop
them if we have to.



This line of code in product table I could not get to work.
I'll keep on trying and see if I get somewhere..
 
on delete restrict
on update cascade