Sql(Computer Science ) Questions and Answers

Question 1. 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?
  1.    SELECT name FROM staffinfo WHERE salary BETWEEN 10000 AND 25000;
  2.    SELECT name FROM staffinfo WHERE salary IN (10000, 25000);
  3.    Both A and B
  4.    None of the above
Explanation:-
Answer: Option B. -> SELECT name FROM staffinfo WHERE salary IN (10000, 25000);

Question 2. Select the right statement to insert values to the student table.
  1.    INSERT student VALUES (
  2.    INSERT VALUES (
  3.    INSERT INTO student VALUES (
  4.    INSERT VALUES INTO student (
Explanation:-
Answer: Option C. -> INSERT INTO student VALUES (

Question 3. ............. joins two or more tables based on a specified column value not equaling a specified column value in another table.
  1.    EQUIJOIN
  2.    NON-EQUIJOIN
  3.    OUTER JOIN
  4.    NATURAL JOIN
Explanation:-
Answer: Option B. -> NON-EQUIJOIN

Question 4. In SQL, which command is used to change a table's storage characteristics?
  1.    ALTER TABLE
  2.    MODIFY TABLE
  3.    CHANGE TABLE
  4.    None of these
Explanation:-
Answer: Option A. -> ALTER TABLE

Question 5. In SQL, which of the following is not a data definition language commands?
  1.    REVOKE
  2.    RENAME
  3.    UPDATE
  4.    GRANT
Explanation:-
Answer: Option C. -> UPDATE

Question 6. 'AS' clause is used in SQL for
  1.    Selection operation.
  2.    Rename operation.
  3.    Join operation.
  4.    Projection operation.
Explanation:-
Answer: Option B. -> Rename operation.

Question 7. Count function in SQL returns the number of
  1.    values.
  2.    distinct values.
  3.    groups.
  4.    columns.
Explanation:-
Answer: Option A. -> values.

Question 8. NULL is
  1.    the same as 0 for integer
  2.    the same as blank for character
  3.    the same as 0 for integer and blank for character
  4.    not a value
Explanation:-
Answer: Option D. -> not a value

Question 9. Which of the following is a valid SQL type?
  1.    CHARACTER
  2.    NUMERIC
  3.    FLOAT
  4.    All of the above
Explanation:-
Answer: Option D. -> All of the above

Question 10. What is the full form of SQL?
  1.    Structured Query Language
  2.    Structured Query List
  3.    Simple Query Language
  4.    None of these
Explanation:-
Answer: Option A. -> Structured Query Language