# MCQs for Informatics Practices Class 12 with Answers Querying and SQL Functions

Students of class 12 Informatics Practices should refer to MCQ Questions Class 12 Informatics Practices Querying and SQL Functions with answers provided here which is an important chapter in Class 12 Informatics Practices NCERT textbook. These MCQ for Class 12 Informatics Practices with Answers have been prepared based on the latest CBSE and NCERT syllabus and examination guidelines for Class 12 Informatics Practices. The following MCQs can help you to practice and get better marks in the upcoming class 12 Informatics Practices examination

## Chapter Querying and SQL Functions MCQ with Answers Class 12 Informatics Practices

MCQ Questions Class 12 Informatics Practices Querying and SQL Functions provided below have been prepared by expert teachers of grade 12. These objective questions with solutions are expected to come in the upcoming Standard 12 examinations. Learn the below provided MCQ questions to get better marks in examinations.

Question: An aggregate function:
a) Takes a column name as its arguments
b) May take an expression as its argument
c) Both (a) and (b)
d) None of (a) and (b)

C

Question: Which of the following are correct aggregate functions in SQL
(a) AVERAGE()
(b) MAX()
(c) COUNT()
(d) TOTAL()

b)And c)

Question: All aggregate functions ignore NULLs except for the __________ function.
(a) Distinct
(b) Count(*)
(c) Average()
(d)None of these

A

Question: Identify the correct INSERT queries from the following :
(a) INSERT INTO Persons(‘xxx1’, ‘yyy1’);
(b) INSERT INTO Persons(LastName, FirstName) Values (‘xxx’, ‘yyy’);
(c) INSERT INTO Persons Values(‘xxx1’ , ‘yyy1’);
(d) INSERT INTO Persons Value(‘xxx1’ , ‘yyy1’);

b)And c)

Question: What is the meaning of “HAVING” clause in SELECT query.
(a) To filter out the summary groups.
(b) To filter out the column groups.
(c) To filter out the row and column values.
(d) None of the mentioned.

A

Question: Aggregate functions can be used in the select list or the ____ clause of the select statement.
They cannot be used in a _______ clause.
(a) Where, having
(b) Having, where
(c) Group by, having
(d) Group by where

C

Question: What will be returned by the given query ?
SELECT INSTR(‘INDIA’, ‘DI’);
(a) 2
(b) 3
(c) -2
(d) -3

B

Question: Which of the following is not a text function?
(a) TRIM ()
(b) TRUNCATE()
(c) LEFT()
(d) MID ()

B

Question: What will be returned by the given query?
SELECT month(‘2020-05-11’);
(a) 5
(b) 11
(c) May
(d) November

A

Question: What will be returned by the given query ?
SELECT ROUND(153.669,2);
(a) 153.6
(b) 153.66
(c) 153.67
(d) 153.7

C

Question: Which of the following will give the same answer irrespective of the NULL values in the specified column:
a) MIN()
b) MAX()
c) SUM()
d) None of the above

C

Question. The correct output of mysql>SELECT TRIM(LEADING ‘&’ FROM ‘&&& India &&& ‘);
a) India &&
b) India &&&
c) && India
d) &&& India

B

Question: HAVING is used in conjunction with
a) WHERE
b) GROUP BY clause
c) Aggregate functions
d) None of the above

B

Question. What will be returned by the given query ? SELECT INSTR(‘INDIA’, ‘DI’);
a) 2
b) 3
c) −2
d) −3

B

Question. Which of the following is the correct syntax of LCASE( ) function?
a) LCASE(row_name)
b) LCE(column_name)
c) LCASE(str/column_name)
d) None of the above

C

Question. What is the significance of the statement “HAVING COUNT (emp_id)>2” in the following MySQL statement? SELECT name, COUNT (emp_id),emp_no FROM department GROUP BY name HAVING COUNT (emp_id)>2;
a) Filter out all rows whose total emp_id below 2
b) Selecting those rows whose total emp_id>2
c) Both a) and b)
d) None of the mentioned

C

Question. What will be the order of sorting in the following MySQL statement? SELECT emp_id, emp_name FROM person ORDER BY emp_id, emp_name;
a) Sorting {emp_id, emp_name}
b) Sorting {emp_name, emp_id}
c) Sorting {emp_id} but not emp_name
d) None of the mentioned

A

Question: JOIN in RDBMS refers to
a) Combination of multiple columns
b) Combination of multiple rows
c) Combination of multiple tables
d) Combination of multiple databases

C

Question: Referential integrity
a) Must be maintained
b) Cannot be maintained
c) Is automatically maintained by databases
d) Should not be maintained

A

Question. In which function, NULL values are excluded from the result returned?
a) SUM()
b) MAX()
c) MIN()
d) All of these

D

Question. Find odd one out?
a) GROUP BY
b) DESC
c) ASC
d) ORDER BY

A

Question. Which of the following function returns an integer that indicates the position of the first occurrence of the sub-string within the string?
a) INSTR( )
b) RTRIM( )
c) LENGTH( )
d) TRIM( )

A

Question: Equi-join is formed by equating
a) Foreign key with Primary key
b) Each row with all other rows
c) Primary key with Primary key
d) Two tables

A

Question: In the FROM clause of a SELECT statement
a) Multiple Column Names are specified.
b) Multiple table names are specified
c) Multiple Column Names may be specified.
d) Multiple table names may be specified.

A

Question. Which aggregate function returns the count of all rows in a specified table?
a) SUM()
b) DISTINCT()
c) COUNT()
d) None of these

C

Question. Which of the following is not an aggregate function?
a) AVG()
c) MAX()
d) COUNT()

B

Question. Which of the following function converts the characters of an argument string to the uppercase   characters ?
a) UCASE( )
b) UPPER( )
c) Both (a) and (b)
d) None of the above

C

Question: Primary Key of a table can be
a) Defined at the time of table creation only.
b) Defined after table creation only.
c) Can be changed after table creation
d) Cannot be changed after table creation

A

Question. What is the significance of “ORDER BY” in the following MySQL statement? SELECT emp_id, fname, lname FROM person ORDER BY emp_id;
a) Data of emp_id will be sorted
b) Data of emp_id will be sorted in descending order
c) Data of emp_id will be sorted in ascending order
d) All of the mentioned

C

Question. Which clause is used with an “aggregate functions”?
a) GROUP BY
b) SELECT
c) WHERE
d) Both (a) and (c)

A

Question: A Primary key column
a) Can have NULL values
b) Can have duplicate values
c) Both (a) and (b)
d) Neither (a) nor (b)

D

Question. What is the significance of the statement “GROUP BY d.name” in the following MySQL statement? SELECT name, COUNT (emp_id), emp_no FROM department GROUP BY name;
a) Counting of the field “name” on the table “department”
b) Aggregation of the field “name” of table “department”
c) Sorting of the field “name”
d) None of the mentioned

B

Question. Which clause is similar to “HAVING” clause in MySQL?
a) SELECT
b) WHERE
c) FROM
d) None of the mentioned

B

Question: Two SELECT commands in a UNION
a) Should select same number of columns.
b) Should have different number of columns
c) Both (a) and (b)
d) Neither (a) nor (b)