LIVE Course for free

Rated by 1 million+ students
Get app now
JEE MAIN 2023
JEE MAIN 2023 TEST SERIES
NEET 2023 TEST SERIES
NEET 2023
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
9.7k views
in Computer by (47.7k points)
closed by

Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables.

                    DVD

DECODE DTITLE DTYPE
F101 Henry Martin Folk
C102 Dhrupad Classical
C101 The planets Classical
F102 Universal Soldier Folk
R102 A day in life Rock

                    MEMMBER

MID NAME DCODE ISSUEDATE
101 AGAM SINGH R102 2017 - 11-30
103 ARTH JOSEPH F102 2016-12-13
102 NISHA HANS C101 2017-07-24

(i) To display all details from the table MEMBER in descending order of ISSUEDATE. 

(ii) To display the DCODE and DTITLE of all Folk Type DVDs from the table DVD. 

(iii) To display the DTYPE and number of DVDs in each DTYPE from the table DVD. 

(iv) To display all NAME and ISSUEDATE of those members from the table MEMBER who have DVDs issued (i.e., ISSUEDATE) in the year 2017.

(v) SELECT MIN (ISSUEDATE) FROM MEMBER;

(vi) SELECT DISTINCT DTYPE FROM DVD; 

(vii) SELECT D.DCODE, NAME, DTITLE FROM DVD D, MEMBER M WHERE D. DC0DE=M.DCODE;

(viii) SELECT DTITLE FROM DVD WHERE DTYPE NOT IN ("Folk", "Classical");

1 Answer

+1 vote
by (52.5k points)
selected by
 
Best answer

(i) SELECT * FROM MEMBER ORDER BY ISSUEDATE DESC;

(ii) SELECT DCODE. DTITLE FROM DVD WHERE DTYPE = "Folk";

(iii) SELECT DTYPE, COUNT (*) FROM DVD GROUP BY DTYPE;

(iv) SELECT NAME, ISSUEDATE FROM MEMBER WHERE ISSUEDATE LIKE '2017%';

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...