Group by
Order by
¢. Both (a) and (b) can be taken
d. None of these
Which of the following can be used to display current date?
a. Now)
b. Date()
c, Curdate()
d. Both (a) and (c)
e., All of the above
Name the functions to remove unnecessary leading and trailing space characters comes with
string
a. Left(),right()
b. Lefttrim() righttrim()
cc Ltrim(), rtrim(),
dd. Substr(), instr()
For Notes, Textbook Solutions, Sample Papers, Practical, Projects, MCQs visit: ww.techtipnow.in
PAC eee)oR ee
450. Consider the following table ‘Student’ and predict the output of following query:
Select count(*), count(marks) from Student;
Rollno_ | Name Subject
1 Sanjay Science
2 Ravi Math
3 Gaurav Math
4 Vishal Science
5 Rahul Art
6 Jaishankar _| Science
a 66
b. 65
«56
4.55
451. Forgiven table ‘student’ in Q450, find the output of :
Select max(marks) + Min(marks) from student where subject
a. 134
b. 146
No Output
d. Will generate Error
452. Aryan, a database administrator, has grouped records of a table with the help of group by
clause. He needs to further filter groups of records generated through group by clause. Suggest
suitable clause for it
a, Where Clause
b. Having Clause
Both
d. None of these
453. Which of the following statement is true about ‘Cartesian Product’?
a, It is an operation that combines tuples from two relations regardless of whether they have
the same values or not.
b, The degree of resulting relation is calculated as the product of the degrees of both the
relation under construction.
c. The cardinality of resulting relation is calculated as the sum of the cardinality of relations
under consideration
d. Allare true
454, _ Consider the following tables Product and Customer.
PID PNAME BRAND PRICE
TpOL Telcom powder AK 40
Fw0S, Face Wash ABC 45
B501 Bath soap ABC 55
Sho6 Shampoo XYZ 120
Fw2 Face wash XYZ 95
aD CNAME cy PID
on Cosmetic shop Delhi Fw0S,
2 Total health Mumbai 8501
2 Live life Delhi hos
15 Pretty woman Delhi Fwi2
10 Dreams Chennai Tpo1
apers, Practical, Projects, MCQs visit: www.techtipnow.in
ene eeWrite SQL command to display customername and products name purchased by customer who
lives in Delhi
a, Select cname, pname from customer, product where product.pid = customer.pid having city =
‘delhi
Select chame, pname from customer, product where product.pid = customer.pid and city =
‘delhi’;
. Select cname, pname from customer c, product p where p.pid = c.pid and city = ‘delhi
d. All of above
@, Both (b) and (c)
455. Consider the following tables Employee and Job
Eid Ename Sales Jobid
EL Sanjay lal 1100 102
2 Ravi batra 1200 101
3 Jagbir singh | 1400 103
Ea Mohit mathur | 1250 102
ES ‘Ashish yadav | 1450 108
Jobid Title sal
101 President, 20000
102 Director 16500
103 Manager 12000
104 ‘Accountant | 8000
105 Clerk 6000
Write SQL queries to display name of employee whose salary is lowest.
a. Select ename, min(sal) from employees, job where job jobid = employee.jobid;
b, Select ename, min(sal) from employees, job;
c, Select ename, min(sal) from employee, job having job jobid = employee.jobid;
d. All of the above
456. _Srikant created the following table ‘Student’ in his database; [CBSE IP TERM 2 2022]
Table: Student
Rollno Name Class_| Marks
1 Ritika 2 40
2 Angad 2 35
3 Kaveri 11 a2
4 Durgesh 2 21
5 Denial Fy 4a
6 Rabindra iL 39
7 Rabia il 28
He now wants to count number of student in each class where the number of student is more than
3. He has executed the following query:
Select max(marks) from student where count(*) >3 group by class;
But he got an error. Help him in writing query correctly
Select max(marks) from student group by class having count(*)>
Select max(marks) from student group by class where count(*) >3;
Select count(marks) from student group by class having count(*) >3;
d. Select count(marks) from student group by class where count(*) >3:
For Notes, Textbook Solutions, Sample Papers, Practical, Projects, MCQs visit: ww.techtipnow.in
PAC ee eyRRs
De ee eased
aaa: en ete
457. Predict the output of following cod
SELECT UPPEER(MID( ‘techtipnow computers’,6,10));
a, techtipnow
b. TECHTIPNOW
. ipnow comp
d. IPNOW COMP
458. Which of the following is not a valid join type?
a. Equi join
b. Non equi join
c. Natural join
d. Self join
Answers
az9.c 430. [431.c [432c | 433.b [434.a [435d | 436.b | 437.b | 438.b
439d | aaoc | aa1b [442d | 443.a | aaab | 445a | aa6.c | 4a7.b | 448.0
4ag.c /450.b | 451.b | 452b | 453.a | 454.e |455.a | 456.c | 457.d_ | 458.b
Deere Re ene a
treme eee