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

12-IP-CS-MYSQL-TABLES REVISIONS-23-24-ANSKEY

This document contains a board examination paper for Grade XII in Computer Science and Informatics Practices, focusing on MySQL table-based questions. It includes a series of SQL queries with corresponding answer keys and marks allocated for each question. The exam covers various SQL operations such as SELECT, INSERT, UPDATE, and GROUP BY across different datasets like EXAM, DEVICES, and EMPLOYEE.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

12-IP-CS-MYSQL-TABLES REVISIONS-23-24-ANSKEY

This document contains a board examination paper for Grade XII in Computer Science and Informatics Practices, focusing on MySQL table-based questions. It includes a series of SQL queries with corresponding answer keys and marks allocated for each question. The exam covers various SQL operations such as SELECT, INSERT, UPDATE, and GROUP BY across different datasets like EXAM, DEVICES, and EMPLOYEE.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Grade : XII COMPUTER SCIENCE (083)/ INFORMATICS PRACTICES (083) Marks : 70

Time : 3Hrs
Date : BOARD REVISION-1
PORTION : MYSQL Table Based Questions
QNo. Answer Key Mark
1 a) SELECT * FROM EXAM WHERE Stream =’Commerce’ ORDER BY Percentage 6
DESC;
b) SELECT Adno, SName, Percentage FROM EXAM WHERE LENGTH (SName)<6;
c) INSERT INTO EXAM VALUES (1005,’Ananya’,65.5,’12B’,’Commerce’);
d)

2 a) SELECT * FROM DEVICES ORDER BY PRICE DESC; 4


b) SELECT CATEGORY, SUM(QTY) FROM DEVICES GROUP BY CATEGORY;
c) SELECT CATEGORY, AVG(PRICE) FROM DEVICES GROUP BY CATEGORY;
d) SELECT CATEGORY, MAX(PRICE) FROM DEVICES GROUP BY CATEGORY;
3 a) SELECT UPPER(PNAME) FROM STOCK; 4
b) SELECT * FROM STOCK ORDER BY PRICE DESC;
c) SELECT CATEGORY,MAX(PRICE) FROM STOCK GROUP BY CATEGORY;
d) SELECT SUM(QTY) FROM STOCK;
4 a) SELECT GENDER, AVG(SALARY) FROM EMPLOYEE GROUPBY GENDER; 6
b) SELECT DESIGNATION, MAX(SALARY) FROM EMPLOYEE GROUPBY
DESIGNATION;
c) SELECT DEPT,COUNT(*) FROM EMPLOYEE GROUPBY DEPT;
d) LEFT(Name,2)
i. Su
Ne
Ne
ii. AVG(Salary)
21500
iii. SUM(Salary)
32000
5 a. SELECT AGV(PAY )FROM CLUB WHERE SPORTS=’KARATE’; 4
b. SELECT MONTH(DATEOFAPP) FROM CLUB;
c. SELECT * FROM CLUB WHERE SEX=’M’ ORDER BY AGE ASC;
d. SELECT SPORTS, MAX(PAY) FROM CLUB GROUPBY SPORTS;
6 a. SELECT UPPER(Pname) FROM INVENTORY [1 mark] 4
b. SELECT * FROM INVENTORY ORDER BY PRICE DESC
c. SELECT CATEGORY, MAX(PRICE) FROM INVENTORY GROUP BY CATEGORY;
d. SELECT CATEGORY, SUM(Qty) FROM INVENTORY GROUP BY CATEGORY;
1
7 a. 3

b. SELECT SUM(Noofplayers) FROM SPORTS GROUP BY SportName;


c. SELECT SportName FROM SPORTS GROUP BY SportName HAVING
SUM(Noofplayers) > 25;
8 a. SELECT * FROM STUDENT ORDER BY NAME DESC; 5
b. SELECT AVG(FEES), HOBBY FROM STUDENT GROUP BY HOBBY;
c. UPDATE STUDENT SET FEES=FEES+50 WHERE HOBBY=’Cooking’;
d. UPDATE STUDENT SET FEES=100 WHERE FEES IS NULL;
e. SELECT NAME FROM STUDENT WHERE DOB > ‘2004-01-01’;
9 a) SELECT MIN(MARKS), MAX(MARKS) FROM RESULT WHERE GENDER=’F’; 4
b) SELECT DISTINCT(CITY) FROM RESULT;
c) SELECT AVG(MARKS) FROM RESULT GROUP BY CITY;
d) SELECT SUM(MARKS) FROM RESULT GROUP BY CLASS;
10 a) Select sum(Loan_Amount) from LOANS Where Int_Rate>10; 5
b) Select Max(Interest) from LOANS;
c) Select Count(*) from LOANS Where Cust_Name Like ‘%Sharma’;
d) Select * from LOANS Group By Interest Having Instalments>=10;
e) Select Count (*) from LOANS Group By Interest Having instalments>5;
11 a. select company, avg(Price) from toys group by company having Qty>15; 4
b. select Company, count(distinct name) from toys group by Company;
c. Select name, sum(Price* Qty) from toys;
d. select * from Toys where Name=’car’
12 Select avg(price) from Product group by Ptype having qty>30; 4
Update Product set price=Price+(Price*2/100) where P_Manufacturer='Doms';
Select Max(Price), Min(Price) from Product group by Ptype;
Select * from product where ptype=’pencil’ and qty>20;
13 select avg(price) from vehicles group by type having qty>20; 4
select count(type) from vehicles group by company;
select sum(price) from vehicles group by type;
Select * from vehicles order by qty;
14 UPDATE Spice SET price=price+100 WHERE Spice_Name='Turmeric'; 4
SELECT Spice_Name,Spice_Price,Spice_Manufacturer FROM Spice ORDER BY
Spice_Price desc;
INSERT INTO Spice VALUES('SP1006','Cardamom',1450.00,4,'TATA');
Only (ii)

2
15 UPDATE PharmaDB SET price= price+50 WHERE DrugName=‚Amlodipine‛; 4
SELECT DrugID, DrugName, PharmacyName FROM PharmaDB ORDER BY Price DESC;
ALTER TABLE PharmaDB DROP PharmacyLocation;
Only (i)
16 UPDATE PharmaDB SET price= price+50 WHERE DrugName=‚Amlodipine‛; 5
SELECT DrugID, DrugName, PharmacyName FROM PharmaDB ORDER BY Price DESC;
ALTER TABLE PharmaDB DROP PharmacyLocation;
Only (i)
select upper(DrugName),round(Price,0)from PharmaDB;
*********

You might also like