Class 12 Ip Chapter-1 (Dbms & SQL)
Class 12 Ip Chapter-1 (Dbms & SQL)
3. Which function can be used to get the rounded value of given Knowledge and
number? Understanding
(a) round()
(b) roundnum()
(c) rounding()
(d) getround()
4. The number of minimum arguments in round() function Knowledge and
(a) 0 Understanding
(b) 1
(c) 2
(d) No arguments
5. What is the correct syntax of round function to roundup the Knowledge and
value 3.873 to 3.9? Understanding,
(a) round(3.873,0.1) Applying
(b) round(3.873,-1)
(c) round(3.873)
(d) round(3.873,1)
6. Rajesh wants to find the remainder of 50/6 using MySQL. Knowledge and
Sheetal suggested him a function of MySQL and Rajesh got Understanding,
the proper result as per need. Which function Sheetal has Applying
suggested him?
(a) pow()
(b) remainder()
(c) mod()
(d) find_rem()
7. Which function can be used to convert all letters to capital of Knowledge and
text? Understanding
i. ucase() ii. upper()
(a) Only i
(b) Only ii
(c) Both i, ii
(d) None of the above
8. Mohan has stored his city name in MySQL database in capital Knowledge and
letters. He wants to display his city name but in all small letters. Understanding,
Kishan told him to use lcase() function and Farhana told him to Applying
use lower() function. Who is correct among Kishan and
Farhana to get the desired output of Mohan?
(a) Only Kishan
(b) Only Farhana
(c) Both Kishan and Farhana
(d) None of them are correct
9. Which function can be used to get the partial string of a given Knowledge and
string? Understanding
i. mid() ii. substr() iii. substring()
(a) Only i and ii
(b) Only i and iii
(c) Only ii and iii
(d) Any from i, ii and iii
10. Neeraj wanted to count the number of characters of a given Knowledge and
string. Which function Neeraj has to use? Understanding,
(a) count() Applying
(b) len()
(c) length()
(d) num()
11. Which is not the function to remove spaces from string? Knowledge and
(a) LTRIM() Understanding
(b) RTRIM()
(c) TRIM()
(d) None of these
12. Which function is used to check whether a given string is Knowledge and
containing a word or not? Understanding
(a) instr()
(b) mid()
(c) substr()
(d) substring()
14. What is difference between mid(), substr() and substring() Knowledge and
(a) mid() is numerical while substr() and substring() are Understanding
text functions
(b) mid() accepts min 2 arguments and substr() and
substring() accepts min 3 arguments
(c) mid() and substr() always returns single character
while substring() returns more than one character.
(d) No difference, all are similar.
18. Jack want to remove leading extra spaces from " Hello Analysing, Evaluating and
". He has written the code as following but he forgot which Creating
function to write at the blank space. Complete his code:
SELECT __________(" Hello ");
(a) trim()
(b) ltrim()
(c) rtrim()
(d) left()
54. Which of the following function returns only the day number Remembering and
from month of selected date? Understanding
(A) day(date)
(B) dayno(date)
(C)day_number(date)
(D)date(date)
55. Help Aman to write the command to display the name of the Analysing, Evaluating and
traveller whose travel date is in year 2016. Creating
(A) Select name,tdate from travel where year(tdate)=2016 ;
(B) Select name,tdate from travel where tdate=2016;
(C) Select name,tdate from travel where year(tdate)= =2016;
(D) Select name,max(tdate) from travel
56. You want all dates when any employee was hired. Multiple Analysing, Evaluating and
employees were hired on the same date and you want to see Creating
the date only once.
i. SELECT DISTINCT HIREDATE FROM TEACHERS ORDER
BY HIREDATE;
ii. SELECT HIREDATE FROM TEACHERS GROUP BY
HIREDATE; iii. SELECT HIREDATE GROUP BY
HIREDATE HAVING DISTINCT HIREDATE;
Which of the above query is valid?
(A) Query i
(B) Query ii
(C) Query iii.
(D) All of the above.
57. Which of the following SQL commands may output 21? Analysing, Evaluating and
(A) select day(now()); Creating
(B) select now();
(C) select dayname(now());
(D) select month(now());
58. If on ‘1990-01-22', it was Monday, what will be the output of Analysing, Evaluating and
following SQL command? select dayname('1990-01-22')+1; Creating
(A) Error
(B) 1
(C) 7
(D) Monday
59. Identify the correct output from the following for given SQL Applying
statement:
Select CURDATE+10;
(A) 2021-10-14
(B) 2021 10 14
(C) 2021/10/14
(D) None of these
60. Identify the correct output from the following for given SQL Applying
statement:
Select DATE(‘2021-10-04 01:02:03’);
(A) 2021-10-04 01:02:03
(B) 01:02:03
(C) 2021-10-04
(D) None of these
61. The correct return value data type for date function YEAR() is: Analysing, Evaluating and
(A) integer Creating
(B) string
(C) float
(D) None of the above
62. Which of the following function is used to FIND the largest
value from the given data in MYSQL?
(a) MAX() (b) MAXIMUM() (c) LARGEST() (c) BIG()
63. Aggregate functions can be used in the select list or the _____
clause of a select statement. They cannot be used in a ______
clause.
(a) Where, having(b) Having, where(c) Group by, having (d)
Group by, where
64. Which of the following is a SQL aggregate function?
(a) LEFT() (b) AVG() (c) JOIN() (d) LEN()
65. Find out the odd one out.
(a) LEN() (b) SUM() (c) AVG() (d) MAX()
66. Which of the following function returns sum value of the given
column?
(a) TOTAL() (b) ADD() (C) Both a and b (d) None of the
options
67. Which SQL function is used to count the number of rows in a
SQL query?
(a) COUNT () (b) NUMBER () (c) SUM () (d) COUNT (*)
68. With SQL, how can you return the number of not null record in
the Project field of “Students” table?
(a) SELECT COUNT (Project) FROM Students
(b) SELECT COLUMNS (Project) FROM Students
(c) SELECT COLUMNS (*) FROM Students
(d) SELECT COUNT (*) FROM Students
69. Which of the following is not an aggregate function?
(a) Avg (b) Sum (c) Sub (d) Min
70. If column “Salary” contains the data set {1000, 15000, 25000,
10000, 15000}, what will be the output after the execution of
the given query?
SELECT SUM(DISTINCT SALARY) FROM EMPLOYEE;
(a)75000 (b) 25000 (c) 10000 (d) 50000
71. Which of the following group functions ignore NULL values?
(a) MAX (b) COUNT (c) SUM (d) All of the above
72. To compare an aggregate value in a condition, _______ clause
is used.
(a) where (b) having (c) Group by (d) both a and b
73. All aggregate functions ignore NULLs except for the
__________ function.
(a) Sum() (b) Count(*) (c) Avg() (d) None of these
74. Only Aggregate functions are used with __________ clause.
(a) Group by (b) Having (c) Where (d) Both a and b
75. The SQL built-in function ____ obtains the smallest value in a
in numeric columns.
(a) MINIMUM (b) SMALLEST() (C) MIN() (D) None of the
options
76. The SQL built-in function __________ computes the number of
rows in a table.
(a) count(*) (b) count(Column name) (c) sum(column) (d) both
a and b
77. The SQL built-in function ____ computes the average of values
in numeric columns.
(a) AVG() (b) AVERAGE() (c) Avg() (d) both a and c
78. Aggregate Functions cannot be used in __________clause of
the Select query.
(a) where (b) having (c) Group by (d) both a and b
79. If column “Age” contains the data set {30, 20, 10, NULL}, what
will be the output after the execution of the given query?
SELECT AVG(Age) FROM EMPLOYEE;
(a)20 (b) 15 (c) Error (d) 0
80. If column “Age” contains the data set {30, 20, 10, NULL}, what
will be the output after the execution of the given query?
SELECT SUM(Age) FROM EMPLOYEE;
(a)0 (b) 50NULL (c) Error (d) 60
81. If column “Age” contains the data set {30, 20, 10, NULL}, what
will be the output after the execution of the given query?
SELECT MIN(Age) FROM EMPLOYEE;
(a)0 (b) NULL (c) 10 (d) Error
82. Which of the following is not a built in aggregate function in KNOWLEDGE
SQL?
a. AVG()
b. MAX()
c. TOTAL()
d. COUNT()
83. The ____________ aggregation operation adds up all the KNOWLEDGE
values of the attribute.
a. ADD()
b. AVG()
c. MAX()
d. SUM()
84. What values does the COUNT(*) function ignore? KNOWLEDGE
a. Repeatative Values
b. NULL Values
c. Characters
d. Integers
85. Which keyword is used to rename the resulting attribute after KNOWLEDGE
the application of the aggregation function?
a. RENAME
b. AS
c. REPLACE
d. TO
86. Which if the following is not an Aggregate Function? KNOWLEDGE
a. WITH()
b. SUM()
c. AVG()
d. MIN()
87. If we wish to eliminate duplicates, we use the keyword KNOWLEDGE
___________ in the aggregate expression.
a. DISTINCT
b. COUNT
c. AVG
d. PRIMARY KEY
88. All aggregate functions except _________________ ignore KNOWLEDGE
NULL values in their input collection.
a. COUNT(attribute)
b. COUNT(*)
c. AVG()
d. SUM()
89. In SQL, the functions, AVG(), MIN(),MAX(), SUM(), COUNT() KNOWLEDGE
are called as ________________.
a. Aggregate Functions
b. Adjunt Function
c. Set Operation
d. Scalar Operation
90. Which of the following is an Incorrect SQL Query? UNDERSTANDING
a. SELECT MAX(marks) FROM Student.
b. SELECT SUM(marks) FROM Student.
c. SELECT MAX(marks1 + marks2) FROM Student
d. SELECT SUM(marks1,marks2) FROM Student
91. Which of the following SQL Aggregate Function is used to UNDERSTANDING
retrieve minimum value?
a. MAX()
b. MIN()
c. AVG()
d. SUM()
92. What is the output value of the following SQLQuery? EVALUATION
SELECT AVG(Marks) FROM Student_Marks
a. 17
b. 18
c. 19
d.20
93. Aggregate Functions are functions that take a UNDERSTANDING
_________________ as input and return a single value.
a. Collection of Values
b. Single Value
c. Aggregate Value
d. Both a and b
94. SELECT __________________________ FROM Instructor APPLICATION
WHERE dept_name = ‘Comp_Sci’;
Which of the following should be used to find the mean of the
Salary?
a. MEAN(salary)
b. AVG(Salary)
c. SUM(salary)
d. COUNT(salary)
95. SELECT ______________________ FROM Teachers APPLICATION
WHERE semester = ‘Spring’ AND year = 2010;
If we do want to eliminate duplicate and count the number of
Students for the above mentioned code, what should be written
in place of the Blank Space.
a. COUNT(ID)
b. AVG(ID)
c. COUNT(DISTINCT ID)
d. COUNT(PRIMARY KEY ID)
96. COUNT() function in SQL retrurns the number of KNOWLEDGE
____________.
a. values
b. distinct values
c. groups
d. columns
97. If column ‘Salary’ contains the data set EVALUATION
{10000,15000,25000,10000,15000}, what will be the output
after the execution of the given query.
SELECT SUM(DISTINCT Salary) FROM EMPLOYEE;
A. 75000
B. 25000
C. 10000
D. 50000
98. What SQL statement do we use to find the total number of APPLICATION
records present in the table Product.
A. SELECT * FROM PRODUCT
B. SELECT COUNT(*) FROM PRODUCT
C. SELECT FIND(*) FROM PRODUCT
D. SELECT SUM() FROM PRODUCT
99. Which of the Function is an Aggregate Function? KNOWLEDGE
a. ROUND()
b. SUBSTR()
c. MAX()
d. DATE()
100. The ____________ function returns the mean value of a given KNOWLEDGE
column or an expression.
a. MIN(0
b. MEAN()
c. AVG()
d. SUM(COUNT())
101. Which clause in SQL will allow Aggregate Functions to have UNDERSTANDING
more than one records?
a. WHERE
b. ORDER BY
c. JOIN
d. GROUP BY
102. What is the meaning of “GROUP BY” clause in Mysql? KNOWLEDGE
a) Group data by column values
b) Group data by row values
c) Group data by column and row values
d) None of the mentioned
103. Which clause is similar to “HAVING” clause in Mysql? KNOWLEDGE
a) SELECT
b) WHERE
c) FROM
d) None of the mentioned
104. What is the meaning of “HAVING” clause in Mysql? KNOWLEDGE
a) To filter out the row values
b) To filter out the column values
c) To filter out the row and column values
d) None of the mentioned
105. Which among the following belongs to an “aggregate KNOWLEDGE
function”?
a) COUNT
b) UPPER
c) LOWER
d) All of the mentioned
106. Which clause is used with an “aggregate functions”? KNOWLEDGE
a) GROUP BY
b) SELECT
c) WHERE
d) Both GROUP BY and WHERE
107. What is the significance of the statement “GROUP BY d.name” APPLICATION
in the following MySQL statement?
SELECT d.name, COUNT (emp_id) emp_no
FROM department d INNER JOIN Employee e
ON d.dept_id=e.emp_id
GROUP BY d.name
a) Aggregation of the field “name” of both table
b) Aggregation of the field “name” of table “department”
c) Sorting of the field “name”
d) None of the mentioned
108. What is the significance of the statement “HAVING COUNT APPLICATION
(emp_id)>2” in the following MySQL statement?
SELECT d.name, COUNT (emp_id) emp_no
FROM department d INNER JOIN Employee e
ON d.dept_id=e.emp_id
GROUP BY d.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) Filter out all rows whose total emp_id below 2 & Selecting
those rows whose total emp_id>2
d) None of the mentioned
109. Keyword “ASC” and “DESC” cannot be used without which APPLICATION
clause in Mysql?
a) ORDER BY
b) GROUP BY
c) SELECT
d) HAVING
110. What is the significance of “ORDER BY emp_id DESC” in the APPLICATION
following MySQL command?
SELECT emp_id, fname, lname
FROM person
ORDER BY emp_id DESC;
a) Data of emp_id will be sorted in descending order
b) Data of emp_id will be sorted in ascending order
c) Data of emp_id will be sorted in either ascending or
descending order
d) All of the mentioned
111. What is the significance of “ORDER BY emp_id ASC” in the APPLICATION
following MySQL command?
SELECT emp_id, fname, lname
FROM person
ORDER BY emp_id ASC;
a) Data of emp_id will be sorted in descending order
b) Data of emp_id will be sorted in ascending order
c) Data of emp_id will be sorted in either ascending or
descending order
d) All of the mentioned
112. If emp_id contain the following set {9, 7, 6, 4, 3, 1, 2}, what will APPLICATION
be the output on execution of the following MySQL command?
SELECT emp_id
FROM person
ORDER BY emp_id DESC;
a) {9, 7, 6, 4, 3, 1, 2}
b) {1, 2, 3, 4, 6, 7, 9}
c) {2, 1, 3, 4, 6, 7, 9}
d) None of the mentioned
113. If emp_id contain the following set {9, 7, 6, 4, 3, 1, 2}, what will APPLICATION
be the output on execution of the following MySQL command?
SELECT emp_id
FROM person
ORDER BY emp_id ASC;
a) {9, 7, 6, 4, 3, 1, 2}
b) {1, 2, 3, 4, 6, 7, 9}
c) {2, 1, 3, 4, 6, 7, 9}
d) None of the mentioned
114. Find odd one out? APPLICATION
a) GROUP BY
b) DESC
c) ASC
d) ORDER BY
115. Is there any error in the following MySQL command? APPLICATION
SELECT emp_id, title, start_date, fname, fed_id
FROM person
ORDER BY RIGHT (fed_id, 3);
a) Yes
b) No error
c) Depends
d) None of the mentioned
116. Is there any error in the following MySQL command? APPLICATION
SELECT emp_id, title, start_date, fname, fed_id
FROM person
ORDER BY LEFT (fed_id, 3);
a) Yes
b) No error
c) Depends
d) None of the mentioned
117. Is there any error in the following MySQL command?
SELECT emp_id, title, start_date, fname, fed_id
FROM person
ORDER BY 2, 5;
a) Yes
b) No
c) Depends
d) None of the mentioned
118. The GROUP BY statement is used in conjunction with the KNOWLEDGE
............... to group the result-set by one or more columns.
A) Wildcards
B) Aggregate functions
C) Date functions
D) Joins
119. Which of the following is NOT a GROUP BY function? KNOWLEDGE
A) MAX
B) MIN
C) NVL
D) AVG
120. Which of the following functions can be used without GROUP KNOWLEDGE
BY clause in SELECT query?
A) COUNT
B) MAX
C) MIN
D) All of the above
121. Which clause is used to filter the query output based on KNOWLEDGE
aggregated results using a group by function?
A) WHERE
B) LIMIT
C) GROUP WHERE
D) HAVING
122. If we have not specified ASC or DESC after a SQL ORDER
BY clause, the following is used by default
A) DESC Knowledge
B) ASC
C) There is no default value
D) None of the mentioned
A) SELECT
B) WHERE Knowledge
C) FROM
D) None of the mentioned
Understanding
A) To filter out the row values
B) To filter out the column values
C) To filter out the row and column values
D) None of the mentioned
A) GROUP BY
B) SELECT Knowledge
C) WHERE
D) Both GROUP BY and WHERE
A) Wildcards Knowledge
B) Aggregate functions
C) Date functions
D) Joins
A) Group by Knowledge
B) With
C) Where
D) Having
A) Group By
B) Order By Knowledge
C) Both of above
D) None of the above
135. What is the correct format to select Emp_name in
Ascending order ?
D) All of above
deptno;
C) Select deptno, count(*) from Emp Order By deptno;
D) Select empno, count(*) from Emp Order By deptno;
138. The HAVING clause does which of the following?
A) Sum Knowledge
B) Count
C) Total
D) Max
A) GROUP BY clause
B) WHERE Knowledge
C) Aggregate functions
D) None
ANSWER
Question Answer
No
1. B
2. A
3. A
4. B
5. D
6. C
7. C
8. C
9. D
10. B
11. D
12. A
13. B
14. D
15. B
16. D
17. A
18. B
19. C
20. B
21. D
22. A
23. A
24. A
25. D
26. C
27. A
28. D
29. A
30. A
31. A
32. A
33. B
34. B
35. B
36. B
37. C
38. A
39. B
40. A
41. C
42. C
43. D
44. D
45. B
46. A
47. C
48. C
49. B
50. C
51. A
52. A
53. C
54. A
55. A
56. B
57. A
58. B
59. B
60. C
61. A
62. (a)
63. (b)
64. (b)
65. (a)
66. (d)
67. (d)
68. (a)
69. (c)
70. (d)
71. (d)
72. (b)
73. (b)
74. (d)
75. (c)
76. (a)
77. (d)
78. (a)
79. (a)
80. (d)
81. (c)
82. c: TOTAL()
83. d: SUM()
85. a, WITH()
86. a. DISTINCT
87. a. COUNT(attribute)
90. b. MIN()
91. b. 18
93. b. AVG(Salary)
95. a. values
96. d. 50000
98. c. MAX()
99. c. AVG()
100. d. GROUP BY
103. b) WHERE (“WHERE” is also used to filter the row values in Mysql)
105. a) COUNT
107. b) Aggregation of the field “name” of table “department” (“GROUP BY” clause s used for
aggregation of field)
108. c) Filter out all rows whose total emp_id below 2 & Selecting those rows whose total
emp_id>2
(“HAVING” clause are worked similar as “WHERE” clause)
109. a) ORDER BY (“ASC” or “DESC” are used to sort the result set in ascending or descending
order therefore they cannot be used without “ORDER BY” clause)
110. a) Data of emp_id will be sorted in descending order (Keyword “DESC” will sort the data in
descending order)
111. b) Data of emp_id will be sorted in ascending order (Keyword “ASC” will sort the data in
ascending order)
112. a) {9, 7, 6, 4, 3, 1, 2} (“DESC” clause sort the emp_id in the descending order)
113. b) {1, 2, 3, 4, 6, 7, 9} (“ASC” clause sort the emp_id in the ascending order)
114. a) GROUP BY (“ORDER BY”, “DESC”, “ASC” are related to sorting whereas “GROUP BY” is not
related to sorting)
115. b) No error (“ORDER BY” clause can be used with expression such as fed_id, which is a social
security no like 111, 111, 111, therefore, we sort it taking only three digits from right)
116. b) No error (“ORDER BY” clause can be used with an expression such as fed_id which is a
social security no like 111, 111, 111, therefore, we sort it taking only three digits from left.)
117. b) No (“ORDER BY” clause can be used with Place holders. Here “2” represent column “title”
and “5” represent “fed_id”. Therefore it looks like “ORDER BY title, fed_id”)
118. D) Joins
119. A) MAX
121. D) HAVING
122. B
123. C
124. B
125. B
126. A
127. A
128. B
129. A
130. B
131. B
132. D
133. D
134. A
135. C
136. C
137. A
138. C
139. C
140. A
141. A
Name of the vetter- Soumalik Roy
Region- Kolkata
E-mail ID – [email protected]
Name of the Chapter- DBMS & SQL
3. A: MID function can be used to get parts of the numbers. Knowledge and
R: The MID function can find the part of the string with understanding,
given starting position and number of characters. Applying
(a) Both Assertion and reason are true and reason is
correct explanation of assertion.
(b) Assertion and reason both are true but reason is
not the correct explanation of assertion.
(c) Assertion is true, reason is false.
(d) Assertion is false, reason is true.
5. A: The right() and left() function are text functions. Knowledge and
R: right() and left() functions return texts as results. understanding
(a) Both Assertion and reason are true and reason is
correct explanation of assertion.
(b) Assertion and reason both are true but reason is
not the correct explanation of assertion.
(c) Assertion is true, reason is false.
(d) Assertion is false, reason is true.
Question No Answer
1. B
2. A
3. D
4. C
5. B
6. C
7. A
8. A
9. C
10. A
11. A
12. D
13. C
14. D
15. B
16. D
17. D
18. (A) Both Assertion and reason are true and reason is correct explanation of
assertion.
21. (B) Assertion and reason both are true but reason is not the correct explanation
of assertion.
22. (A) Both Assertion and reason are true and reason is correct explanation of
assertion.
27. B. Both A and R are true and R is the not the correct explanation of A.
28. D
29. B
30. A
31. C
32. A
Region- Kolkata
E-mail ID – [email protected]
Name of the Chapter- DBMS & SQL
(2) Raju wants the square values of all Wt values. Which code is correct for that?
(a) SELECT exp(Wt,2) FROM exp;
(b) SELECT power(Wt,2) FROM exp;
(c) SELECT pow(Wt,2) FROM exp;
(d) SELECT square(Wt) FROM exp;
(3) Raju has to divide the "Amount" values by 4 and find the remainders of each Amount.
Which code will be required?
(a) SELECT mod(Amount, 4) FROM exp;
(b) SELECT rem(Amount,4) FROM exp;
(c) SELECT divide(Amount,4) FROM exp;
(d) SELECT mod(Amount/4) FROM exp;
(2) What will be the output of this code: SELECT Name from FR WHERE
left(Name,2)="Sh";
(a) (b)
(c) (d)
(4) What is the output of this code: SELECT city FROM FR WHERE instr(city,"o")>0;
(a) (b)
(c) (d)
3. There was a survey on primary class students and the data is as following table "survey" Knowledg
SN Name edu food Sports_TV_cyclin e and
g understan
1 Mohit 8 8 Y_N_Y ding,
2 Chikoo 9 7 N_Y_Y Applying,
3 Mittal 7 7 N_Y_N Analysis &
4 Raju 8 9 Y_N_N Evaluation
5 Kiran 9 8 Y_Y_Y
(4) Which code is correct to Display the records whose TV value is N and cycling value is
N.
(i) SELECT * FROM survey WHERE right(sports_TV_cycling,3)="N_N";
(ii) SELECT * FROM survey WHERE mid(sports_TV_cycling,3,3)="N_N";
(a) Only i
(b) Only ii
(c) Both i, ii
(d) None of the above
4. Read the passage given below and answer the following questions: Learning
Vikas has inserted a table Hospital in SQL. Help him to perform the following operations: Objective
Patient_No Patient_Name Disease
P001 Alya Viral Fever
P002 Kavita Cough
P003 Manya Viral Fever
5. (i) which command can be used to get first four characters from value in Disease column: Applicati
(A) Select Right(Disease,4) from Hospital; on
(B) Select Left(Disease,4) from Hospital;
(C) Select Substr(Disease,4) from Hospital;
(D) Select Instr(Disease,4) from Hospital;
(ii) which command can be used to get size of patient name with patient no. as P001.
(A) Select Length(Disease) from Hospital where Patient_No=”P001”;
(B) Select Size(Disease) from Hospital where Patient_No=”P001”;
(C) Select Length=Disease) from Hospital where PatientNo=”P001”;
(D) Select Length(Disease) from Hospital where PatientNo=”P001”;
(iii) Which command vikas should use to change all patient names into upper case letters.
(A) Select UPPER(Patient_Name) from Hospital;
(B) Select LOWER(Patient_Name) from Hospital;
(C) Select LEFT(Patient_Name) from Hospital;
(D) Select RIGHT(Patient_Name) from Hospital;
(iv) Which command vikas should use to change all patient names into lower case letters.
(A) Select UPPER(Patient_Name) from Hospital;
(B) Select LOWER(Patient_Name) from Hospital;
(C) Select LEFT(Patient_Name) from Hospital;
(D) Select RIGHT(Patient_Name) from Hospital;
6. ABC Company has a created a table EMPLOYEES in SQL to store the details of their Applicati
employees. The structure of the table is given below: on
EmpID EmpName Salary
121 Ravi 10000
123 Sam 12000
124 Anya 11500
(i) Which command the company should apply on table to get first three characters from
the names of every employee.
(A) Select UPPER(EmpName) from EMPLOYEES;
(B) Select LEFT(EmpName,3) from EMPLOYEES;
(C) Select RIGHT(EmpName,3) from EMPLOYEES;
(D) Select MID(EmpName) from EMPLOYEES;
(ii) Suggest a command to the company for finding out the last 2 characters from the
names of every employee.
(A) Select UPPER(EmpName,2) from EMPLOYEES;
(B) Select LEFT(EmpName,2) from EMPLOYEES;
(C) Select RIGHT(EmpName,2) from EMPLOYEES;
(D) Select MID(EmpName,2) from EMPLOYEES;
(iii) Which of the following command the company can use to extract substring “av” from
employee name “Ravi”
(A) Select UPPER(EmpName,2) from EMPLOYEES WHERE EmpID=121;
(B) Select SUBSTR(EmpName,2,2) from EMPLOYEES WHERE EmpID=121;
(C) Select MID(EmpName,1,2) from EMPLOYEES WHERE EmpID=121;
(D) Select MID(EmpName,2,2) from EMPLOYEES;
(iv) Which command can be used to find the number of characters in each employee
name.
(A) Select LENGTH(EmpName) from EMPLOYEES;
(B) Select LEFT(EmpName) from EMPLOYEES;
(C) Select RIGHT(EmpName,2) from EMPLOYEES;
(D) Select MID(EmpName,2) from EMPLOYEES;
7. Consider the given relation Hospital and answer the questions given below:
2.How can you display the departments and no of patients in each department but you will only
display the departments having more than one patient.
a) select department, count(*) from hospital where count(department)>1;
b) select department, count(*) from hospital where count(department)>1 group by department;
c) select department, count(*) from hospital group by department where count(department)>1;
d) select department, count(*) from hospital group by department having count(*)>1;
1.Identify the SQL Query which displays the data of the total number of books issued.
a. SELECT COUNT(BookID) FROM StuLibrary
b. SELECT COUNT(StuID) FROM StuLibrary
c. SELECT COUNT(*) FROM StuLibrary
d. Both a and c
2.Which of the following code will display the number of unique students who have
issued one or more Books from the Library.
3.Which SQL Query will find the latest date on which a book was returned.
a. SELECT MAX(Return_date) FROM StuLibrary
b. SELECT MIN(Return_date) FROM StuLibrary
c. SELECT LAST(Return_date) FROM StuLibrary
d. SELECT SUM(Return_date) FROM StuLibrary
4.Which code will count the number of students whose name starts with ‘SH’
a. SELECT COUNT(StuName LIKE “SH%”) FROM Student
b. SELECT COUNT(StuName) FROM Student
WHERE StuName = ‘SH%’
c. SELECT COUNT(StuName) LIKE ‘SH%’ FROM Student
d. SELECT COUNT(StuName) FROM Student WHERE StuName LIKE ‘SH%’
5.Select the code to count the No. of Books issued by each student.
a. SELECT StuID, COUNT(BookID) FROM StuLibrary GROUP BY Book ID
b. SELECT StuID, COUNT(BookID) FROM StuLibrary GROUP BY StuID
c. SELECT StuID, COUNT(StuID) FROM StuLibrary GROUP BY StuID
d. SELECT BookID, COUNT(StuID) FROM StuLibrary GROUP BY BookID
10. Tejasvi Sethi, a car dealer has stored the details of all cars in her showroom in a table UNDER
called CARMARKET. The table CARMARKET has attributes CARCODE which is a STANDI
primary key, CARNAME, COMPANY, COLOR, COST (in lakh rupees) of the car and NG
DOM which is the Date of Manufacture of the car. APPLIC
Answer any four questions based on the table CARMARKET from the below mentioned ATION,
questions. EVALU
Table: CARMARKET ATION
CAR CAR COMPANY COLOR COST DOM
CODE NAME
C01 BALENO SUZUKI BLUE 5.90 2019-11-07
CO2 INDIGO TATA SILVER 12.90 2020-10-15
C03 GLC MERCEDES WHITE 62.38 2020-01-20
C04 A6 AUDI RED 58.55 2018-12-29
5.Display the count of those cars who have more than one cars of same color.
a. SELECT COUNT(*) FROM CARMARKET WHERE COUNT(COLOR)> 1
b. SELECT COUNT(COLOR) FROM CARMARKET GROUP BY COLOR
c. SELECT COUNT(COLOR) FROM CARMARKET GROUP BY COLOR HAVING
COUNT(COLOR)> 1
d. None of the Above.
11. Consider the table STUDENT given below and give answers to the questions UNDER
STANDI
NG
APPLIC
ATION,
EVALU
ATION
1.Pinky has given the following command to obtain the highest marks class-wise:
SELECT MAX (Marks) FROM STUDENT WHERE GROUP BY Class;
but she is not getting the desired result. Help her by writing the correct command
(a) SELECT MAX (Marks) FROM STUDENT WHERE GROUP BY Class;
(b) SELECT Class, MAX (Marks) FROM STUDENT GROUP BY Marks;
(c) SELECT Class, MAX (Marks) GROUP BY Class FROM STUDENT;
(d) SELECT Class, MAX (Marks) FROM STUDENT GROUP BY Class;
2.State the command to display the average marks scored by students of each gender who
are in Class XI.
(i) SELECT Gender, AVG (Marks) FROM STUDENT WHERE Class- "XI" GROUP BY
Gender;
(ii) SELECT Gender, AVG (Marks) FROM STUDENT GROUP BY Gender WHERE
Class-"XI";
(iii) SELECT Gender, AVG (Marks) GROUP BY Gender FROM STUDENT HAVING
Class-"XI";
(iv) SELECT Gender, AVG (Marks) FROM STUDENT GROUP BY Gender HAVING
Class = "XI";
Choose the correct option:
(a) Both (ii) and (iii)
(b) Both (ii) and (iv)
(c) Both (i) and (iii)
(d) Only (iii)
3.Help Ritesh write the command to display the name of the youngest student
(a) SELECT Name, MIN (DOB) FROM STUDENT;
(b) SELECT Name, MAX (DOB) FROM STUDENT;
(c) SELECT Name, MIN (DOB) FROM STUDENT GROUP BY NAME;
(d) SELECT Name, MAXIMUM (DOB) FROM STUDENT;
12. Mr Mukesh Prasad a teacher by profession created a table named ASSIGNMENT to keep record KNOWLEDG
E
of the assignment given to his student :
ASSIGNMENT
AsnNo Date Topic SubDate Grade Marks TotalQ
ues
12 2014-10-23 Greenhouse Gas 2014-10-27 5 15 3
13 2014-10-28 Methane 2014-11-05 10 15 5
14 2014-11-07 Chlorophyl 2014-11-10 5 10 2
15 2014-11-12 Respiration 2014-11-18 10 12 3
16 2014-11-20 Reproduction 2014-11-23 5 15 5
17 2014-12-28 Electricity NULL 5 15 3
20 2015-01-15 Chemical Bonding 2015-01-20 5 10 2
21 2015-01-17 Carbon NULL 10 10 2
1.Mr. Mukesh Prasad needs a help from you to display the list of recent topics to old topics of
assignments. Which command you will select among the following:
A) SELECT Topic FROM ASSIGNMENT ORDER BY Date desc;
B) SELECT * FROM ASSIGMENT ORDER BY date desc;
C) SELECT ASSIGNEMENT ORDER BY date desc;
D) SELECT ALL FROM ASSIGNMENT ORDER BY Date desc;
2.Which command Mr. Mukesh Prasad to make a group of different topics depanding on total
question.
A) SELECT ALL FROM ASSIGNMENT GROUPED BY TOTAL QUESTION.
B) SELECT * FROM ASSIGNMENT GROUPED BY TOTAL QUESTION
C) SELECT ASSIGMENT GROUPED BY TOTAL UESTION
D) SELECT * FROM ASSIGMENT GROUPED AS TOTAL QUESTION
13. GARMENT
Gcode Gname Size Colour Price
111 tshirt XL red 1400
112 jeans L blue 1600
113 skirt XL black 1100
114 ladies jacket XL blue 4000
115 trousers L brown 1500 Applicati
116 ladies top L pink 1200 on,
Write the command to display the following data as result Creation
Size Total
L 4300
XL 6500
14. AGENT
AGENT_CODE AGENT_NAME WORKING_AREA COMMISSION COUNTRY
A001 SUBBARAO BANGALORE 0.14 INDIA
A002 MUKESH MUMBAI 0.11 INDIA
A003 ALEX LONDON 0.13 UK
A004 IVAN TORONTO 0.15 CANADA
Understa
A005 ANDERSON BRISBAN 0.13 AUSTRALIA
A006 MCDEN LONDON 0.15 UK nding,
A007 RAMASUNDAR BANGALORE 0.15 INDIA Applicati
A008 ALFORD NEW YORK 0.12 USA
on,
Choose the correct command to display the maimum commission in each country
Creation
A) Select country, maximum(commission) from Agent group by country;
B) Select country, max(commission) from Agent group by country;
C) Select max(commission) from Agent group by country;
D) Select commission, maximum(country) from Agent group by country;
15. STUDENT
Rollno Name Class DOB Gender City Marks
1 anand xi 6/6/1997 m agra 430
2 Chetan xii 7/5/1994 m Mumbai 460
3 geet xi 6/5/1997 f agra 470
Understa
4 preeti xii 8/8/1995 f Mumbai 492
nding,
5 saniyal xii 8/10/1995 m delhi 360
Applicati
5 saniyal xii 8/10/1995 m delhi 360
on,
6 maakhiy xi 12/12/1994 f dubai 256
Creation
7 neha x 8/12/1995 f Moscow 324
8 nishant x 12/6/1995 m moscow 429
Prachi has given the following command to obtain the highest marks
Select max(marks) from student where group by class; but she is not getting the desired
result. Help her by writing the correct command.
A) Select max(marks) from student where group by class;
B) Select class, max(marks) from student group by marks;
C) Select class, max(marks) group by class from student;
D) Select class, max(marks) from student group by class;
ANSWER
CBQ NO Answer
1. 1.B
2.C
3.A
4.D
2. 1.A
2.B
3.D
4.B
3. 1.B
2.D
3.C
4.C
4. 1.B
2.A
3.A
4.B
5. 1.B
2.C
3.B
4.A
6. 1.B
2.A
3.A
4.B
7. (i) Answer - select monthname(Datofadm) from Hospital:
(ii) Answer - select year(Datofadm) from Hospital:
(iii) Answer - select day(Datofadm) from Hospital:
(iv) Answer -select month(Datofadm) from Hospital:
8. 1.B
2.D
3.D
9. i. d. Both a and c
ii. c. SELECT COUNT(DISTINCT StuID) FROM StuLibrary
iii. a. SELECT MAX(Return_date) FROM StuLibrary
iv. d. SELECT COUNT(StuName) FROM Student WHERE
StuName LIKE ‘SH%’
v. b. SELECT StuID, COUNT(BookID) FROM StuLibrary
GROUP BY StuID
14. B
15. D
Region- Kolkata
E-mail ID – [email protected]
Name of the Chapter- DBMS & SQL
21. NOW() is used to see the current date only. Remembering and
Understanding
22. The month() function returns the month number from the Remembering and
selected date. Understanding
23. The date() function returns the date value in Remembering and
‘MM-DD-YYYY’ from the selected date. Understanding
24. Date() and Day() return the same string. Analysing, Evaluating
and Creating
25. We cannot display the only year from the selected date in Analysing, Evaluating
MySQL. and Creating
26. The monthname() function returns the value of type Remembering and
integer. Understanding
27. yyyy/mm/dd is the default format of date in MySQL. Remembering and
Understanding
28. The day() function returns the day name from the Analysing, Evaluating
specified date. and Creating
29. The sysdate() function returns the date with the exact time Applying
when the command is executed.
30. The now() function returns the date with constant time Remembering and
after execution. Understanding
31. MIN and MAX can only be used with numeric columns.
A) True Knowledge
B) False Understanding
ANSWER
Question No Answer
1. True
2. False
3. False
4. False
5. True
6. True
7. True
8. False
9. True
10. False
11. FALSE
12. FALSE
13. TRUE
14. TRUE
15. TRUE
16. TRUE
17. FALSE
18. FALSE
19. TRUE
20. TRUE
21. FALSE
22. TRUE
23. TRUE
24. FALSE
25. FALSE
26. FALSE
27. TRUE
28. FALSE
29. TRUE
30. TRUE
31. False
32. True
33. False
34. False
35. True
36. False
37. True
38. True
39. True
40. False
41. TRUE
42. TRUE
43. FALSE
44. TRUE
45. FALSE
46. FALSE
47. FALSE
48. FALSE
49. FALSE
50. TRUE
51. A) True
52. A) True
53. A) True
54. B) False
55. A) True
56. A) True
57. A) True
58. B) False
59. B) False
60. A) True
61. A
62. A
63. A
64. B
65. A
66. B
67. A
68. A
69. B
70. B
Region- Kolkata
E-mail ID – [email protected]
As Per Revised
CBSE Curriculum
2024-25
Classroom Teaching & Animated Videos Playlists
Join the School of Educators WhatsApp Group today and unlock a world of resources, support, and
collaboration to take your teaching to new heights. To join, simply click on the group links provided
below or send a message to +91-95208-77777 expressing your interest.
Together, let's empower ourselves & Our Students and inspire the next generation of learners.
Best Regards,
Team
School of Educators
SCHOOL OF EDUCATORS WHATSAPP GROUPS
(For Teachers Only)
You will get Pre- Board Papers PDF, Word file, PPT, Lesson Plan, Worksheet, practical tips and Viva
questions , reference books , smart content , curriculum , syllabus , marking scheme , toppers answer
scripts , revised exam pattern , revised syllabus , Blue Print etc. here .Join Your Subject / Class WhatsApp
Group.
Artificial Intelligence
SCHOOL OF EDUCATORS WHATSAPP GROUPS
(For Students Only)
Class 11(Science) Class 11(Com) Class 11(Hum) Class 12 (Sci) Class12 (Com)
Artificial Intelligence
• No introduction
• No Good Morning/Any wish type message
• No personal Chats & Messages
• No Spam
• You can also ask your difficulties here.
Just get learning resources & post learning resources. Helpline number only WhatsApp: +91-95208-77777
SOE CBSE Telegram Groups (Kindergarten to Class XII)
Kindergarten
Class XI (Hum) Class XI (Com) Class XII (Sci) Class XII (Hum)
• No introduction
• No Good Morning/Any wish type message
• No personal Chats & Messages
• No Spam
• You can also ask your difficulties here.
Just get learning resources & post learning resources. Helpline number only WhatsApp: +91-95208-77777
Available Resources on YouTube
Enjoy animated videos covering all subjects from Kindergarten to Class 12, making learning fun for
students of all ages.
Explore classroom teaching videos for grades 6 to 12, covering various subjects to enhance
understanding and knowledge.
Access the most important questions and previous year's question papers (PYQ) to excel in exams and
assessments.
Stay up-to-date with the latest CBSE Curriculum for 2023-24 with our videos aligned to the current
syllabus.
Get informed about CBSE updates and circulars through our dedicated videos.
Improve pronunciation skills and expand vocabulary with our "Word of the Day" series and other
language-related content and many more……….
Don't miss out on these valuable resources; subscribe to our channel now!