0% found this document useful (0 votes)
2 views9 pages

CS Mysql

Uploaded by

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

CS Mysql

Uploaded by

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

1

a) select * from movie;

b)select distinct from a movie;

C) select movieid, moviename, productioncost + businesscost "total earning" from movie;

D) select movie_id,moviename, productioncost from movie where producst is >150000 and

<1000000;
E) select moviename from movie where type ='action' or type='romance';

F) select moviename from movie where month(releasedate)=2;

2.
A) select sum(charges) from patient where dateofadm like '%-11-%';

B) select pname,max(age) from patient;


C) Select count(distinct department) from patient;
a)

D) Select avg(charges) from patient;

3.
A) create database sports;

b)

B) Creating table with the given specification create table team (teamid int(1), teamname
varchar(10), primary key(teamid));
C) mqsql> insert into team values(1,'Tehlka');

D) select * from team


E) create table match_details ->
(matchid varchar(2) primary key,
-> matchdate date,
-> firstteamid int(1) references team(teamid),
-> secondteamid int(1) references team(teamid),
-> firstteamscore int(3),

a) -> secondteamscore int(3));

21.
select match_details.matchid, match_details.firstteamid,
team.teamname,match_details.firstteamscore from match_details, team where
match_details.firstteamid = team.teamid and match_details.first
B) select match_details.matchid, match_details.firstteamid,
team.teamname,match_details.firstteamscore from match_details, team where
match_details.firstteamid = team.teamid and match_details.firstteamscore>70;

a) C) select matchid, teamname, firstteamid, secondteamid, matchdate from match_details,


team where match_details.firstteamid = team.teamid;
D) select distinct(teamname) from match_details, team where match_details.firstteamid =
team.teamid;

E) select matchid,matchdate from match_details, team where match_details.firstteamid


= team.teamid and team.teamname in ('Aandhi','Shailab');

22.
A)SELECT * from stock order by stockdate;
b) select dcode,max(unitprice) from stock group by code;

c) select * from stock order by item desc;

d) select dcode,avg(unitprice) from stock group by


dcode having avg(unitprice)>5;

e) select dcode,sum(qty) from stock group by


dcode;
f)

You might also like