Grade XII Informatics Practices PA1
Grade XII Informatics Practices PA1
General Instructions:
1. This question paper contains four sections 16 questions, Section A to D.
2. All questions are compulsory.
3. Section A have 6 questions carrying 01 mark each.
4. Section B has 05 Very Short Answer type questions carrying 02 marks each.
5. Section C has 03 Short Answer type questions carrying 03 marks each.
6. Section D has 02 Long Answer type questions carrying 05 marks each.
7. All programming questions are to be answered using MySQL only.
Section –A 6
Each question carries 1 marks Marks
Q Question
NO
1 You have a table called "sales" that contains sales data for a retail store. Which 1
SQL aggregate function can be used to calculate the total number of rows or
records in the "sales" table?
a) MAX()
b) MIN()
c) AVG()
d) COUNT()
2 If column ‘Marks’ contains the data set {25,35,25,35,38,40}, what will be the 1
output after the execution of the given query?
SELECT DISTINCT(MARKS) FROM STUDENTS;
a) 25,35,25,35,38,40
b) 25,35,38,40
c) 25,25,35,35,38,40
d) None
Page 1 of 6
3 Which of the following SQL queries is used to retrieve rows from the "customers" 1
table where the "email" column contains NULL values?
a) SELECT * FROM customers WHERE email = NULL;
b) SELECT * FROM customers WHERE email IS NOT NULL;
c) SELECT * FROM customers WHERE ISNULL(email);
d) SELECT * FROM customers WHERE email IS NULL;
4 With SQL, how do you select all the records from a table named ‘Students’ where
the value of the column ‘Firstname’ ends with an ‘a’?
a) SELECT * FROM Students WHERE Firstname=’a’;
b) SELECT * FROM Students WHERE Firstname like’a%’; 1
c) SELECT * FROM Students WHERE Firstname like’%a’;
d) SELECT * FROM Students WHERE Firstname=’%a%’;
Assertion (A): A join is a query that combines rows from two or more tables.
Section –B 10
Each question carries 2 marks Marks
7 Raj is a database programmer, he has to write the query from Employee table to 2
search for the employee whose name begins from letter ‘R’, for this he has write
the query as :
select * from Employee where Name=’R%’;
But the query is not producing the correct output, help Raj and correct the query so
that he gets the desired output.
Page 2 of 6
8 Observe the given table Teacher and give the output of the question (i) and (ii).
2
9 Name two aggregate (group) function of SQL and explain with example. 2
10 Write the output of SQL queries (a) to (d) based on the given table. 2
a) SELECT Name, Age from vaccination_data where Dose2 is not null and
age>40;
b) Select City, Count(*) from vaccination_data group by city;
c) Select Distinct(City) from vaccination_data;
d) Select Max(Dose2), Min(Dose2) from vaccination_data;
11 Consider the following two commands with reference to a table, named Employee 2
having a column named Department:
(a) Select count(Department) from Employee;
(b) Select count(*) from Employee;
If these two commands are producing different results,
(i) What may be the possible reason?
(ii) Which command (a) or (b) might be giving a higher value?
Section –C 9
Each question carries 3 marks Marks
12 How foreign key command is different from Primary Key command? How is 3
Foreign Key commands related to Primary Key?
13 ABC Gym has created a table TRAINER. Observe the table given below and 3
answer the following questions accordingly. (Answer any three)
Page 3 of 6
a. What is Degree and Cardinality of the above table?
b. Which field should be made as the primary key? Justify your answer.
c. Write the query to create the table Trainer.
d. Write the query to increase the salary 10% who is from city ‘Mumbai’
Page 4 of 6
Section –D 10
Each question carries 5 marks Marks
15
Page 5 of 6
16 Consider the following table and answer the questions that follow:
Table : TEACHER
5
Page 6 of 6