Sql Miscellaneous(Sql ) Questions and Answers

Question 1. 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
SQL (Structured Query Language) is a special-purpose programming language designed for managing data held in a relational database management system (RDBMS).
Originally based upon relational algebra and tuple relational calculus, SQL consists of a data definition language and a data manipulation language. The scope of SQL includes data insert, query, update and delete, schema creation and modification, and data access control.

Question 2. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
  1.    Data Definition Language(DDL)
  2.    Data Manipulation Language(DML)
  3.    Both of above
  4.    None
Explanation:-
Answer: Option A. -> Data Definition Language(DDL)
The Data Definition Language (DDL) is used to manage table and index structure.
CREATE, ALTER, RENAME, DROP and TRUNCATE statements are the names of few data definition elements.

Question 3. What operator tests column for the absence of data?
  1.    EXISTS operator
  2.    NOT operator
  3.    IS NULL operator
  4.    None of these
Explanation:-
Answer: Option C. -> IS NULL operator
Always use IS NULL to look for NULL values.
Syntax:
SELECT "column_name"
FROM "table_name"
WHERE "column_name" IS NULL

Question 4. In SQL, which command(s) is(are) used to change a table's storage characteristics?
  1.    ALTER TABLE
  2.    MODIFY TABLE
  3.    CHANGE TABLE
  4.    All of the above
Explanation:-
Answer: Option A. -> ALTER TABLE
To change the structure of the table we use ALTER TABLE.
Sytax:
ALTER TABLE "table_name"
ADD "column_name" datatype
OR
ALTER TABLE "table_name"
DROP COLUMN "column_name"
etc..

Question 5. Which operator performs pattern matching?
  1.    BETWEEN operator
  2.    LIKE operator
  3.    EXISTS operator
  4.    None of these
Explanation:-
Answer: Option B. -> LIKE operator
LIKE is a keyword that is used in the WHERE clause. Basically, LIKE allows us to do a search based operation on a pattern rather than specifying exactly what is desired (as in IN) or spell out a range (as in BETWEEN).
The syntax is as follows:
SELECT "column_name"
FROM "table_name"
WHERE "column_name" LIKE {PATTERN}
{PATTERN} often consists of wildcards. In SQL, there are two wildcards:
1=% (percent sign) represents zero, one, or more characters.
2=_ (underscore) represents exactly one character.

Question 6. 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 7. 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 8. 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 9. ............. 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 10. 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 (