Set A
Set A
GRADE-XII
INFORMATICS PRACTICES(065) SET-A
CUMULATIVE EXAMINATION-II
DURATION: 3 HRS ANSWER KEY MAX.MARKS:70
PART-A (10X1=10)
1 Distinct
2 Aggregate
3 Ascending
4 Having
5 25,35,38
6 There may be a NULL value.
7 Structured query language, used to create, manage, manipulate stored records in a table.
8 Leading space.
9 1
10 Select SCORE,PLAYER_ID from PLAYER Group by SCORE,PLAYER_ID;
PART-B (4X2=8)
1 classXII
2 None of the aggregate functions takes NULL into consideration.NULL is simply ignored by all the
aggregate functions.
3 SELECT Deptcode,MAX(Salary)FROM Employee GROUP BY Deptcode;
4 An aggregate function performs a calculation on one or more values and returns a single value. Some
aggregate functions are AVG(), SUM(), MAX(), MIN(),Count() etc..
PART-C (9X3=27)
1 String and dates are not real numbers that we calculate,so SUM() or AVG() functions are not valid for
them.
2 SELECT Rating,Cus_Name,Cust_Num FROM Customers ORDER BY Rating DESC;
3 This function returns a count of the number of non null values of expr in the row retrived by a SELECT
statement. COUNT() returns 0 if there are no matching rows.
Eg.:SELECT COUNT(Student_name) FROM student;
4 SELECT Category,Salary FROM hotel GROUP BY Category;
5 ROUND(),MOD(),POWER(),TRUNCATE()
6 (i) SELECT ROUND(AMOUNT,1)
(ii) Select round (AMOUNT,0)
7 DAY() function returns the day of the month of a given date.If the date argument is zero,it returns 0.In case,
the date is NULL.This function returns NULL.
SYNTAX: DAY(date)
8 (i) Create database MYORG;
(ii) Use MYORG;
(iii) Select pow(6,3)
9 ALTER TABLE <table name>
DROP <column name>;
PART-D (3X5=15)
1 Select*frpm schoolbus where capacity>noofstudents order by rtno;
Select area_covered from schoolbus where distance>20 and charge<80000;
Select transporter,sum(noofstudents) from schoolbus group by transporter;
Select distinct transporter from schoolbus;
Select rtno from schoolbus where distanc>30;
Select area_covered from schoolbus where area_covered like ‘%r’ order by area_covered DESC;
Select rtno , area_covered , Charges / Noofstudent as Average from SchoolBus ;
select min(noofstudents) from schoolbus;
select count(distinct(area_covered)) from schoolbus order by transporter;
select max(capacity)from schoolbus;
select count(noofstudents)from schoolbus order by transporter;
Insert into SchoolBus values (11, "Motibagh", 35, 32, 10, "kisan tours", 35000) ;
2 Group functions are also known as aggregate function.
COUNT(),MAX(),MIN(),AVG(),SUM()