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
102k views
in Computer by (72.1k points)

Answer the questions (a) and (b) on the basis of the following tables SHOP and ACCESSORIES.

(a) Write the SQL queries:

1. To display Name and Price of all the Accessories in ascending order of their Price.

2. To display Id and SName of all Shop located in Nehru Place.

3. To display Minimum and Maximum Price of each Name of Accessories.

4. To display Name, Price of all Accessories and their respective SName where they are available.

(b) Write the output of the following SQL

1. SELECT DISTINCT NAME FROM ACCESSORIES WHERE PRICE> =5000;

2. SELECT AREA, COUNT(*) FROM SHOPPE GROUP BY AREA;

3. SELECT COUNT (DISTINCT AREA) FROM SHOPPE;

4. SELECT NAME, PRICE*0.05 DISCOUNT FROM ACCESSORIES WHERE SNO IN (‘S02‘,S03‘);

1 Answer

0 votes
by (89.4k points)
selected by
 
Best answer

(a)

1. SELECT Name, Price FROM ACCESSORIES ORDER BY Price Asc;

2. SELECT ID SName FROM SHOP WHERE Area=”Nehru Place”;

3. SELECT Name, max (Price); min(Price) FROM ACCESSORIES, Group By Name;

4. SELECT Name,price, Sname FROM 

ACCESSORIES, SHOP WHERE SHOE 

ID=ACCESSORIES.ID;

(b)

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

...