Professional Documents
Culture Documents
DBMS Lab 4
DBMS Lab 4
N.SWETHA
21PA18
Table Weather
CREATE TABLE Weather(
City char(15) primary key,
Temperature number(2),
Humidity number(2),
Condition char(20),
Country char(20)
);
insert into Weather values('Washington','22','67','rainy','US');
insert into Weather values('Sydney','20','45','fog','Australia');
insert into Weather values('Dhaka','38','88','sunny','Iran');
insert into Weather values('Paris','36','85','sunny','Germany');
insert into Weather values('London','27','55','fog','UK');
insert into Weather values('Canada',35,82,'rainy','US');
insert into Weather values('Vitenam','22','42','fog','Italy');
insert into Weather values('Mascow','28','50','rainy','Russia');
insert into Weather values('Delhi','39','89','sunny','India');
insert into Weather values('Tokyo','45','76','sunny','Japan');
insert into Weather values('Manchester',31,79,'fog','UK');
insert into Weather values('Bern','12','30','fog','Switzerland');
insert into Weather values('Kerala','24','52','rainy','India');
select * from Weather;
TEMPERATUR
CITY E HUMIDITY CONDITION COUNTRY
Washington 22 67 rainy US
Sydney 20 45 fog Australia
Dhaka 38 88 sunny Iran
Paris 36 85 sunny Germany
London 27 55 fog UK
Canada 35 82 rainy US
Vitenam 22 42 fog Italy
Mascow 28 50 rainy Russia
Delhi 39 89 sunny India
Tokyo 45 76 sunny Japan
Manchester 31 79 fog UK
Bern 12 30 fog Switzerland
COUNTRY
Iran
Japan
Switzerland
Australia
Germany
Russia
UK
Italy
India
CONDITION
sunny
rainy
fog
Washington
Sydney
London
Vitenam
Mascow
Manchester
Bern
Kerala
QUERY:
COUNTRY
US
US
Russia
India
6. List the cities where the climate condition is sunny.
QUERY:
select City from Weather where Condition='sunny';
Output:
CITY
Dhaka
Paris
Delhi
Tokyo
QUERY:
Output:
COUNTRY CITY
Australia Sydney
UK London
Italy Vitenam
UK Manchester
Switzerland Bern
Output:
Delhi 89 sunny
Kerala 52 rainy
QUERY:
Output:
CITY
Dhaka
Paris
Canada
Delhi
Manchester
11. List the cities which have city name start with “I”.
QUERY:
select City from Weather where City LIKE 'I%';
Output:
no data found
Output:
CITY
Paris
Output:
CITY
Manchester
COUNTRY CONDITION
Australia fog
Italy fog
Switzerland fog