0% found this document useful (0 votes)
17 views

Dbms

Uploaded by

nitesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Dbms

Uploaded by

nitesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

create table for product:-

create table product

(mfrid number(4),

productid number(4),

pname varchar2(20),

price number(10,3),

qtyavail integer,

constraint pk1 primary key(mfrid,productid));

create table for offices:-

create table offices

(officeid number(4) primary key,

region varchar2(10),

city varchar2(20),

mgr number(4),

sales number(10,2),

quota number(10,2));

create table salesrep

(empid number(4) primary key,

empname varchar2(20),

doj date,

dob date,
manager number(4),

rep_office number(4),

sales number(10,5),

target number(10,5),);

create table customer

(custid number(4) primary key,

custname varchar2(20),
city varchar2(20),

region varchar2(10),

credit_limit number(10,5),

cust_rep number(4),

constraint fk4 foreign key(cust_rep) references salesrep


);

create table orders

(orderid number(4) primary key,

orderdate date,

mfr number(4),

product number(4),
rep number(4),
cust number(4),

qty integer,

amount number(10,5),

constraint fk7 foreign key(mfr,product) references product,


constraint fk5 foreign key(rep) references salesrep,

constraint fk6 foreign key(cust) references customer


);

alter table salesrep

add constraint fk2 foreign key(manager) references salesrep

add constraint fk3 foreign key(rep_office) references offices;

alter table offices


add constraint fk1 foreign key(mgr) references salesrep;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy