You are on page 1of 2

drop table student_details;

create table student_details


(id number,
first_name varchar2(100),
last_name varchar2(100),
age number,
subject varchar2(100),
games varchar2(100));
insert
;
insert
);
insert
t');
insert
;
insert
);

into student_details values (100,'Rahul','Sharma',10,'Science','Cricket')


into student_details values (101,'Anjali','Bhagwat',12,'Maths','Football'
into student_details values (102,'Stephen','Fleming',09,'Science','Cricke
into student_details values (103,'Shekar','Gowda',18,'Maths','Badminton')
into student_details values (104,'Priya','Chandra',15,'Economics','Chess'

inset into student_details (id,first_name,last_name) values (1,'test','testname'


);
Commit;
drop table employee;
CREATE TABLE employee
( id number(5),
name char(20),
dept char(30),
age number(2),
salary number(10),
location char(10)
);
insert
insert
insert
insert
insert

into
into
into
into
into

employee
employee
employee
employee
employee

values
values
values
values
values

(100,'Ramesh','Electrical',24,25000,'Bangalore');
(101,'Hritik','Electronics',28,35000,'Bangalore');
(102,'Harsha','Aeronautics',28,35000,'Mysore');
(103,'Soumya','Electronics',22,20000,'Bangalore');
(104,'Priya','Infotech',25,30000,'Mangalore');

Commit;
drop table order_items;
drop table product;
CREATE TABLE product
( product_id number(5) CONSTRAINT pd_id_pk PRIMARY KEY,
product_name char(20),
supplier_name char(20),
unit_price number(10)
);
insert into product values (100,'Camera','Nikon',300);
insert into product values (101,'Television','Onida',100);
insert into product values (102,'Refrigerator','Videocon',150);

insert into product values (103,'Ipod','Apple',75);


insert into product values (104,'Mobile','Nokia',50);
commit;
CREATE TABLE order_items
( order_id number(5) CONSTRAINT od_id_pk PRIMARY KEY,
product_id number(5) CONSTRAINT pd_id_fk REFERENCES product(product_id),
total_units number,
customer varchar2(30)
);
insert
insert
insert
insert
Commit;

into
into
into
into

order_items
order_items
order_items
order_items

values
values
values
values

(5100,104,30,'Infosys');
(5101,102,5,'Satyam');
(5102,103,25,'Wipro');
(5103,101,10,'TCS');

You might also like