SQL MCQ’S

Results

-
Congratulations! You have successfully passed the Quiz.

Sorry! You have doesn’t passed the Quiz. Please try again later.

HD Quiz powered by harmonic design

#1. What is the full form of SQL?

Answer: Option A
Solution: 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.

#2. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?

Answer: Option A
Solution: 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.

#3. Which operator performs pattern matching?

Answer: Option B
Solution: 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.

#4. What operator tests column for the absence of data? A.

Answer: Option C
Solution: Always use IS NULL to look for NULL values.

Syntax:

SELECT “column_name”
FROM “table_name”
WHERE “column_name” IS NULL

#5. In SQL, which command(s) is(are) used to change a table’s storage characteristics?

Answer: Option A
Solution: 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..

#6. In SQL, which of the following is not a data definition language commands?

Answer: Option D
Solution:

RENAME: – With RENAME statement you can rename a table.
REVOKE: – The REVOKE command removes user access rights or privileges to the database objects.
GRANT: – In SQL GRANT is a command used to provide access or privileges on the database objects to the users.
UPDATE: – The UPDATE Statement is used to modify the existing rows in a table.

RENAMEREVOKE and GRANT are DDL(Data Definition Language) commands and UPDATE is DML(Data Manipulation Language) command.

#7. In SQL, which command is used to SELECT only one copy of each set of duplicable rows

Answer: Option A
Solution: The SELECT keyword allows us to grab all information from a column (or columns) on a table. This, of course, necessarily means that there will be redundancies. What if we only want to select each distinct element? This is easy way to accomplish in SQL. All we need to do is that to add DISTINCT after SELECT. The syntax is as follows:

SELECT DISTINCT column_name
FROM table_name;

#8. A command that lets you change one or more fields in a record is

Answer: Option B
Solution: Sometimes we need to change the data type of a column. To do this, we use the ALTER TABLE Modify Column command.
Sytax:
ALTER TABLE table_name
MODIFY column_name “New Data Type”

#9. Which of the SQL statements is correct?

Answer: Option B
Solution:

Correct order of SELECT, FROM and WHERE clause is as follow:
SELECT column_name1, column_name2, ….
FROM table_name
WHERE condition

So, only
SELECT Username, Password FROM Users
follows the above syntax.

#10. The FROM SQL clause is used to…

Answer: Option A
No explanation is given for this question
finish