Home » SQL & PL/SQL » SQL & PL/SQL » request for solution
request for solution [message #635262] |
Wed, 25 March 2015 12:22 |
|
pramodnawle
Messages: 1 Registered: March 2015 Location: Alwar
|
Junior Member |
|
|
i m getting the prblem in the file you are request to solve m problem
create table direct
(
Dir_Id varchar2(15) constraint Dir_idchk check(dir_id like 'D___') primary key,
Dir_Fname varchar2(15) constraint dirfnmchk not null,
Dir_Lname varchar2(15) constraint dirlnmchk not null,
Dir_City varchar2(15) constraint Dir_Citychk check (Dir_City in('Mumbai','Channai')) not null
)
/
create table Studiod
(
S_Id varchar2(5) constraint S_Idchk primary key check(S_Id like 'S___'),
S_Name varchar2(15) constraint snmchk not null,
S_City varchar2(15) constraint S_Citychk check(S_City in('Mumbai','Channai')) not null
)
/
create table Movie
(
M_Id varchar2(5) constraint M_Idchk primary key check(M_Id like 'M___'),
M_Title varchar2(15) constraint mtitlechk not null,
M_Cost varchar2(15) constraint mcostchk not null,
Category varchar2(15)constraint Categorychk check(Category in
('Action','Drama','Suspense','Thriller'))not null,
Dir_Id varchar2(5)constraint Dir_Idfkchk references direct(Dir_Id)on delete cascade not null,
S_Tid varchar2(5) constraint S_Tidfk references Studiod(S_Id)on delete cascade not null
)
/
create table Theatre
(
T_Id varchar2(5) constraint T_Idchk primary key check (T_Id like 'T___') ,
T_Name varchar2(15) constraint tnmchk not null,
T_Addr varchar2(15) constraint taddress not null
)
/
create table Sale
(
T_id varchar2(15) constraint tidchkfl refereneces Theatre(T_Id) on delete cascade not null,
M_Id varchar2(15) constraint midchkfk references Movie (M_Id) on delete cascade not null,
Collection number (10,2) not null
)
/
insert into direct values('D001','LALIT','NAWLE','Mumbai');
insert into direct values('D002','ARUN','NAWLE','Channai');
insert into direct values('D003','DEVESH','NAWLE','Mumbai');
insert into direct values('D004','SHELENDRA','CHOUKSE','Channai');
insert into direct values('D005','BHUPENDRA SINGH','CHOUHAN','Channai');
insert into direct values('D006','RADHESHYAM','VERMA','Channai');
insert into direct values('D009','TANVEER','JAIN','Channai');
insert into direct values ('D010','RITIKA','YADAV','Channai');
insert into direct values('D011','MONIKA','SETHI','Channai');
insert into studiod (S_Id,S_Name,S_City) values('S001','APOLO','Mumbai');
insert into studiod (S_Id,S_Name,S_City) values('S002','RK','Mumbai');
insert into studiod (S_Id,S_Name,S_City) values('S003','VEENA','Mumbai');
insert into studiod (S_Id,S_Name,S_City) values('S004','RAJ','Mumbai');
insert into movie values('M001','GANESH',100,'Action','D001','S001');
insert into movie values('M002','RADHA KRISHNA',300,'Drama','D002','S002');
insert into movie values('M003','MOHAN LAL ',200,'Action','D003','S003');
insert into movie values('M004','ABHISHEK',500,'Drama','D004','S004');
insert into Theatre values ( 'T001','ANOOP','Mumbai'),
insert into Theatre values (' T002', 'YASHWANT','Channai'),
insert into Theatre values (' T003','PVR','Mumbai'),
insert into Theatre values (' T004','BIG BAZAR','Channai'),
insert into Theatre values (' T005', Bambino', 'Mumbai'),
insert into Sale values ('T001','M001',300);
insert into Sale values ('T002','M002',500);
insert into Sale values ('T003','M003',1000);
insert into Sale values ('T004','M004',500);
select * from direct;
select * from studiod;
select * from movie;
select * from Theatre;
select * from Sale;
|
|
|
|
|
Re: request for solution [message #635271 is a reply to message #635264] |
Wed, 25 March 2015 14:22 |
|
Littlefoot
Messages: 21807 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
OK, there are some errors (mostly typos), nothing serious. I fixed them all in a matter of 2-3 iterations. If that's what you call a "problem", you should do the same - run the script, pay attention to messages Oracle returns, fix the errors and that should do it. (There are some constraint violations while inserting values, but that's either expected, or you didn't set constraints correctly - I can't decide).
On the other hand, if that is not a problem, what is it, then?
|
|
|
Goto Forum:
Current Time: Sat Apr 20 09:07:04 CDT 2024
|