Week3 - Retrieve Data using the SQL SELECT Statements / Explore

The questions can come in any order, so make sure you are selecting right option for all questions.

Which of the following query is correct to fetch all the employee details from the employee table
(a) select * from employee;
Which of the below queries displays employees' name and new salary after the increment of 1000?
(c) SELECT ename, sal+1000 FROM emp;
Can “SELECT” clause be used without the clause “FROM”?
(b) NO
With Oracle, how do you select a column named "FirstName" from a table named "Persons"?
(c) SELECT FirstName FROM Persons
Select ________ dept_name
from college;
Here which of the following displays the unique values of the column ?
(c) Distinct
If in Table “employee”, a column “emp_id” consists of {1,2,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;
(b) [1,2,3,5,6,7,8]
In SQL, which command is used to SELECT only one copy of each set of duplicable rows
(a) SELECT DISTINCT
The FROM SQL clause is used to
(a) specify what table we are selecting or deleting data FROM
employee_id Name Salary
1001 Annie 6000
1009 Ross 4500
1018 Zeith 7000
above are the Employee table details.
select employee_id from employee order by employee_id desc;
Which of the following output will be true?
(a) 1018,1009,1001

All the questions are related to the ER Diagram displayed below: College Management System

Question 1
Choose the query to display names of the department in the college ordered in department_name in ascending order.
(a) select department_name from Department order by department_name asc;
Question 2
What will be the result of below query, if the question is to display entire details present in Student table ordered in descending order based on student id.

select student_id, student_name, address, city, department_id from Student order by student_id;
(a) Wrong Answer
Question 3
Fill the blank space, such that below query is used to display entire details present in Student table ordered in descending order based on student id.

select * from _____ order by student_id ______;
(b) Student, desc
Question 4
Fill the blank space, such that below query is used to display the unique city details present in Student table.

select ______ city from Student;
(a) distinct
Question 5
Choose the query to display entire details of the Subject table sorted in ascending order based on subject_id and then in descending order based on staff_id.
(b) select * from Subject order by subject_id, staff_id desc;

Post a Comment