Test Index

Structured Query Language (SQL) Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 50 of 58
Marks: +1, -0
(a) Differentiate between IN and BETWEEN operators in SQL with appropriate examples.
OR
(b) Which of the following is NOT a DML command.
DELETE, DROP, INSERT, UPDATE
[CBSE 2023 Compartment]
Solution:  
(a)
INBETWEEN
Checks whether a value matches any value in a given list of values.Checks whether a value lies within a range of values; both end values are included.
Values need not be continuous, e.g. SECTION IN ('C', 'D').Gives a continuous range of numbers, dates or text, e.g. MARKS BETWEEN 75 AND 100.
Examples:
SELECT NAME, SECTION FROM STUDENTS
WHERE SECTION IN ('C', 'D');
displays students of section C or D.
SELECT ROLL, MARKS FROM RESULT
WHERE MARKS BETWEEN 75 AND 100;
displays students whose marks are from 75 to 100 (75 and 100 included).
OR (b)
DROP is not a DML command. It is a DDL (Data Definition Language) command that removes a table (structure and data) from the database. DELETE, INSERT and UPDATE are DML commands as they change the data stored in the table.
© examsnet.com
Advertisements
Go to Question: