MCQGeeks
0 : 0 : 1
CBSE
JEE
NTSE
NEET
English
UK Quiz
Quiz
Driving Test
Practice
Games
Quiz
SQL
Sql Miscellaneous
Quiz 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Q.1
Which SQL keyword is used to sort the result-set?
SORT BY
ORDER
ORDER BY
SORT
Q.2
Which of the following group functions ignore NULL values?
MAX
COUNT
SUM
All of the above
Q.3
Which of the following SQL query is correct for selecting the name of staffs from 'staffinfo' table where salary is 10,000 or 25,000?
SELECT name FROM staffinfo WHERE salary BETWEEN 10000 AND 25000;
SELECT name FROM staffinfo WHERE salary IN (10000, 25000);
Both A and B
None of the above
Q.4
Select the right statement to insert values to the student table.
INSERT student VALUES (
INSERT VALUES (
INSERT INTO student VALUES (
INSERT VALUES INTO student (
Q.5
............. joins two or more tables based on a specified column value not equaling a specified column value in another table.
EQUIJOIN
NON-EQUIJOIN
OUTER JOIN
NATURAL JOIN
Q.6
In SQL, which command is used to change a table's storage characteristics?
ALTER TABLE
MODIFY TABLE
CHANGE TABLE
None of these
Q.7
In SQL, which of the following is not a data definition language commands?
REVOKE
RENAME
UPDATE
GRANT
Q.8
Which of the following query finds the total rating of the sailors who have reserved boat "103"?
SELECT SUM(s.rating) FROM sailors s, reserves r AND r.bid = 103;
SELECT s.rating FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
c) SELECT COUNT(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
SELECT SUM(s.rating) FROM sailors s, reserves r WHERE s.sid = r.sid AND r.bid = 103
Q.9
The SELECT statement SELECT 'Hi' FROM DUAL WHERE NULL = NULL; Outputs
Hi
FLASE
TRUE
Nothing
Q.10
Which of the following is illegal?
SELECT SYSDATE - SYSDATE FROM DUAL;
SELECT SYSDATE - (SYSDATE - 2) FROM DUAL;
SELECT SYSDATE - (SYSDATE + 2) FROM DUAL;
None of these
Q.11
If a query involves NOT, AND, OR with no parenthesis
NOT will be evaluated first; AND will be evaluated second; OR will be evaluated last.
NOT will be evaluated first; OR will be evaluated second; AND will be evaluated last.
AND will be evaluated first; OR will be evaluated second; NOT will be evaluated last.
The order of occurrence determines the order of evaluation.
Q.12
Let the statement
SELECT column1 FROM myTable;
return 10 rows. The statement
SELECT ALL column1 FROM myTable;
will return
less than 10 rows
more than 10 rows
exactly 10 rows
None of these
Q.13
Find the name of cities with all entries whose temperature is in the range of 71 and 89
SELECT * FROM weather WHERE temperature NOT IN (71 to 89);
SELECT * FROM weather WHERE temperature NOT IN (71 and 89);
SELECT * FROM weather WHERE temperature NOT BETWEEN 71 to 89;
SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89;
Q.14
Which of the following query finds the names of the sailors who have reserved at least one boat?
SELECT DISTINCT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
SELECT s.sname FROM sailors s, reserves r WHERE s.sid = r.sid;
SELECT DISTINCT s.sname FROM sailors, reserves WHERE s.sid = r.sid;
None of These
Q.15
Which of the following query finds colors of boats reserved by "Dustin"?
SELECT DISTINCT b.color FROM boats b, sailors s WHERE s.sname = 'Dustin' AND s.sid = b.sid
SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND s.sid = r.sid AND r.bid = b.bid;
SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND s.sid = r.sid
SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND r.bid = b.bid
Q.16
What does the following query find?
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'red')
MINUS
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'green')
Find the sailor IDs of all sailors who have reserved red boats but not green boats
Find the sailor IDs of at least one sailor who have reserved red boats but not green boats
Find the sailor Ids of atmost one sailor who have reserved red boats but not green boats
None of These
Q.17
Which of the following query finds the name of the sailors who have reserved at least two boats?
SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND r1.sid = r2.sid AND r1.bid ≠ r2.bid
SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND COUNT(r1.bid) > r2.bid
SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND r1.sid = r2.sid AND r1.bid <> r2.bid
All of these
Q.18
What is the full form of
SQL
?
Structured Query Language
Structured Query List
Simple Query Language
None of these
Q.19
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Data Definition Language(DDL)
Data Manipulation Language(DML)
Both of above
None
Q.20
Which operator performs pattern matching?
BETWEEN operator
LIKE operator
EXISTS operator
None of these
0 h : 0 m : 1 s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Report Question
×
What's an issue?
Question is wrong
Answer is wrong
Other Reason
Want to elaborate a bit more? (optional)
Support mcqgeeks.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page