User:Bunker001/sandbox

1. create match tabel

Create table Match ( matchid number primary key, Team1 char(50),  Team2 char(50),  Ground char(50),  mdate,  Winner varchar(50) ); desc Match;

2.insert data in match tabel insert into match values(2324,'Pakistan','India','Peshawar','06/feb/2006','Team1'); insert into match values(2327,'Pakistan','India','Rawalpindi','11/feb/2006','Team2'); insert into match values(2357,'India','England','Delhi','28/mar/2006','Team1'); insert into match values(2377,'West Indies','India','Kingston','18/may/2006','Team2'); insert into match values(2404,'Sri Lanka','India','Colombo','16/aug/2006','Abandoned'); insert into match values(2440,'India','Australia','Mohali','29/oct/2006','Team2'); insert into match values(2449,'South Africa','India','Cape Town','26/nov/2006','Team1'); insert into match values(2480,'India','West Indies','Nagpur','21/jan/2007','Team1'); insert into match values(2493,'India','West Indies','Vadodara','31/jan/2007','Team1'); insert into match values(2520,'India','Sri Lanka','Rajkot','11/feb/2007','Team2'); insert into match values(2611,'England','India','Southampton','21/aug/2007','Team1'); insert into match values(2632,'India','Australia','Mumbai','17/oct/2007','Team1'); insert into match values(2643,'India','Pakistan','Guwahati','05/nov/2007','Team1'); insert into match values(2675,'Australia','India','Melbourne','10/feb/2008','Team2'); insert into match values(2681,'India','Sri Lanka','Adclaide','19/feb/2008','Team1'); insert into match values(2688,'Australia','India','Sydney','02/mar/2008','Team2'); insert into match values(2689,'Australia','India','Briabane','04/mar/2008','Team2'); insert into match values(2717,'Pakistan','India','Karachi','26/jun/2008','Team2'); insert into match values(2750,'Sri Lanka','India','Colombo','24/aug/2008','Team2'); insert into match values(2755,'Sri Lanka','India','Colombo','27/aug/2008','Team2');

3. create player table Create table Player ( PID number primary key, Lname char(50),  Fname char(50),  Country char(50),  Yborn number,  ftest varchar(50) ); desc player;

4.create bowling table Create table Bowling ( Matchid number, PlayerID number, primary key(Matchid,PlayerID), foreign key(PlayerID) References Player, foreign key(Matchid) References Match, Nover number, Maidens number , Nruns number,  Nwickets number ); desc player;

5.insert data in player table

insert into Player values (89001,'Tendulkar','Sachin','India',1973,'Mumbai',1989

); insert into Player values (90001,'Lara','Brain','West Indies',1969,'Santa Cruz',1990

); insert into Player values (95001,'Ponting','Ricky','Australia',1974,'Launceston',1995

); insert into Player values (96001,'Dravid','Rahul','India',1973,'indore',1996

); insert into Player values (96002,'Gibbs','Herschelle','South Africa',1974,'Cape Town',1996

); insert into Player values (92001,'Warne','Shane','Australia',1969,'Melbourn',1992

); insert into Player values (95002,'Pollock','Shaun','South Africa',1973,'Port Elizabeth',1995

); insert into Player values (99003,'Vaughan','Michel','England',1974,'Manchester',1999

); insert into Player values (92003,'Ul-Hug','Inzamam','pakistan',1970,'Multan',1992

); insert into Player values (94004,'Fleming','Stephen','Nwe Zealand',1973,'Christchurch',1994

); insert into Player values (93002,'Streak','Heath','Zimbabe',1974,'Bulawayo',1993

); insert into Player values (90002,'Kumble','Anil','India',1970,'Bangalore',1990

); insert into Player values (93003,'Kirsten','Gary','South Africa',1967,'Cape Town',1993

); insert into Player values (95003,'Kallis','jacques','South Africa',1975,'cape town',1995

); insert into Player values (94002,'Vaas','Chaminda','Sri lanka',1974,'Mattumagala',1994

); insert into Player values (92002,'Muralitharan','Muthiah','Sri lanka',1972,'kandy',1992

); insert into Player values (97004,'Vettori','Daniel','New Zealand',1979,'Auckland',1997

); insert into Player values (25001,'Dhoni','MS','India',1981,'ranchi',2005

); insert into Player values (23001,'Singh',' Yuvraj','India',1981,'Chandigarh',2003

); insert into Player values (96003,'Gangualy','Saurav','India',1972,'Calcutta',1996

); insert into Player values (99002,'Gilchrist','Adam','Asutralia',1971,'Bellingen',1999

); insert into Player values (24001,'Symonds','Anderew','Australia',1975,'Bellingen',2004

); insert into Player values (99001,'Lee','Brett','Australia',1976,'wollongong',1999

); insert into Player values (91001,'Jayasuriya','sanath','Sri lanka',1996,'Matara',1991

); insert into Player values (21001,'Sehwag','Virender','india',1978,'Delhi',2001

); insert into Player values (98001,'Afridi','Shahid','Pakistan',1980,'khyber Agency',1998

); insert into Player values (98002,'Singh','Harbhajan','indai',1980,'jalandhar',1998 ); insert into Player values (27001,'kumar','Praveen','India',1986,'Meerut',Null

); insert into Player values (27002,'Sharma','Ishant','Indai',1988,'Delhi',2007

);

select *from Player; desc Player;

6.insert the bowlig data table

insert into bowling values(2689,99001,10,0,58,1); insert into bowling values(2689,24001,3,0,27,1); insert into bowling values(2689,23001,3,0,15,0); insert into bowling values(2755,94002,9,1,40,1); insert into bowling values(2755,92002,10,0,56,1); insert into bowling values(2755,91001,4,0,29,0); insert into bowling values(2755,23001,10,0,53,2); insert into bowling values(2755,98002,10,0,40,3); insert into bowling values(2689,98002,10,0,44,1);

select *from bowling; desc Player;

oracle quree

1. save point a;-> save point is used for retrive data. 2.roll back; -> restore the data where save point is applied. 3.rollback a; -> restore the data where rollback is specify. 4.select colummn list from table list where condition (option) 5.order by -> it is describe the order of schema. Ex.       select ground from match where team = 'india' order by ground(desending) //by default accending.

6. where ->condition use. where C1 AND C2     or    Not c1 AND c2

7.where ground like