SQL(1-4)final
SQL(1-4)final
SQL1: Queries to create table, insert data and select rows based on condition
Question:
Consider the following MOVIE table and write the SQL queries based on it.
Movieid Moviename Type Releasedate Productioncost Businesscost
M001 The Kashmir Action 2022/01/26 1245000 1300000
files
M002 Attack Action 2022/01/28 1120000 1250000
M003 Loop Lapeta Thriller 2022/02/01 250000 300000
M004 Badhai Do Drama 2022/02/04 720000 680000
M005 Shabaash Biography 2022/02/04 1000000 800000
Mithu
M006 Gehraiyaan Romance 2022/02/11 150000 120000
Answer:
I. Mysql>Create table movie(movieid char(5),moviename varchar(25),type varchar(20), Releasedate
date, productioncost integer, businesscost integer);
II. Mysql>insert into movie values(“M001”, ”The Kashmir files”, ”Action”, str_to_date(“2022-01-26”,
%Y-%m-%d),1245000,1300000);
III.
IV.
V.
VI.
VII.
VIII.
________________________________________________________________
I.
II.
III.
(OR)
IV.
V.
VI.
_______________________________________________________________
SQL3: Queries using order by, group by clause and aggregate functions
Question:
I.
II.
III.
IV.
V.
________________________________________________________
II.
III.
IV.
V.
________________________________________________________________________________