Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Which among the following can also be included with “SELECT” clause while writing query in Mysql?
a) Literals
b) Expressions
c) User defined functions
d) All of the mentioned

View Answer

Answer: d [Reason:] “SELECT clause” can also include Literals like ‘ACTIVE’, Expressions like emp_id*314, Built_in functions like UPPER ().

2. Is there any error in executing the following query?

SELECT emp_id, ‘ACTIVE’,
       emp_id * 3.145,
       UPPER (lname)
       FROM Employee;

a) Yes
b) NO
c) Depends on condition
d) None of the mentioned

View Answer

Answer: b [Reason:] “SELECT clause” includes the following: Literals like ‘ACTIVE’, Expressions like emp_id*314, Built_in functions like UPPER ().

3. Is there any error in executing the following query?

SELECT USER (),
VERSION (), DATABASE ();

a) Yes, “FROM” is not used
b) No
c) Depends
d) None of the mentioned

View Answer

Answer: b [Reason:] Clause “FROM” is not necessary when we used “Built in” function with “SELECT” clause.

4. What is the need of “column Aliases” in “SELECT” clause?
a) To assign a new label to the column in result set
b) To overwrite the existing column name in result set
c) To modify the column name while using literals, Expression, built_in functions with “SELECT clause
d) All of the mentioned

View Answer

Answer: d [Reason:] “Column Aliases” are used to assign a new label to the columns in the result set without actually changing the column name.

5. What will be the result of the query given below?

SELECT emp_id,
‘ACTIVE’ STATUS,
emp_id * 3.14 emp_pi,
UPPER (lname) last_name
FROM employee;

a) emp_id, ACTIVE, emp_id * 314, UPPER(lname)
b) emp_id, Status, emp_pi, last_name
c) Error
d) None of the mentioned

View Answer

Answer: b [Reason:] Status, emp_pi, last_name are “column aliases”.

6. What will be the result of the query given below?

SELECT emp_id,
‘ACTIVE’ AS STATUS,
emp_id * 3.14 AS emp_pi,
UPPER (lname) AS last_name
FROM employee;

a) emp_id, ACTIVE, emp_id * 314, UPPER(lname)
b) emp_id, Status, emp_pi, last_name
c) Error
d) None of the mentioned

View Answer

Answer: b [Reason:] Status, emp_pi, last_name are “column aliases” and Keyword “AS” is optional.

7. Which Keyword is used to remove duplicate rows in result set?
a) DISTINCTS
b) MODIFY
c) DISTINCT
d) All of the mentioned

View Answer

Answer: a [Reason:] None.

8. If in Table “account”, a column “cust_id” consists of {1,2,2,3,3,5,6,7,8,8} then what will be the output on executing the following query?

SELECT DISTINICT cust_id
FROM account;

a) {1, 2, 2, 3, 3, 5, 6, 7, 8, 8}
b) {1, 2, 3, 5, 6, 7, 8}
c) { }
d) None of the mentioned

View Answer

Answer: b [Reason:] DISTINICT keyword will remove the duplicate entries in the result set.

9. If in Table “employee”, a column “emp_id” consists of {1,2,2,3,3,5,6,7,8,8} then what will be the output on executing the following query?

SELECT DISTINICT emp_id
FROM employee;

a) {1,2,2,3,3,5,6,7,8,8}
b) {1,2,3,5,6,7,8}
c) { }
d) None of the mentioned

View Answer

Answer: b [Reason:] DISTINICT keyword will remove the duplicate entries in the result set.

10. Which among the following is an optional Keyword?
a) DISTINICTS
b) ALL
c) AS
d) Both AS and ALL

View Answer

Answer: d [Reason:] “AS” and “ALL” are optional.

.woocommerce-message { background-color: #98C391 !important; }