CBSE Class 12 Computer Science Question 58 of 78

Simple Queries in SQL — Question 12

Back to all questions
12
Question

Question 12

............... clause of the following query must be added with keyword ............... to display the fields given in the select list as per a given condition.

SELECT ID, name, dept name, salary * 1.1
WHERE instructor = 1005 ;
  1. where, having
  2. select, from
  3. where, from
  4. where, select
Answer

select, from

Reason — In SQL, the SELECT clause is used to retrieve a subset of rows and columns from one or more tables, while the FROM clause specifies the table from which the data should be retrieved. Therefore, to complete the query, the FROM clause must be added after the SELECT keyword. The corrected query is as follows :

SELECT ID, name, dept name, salary * 1.1
FROM <table_name>
WHERE instructor = 1005 ;