SQL/SQL MCQ SET 18 Sample Test,Sample questions

Question:
 A command that lets you change one or more field in a table is:

1.INSERT

2.MODIFY

3.LOOK-UP

4.All of the above

Posted Date:-2021-07-19 00:03:56


Question:
 A sequence in SQL can generate a maximum number:

1.39 digits

2.38 digits

3.40 digits

4.37 digits

Posted Date:-2021-07-19 00:03:56


Question:
 Group of operations that form a single logical unit of work is known as

1.View

2.Network

3.Unit

4.Transaction

Posted Date:-2021-07-19 00:03:56


Question:
 Shared locks are applied while performing

1.Read operations

2.Write operations

3.A & B both

4.None of the above

Posted Date:-2021-07-19 00:03:56


Question:
 SQL Views are also known as

1.Simple tables

2.Virtual tables

3.Complex tables

4.Actual Tables

Posted Date:-2021-07-19 00:03:56


Question:
 What is the difference between a PRIMARY KEY and a UNIQUE KEY?

1.Primary key can store null value, whereas a unique key cannot store null value.

2.We can have only one primary key in a table while we can have multiple unique keys

3.Primary key cannot be a date variable whereas unique key can be

4.None of these

Posted Date:-2021-07-19 00:03:56


Question:
 What operator tests column for absence of data

1.NOT Operator

2.Exists Operator

3.IS NULL Operator

4.None of the above

Posted Date:-2021-07-19 00:03:56


Question:
 Which command is used to change the definition of a table in SQL?

1.CREATE

2.UPDATE

3.ALTER

4.SELECT

Posted Date:-2021-07-19 00:03:56


Question:
 Which data manipulation command is used to combines the records from one or more tables?

1.SELECT

2.PROJECT

3.JOIN

4.PRODUCT

Posted Date:-2021-07-19 00:03:56


Question:
 Which of the following is also called an INNER JOIN?

1.SELF JOIN

2.EQUI JOIN

3.NON-EQUI JOIN

4.None of the above

Posted Date:-2021-07-19 00:03:56


Question:
 Which of the following is not a valid aggregate function?

1.COUNT

2.COMPUTE

3.SUM

4.MAX

Posted Date:-2021-07-19 00:03:56


Question:
 Which of the following is not Constraint in SQL?

1.Primary Key

2.Not Null

3.Check

4.Union

Posted Date:-2021-07-19 00:03:56


Question:
 Which of the following is true about the HAVING clause?

1.Similar to the WHERE clause but is used for columns rather than groups.

2.Similar to WHERE clause but is used for rows rather than columns.

3.Similar to WHERE clause but is used for groups rather than rows.

4.Acts exactly like a WHERE clause.

Posted Date:-2021-07-19 00:03:56


Question:
 Which statement is true regarding procedures?

1.They include procedural and SQL statements.

2.They work similarly to the functions.

3.It does not need unique names.

4.It cannot be created with SQL statements.

Posted Date:-2021-07-19 00:03:56


Question:
A CASE SQL statement is ________?

1.A way to establish a loop in SQL.

2.A way to establish an IF-THEN-ELSE in SQL

3.A way to establish a data definition in SQL

4.All of the above.

Posted Date:-2021-07-19 00:03:56


Question:
How many Primary keys can have in a table?

1.Only 1

2.Only 2

3.Depends on no of Columns

4.Depends on DBA

Posted Date:-2021-07-19 00:03:56


Question:
If we have not specified ASC or DESC after a SQL ORDER BY clause, the following is used by default

1.DESC

2.ASC

3.There is no default value

4.None of the mentioned

Posted Date:-2021-07-19 00:03:56


Question:
In which of the following cases a DML statement is not executed?

1.When existing rows are modified.

2.When a table is deleted.

3.When some rows are deleted.

4.All of the above

Posted Date:-2021-07-19 00:03:56


Question:
Sequence can generate

1.Numeric value

2.Alphanumeric value

3.A & B both

4.None of the above

Posted Date:-2021-07-19 00:03:56


Question:
The SQL statement: SELECT ROUND (65.726, -1) FROM DUAL;  
Prints:

1.is illegal

2.garbage

3.726

4.70

Posted Date:-2021-07-19 00:03:56


Question:
What is the advantage of the clustered index?

1.It is fast to update the records.

2.It does not need extra work for SQL queries.

3.It minimizes the page transfer and maximizes the cache hits.

4.None of the above is correct.

Posted Date:-2021-07-19 00:03:56


Question:
What is the full form of SQL?

1. Structured Query List

2.Structure Query Language

3.Sample Query Language

4.None of these.

Posted Date:-2021-07-19 00:03:56


Question:
What is the need for our query to execute successfully on an existing view?

1.The specified table must contain data.

2.We must have a SELECT privilege on the view.

3.We should have a SELECT privilege only on the specified table.

4.The specified table must be in the same database or schema.

Posted Date:-2021-07-19 00:03:56


Question:
When the wildcard in a WHERE clause is useful?

1.When an exact match is required in a SELECT statement.

2.When an exact match is not possible in a SELECT statement.

3.When an exact match is required in a CREATE statement.

4.When an exact match is not possible in a CREATE statement.

Posted Date:-2021-07-19 00:03:56


Question:
Which data dictionary table can be used to show the object privileges granted to the user on specific columns?

1.USER_TAB_PRIVS_MADE

2.USER_COL_PRIVS_MADE

3.USER_TAB_PRIVS

4.USER_COL_PRIVS

Posted Date:-2021-07-19 00:03:56


Question:
Which datatype can store unstructured data in a column?

1.CHAR

2.RAW

3.NUMERIC

4.VARCHAR

Posted Date:-2021-07-19 00:03:56


Question:
Which of the following are TCL commands?

1.COMMIT and ROLLBACK

2.UPDATE and TRUNCATE

3.SELECT and INSERT

4.GRANT and REVOKE

Posted Date:-2021-07-19 00:03:56


Question:
Which of the following are the DATETIME data types that can be used in column definitions?

1.TIMESTAMP

2.INTERVAL MONTH TO DAY

3.INTERVAL YEAR TO MONTH

4.TIMESTAMP WITH DATABASE TIMEZONE

Posted Date:-2021-07-19 00:03:56


Question:
Which of the following is not a DDL command?

1.TRUNCATE

2.ALTER

3.CREATE

4.UPDATE

Posted Date:-2021-07-19 00:03:56


Question:
Which of the following is not a valid SQL type?

1.FLOAT

2.NUMERIC

3.DECIMAL

4.CHARACTER

Posted Date:-2021-07-19 00:03:56


Question:
Which of the following is the basic approaches for joining tables?

1.Union JOIN

2.Natural JOIN

3.Subqueries

4.All of the above

Posted Date:-2021-07-19 00:03:56


Question:
Which of the following is the correct order of a SQL statement?

1.SELECT, GROUP BY, WHERE, HAVING

2.SELECT, WHERE, GROUP BY, HAVING

3.SELECT, HAVING, WHERE, GROUP BY

4.SELECT, WHERE, HAVING, GROUP BY

Posted Date:-2021-07-19 00:03:56


Question:
Which of the following is true about the SQL AS clause?

1.The AS clause in SQL is used to change the column name in the output or assign a name to a derived column.

2.The SQL AS clause can only be used with the JOIN clause.

3.The AS clause in SQL is used to defines a search condition.

4.All of the mentioned

Posted Date:-2021-07-19 00:03:56


Question:
Which of the following operator can be used with a multiple-row subquery?

1.=

2.BETWEEN

3.NOT IN

4.<>

Posted Date:-2021-07-19 00:03:56


Question:
Which operator is used to compare a value to a specified list of values?

1.ANY

2.BETWEEN

3.ALL

4.IN

Posted Date:-2021-07-19 00:03:56


Question:
Which operator is used to compare the NULL values in SQL?

1.Equal

2.IN

3.IS

4.None of Above

Posted Date:-2021-07-19 00:03:56


Question:
Which statement is true regarding routines and triggers?

1.Both run automatically.

2.Both are stored in the database.

3.Both consist of procedural code.

4.Both have to be called to operate.

Posted Date:-2021-07-19 00:03:56


Question:
Which statement is used to delete all rows in a table without having the action logged?

1.DELETE

2.REMOVE

3.DROP

4.TRUNCATE

Posted Date:-2021-07-19 00:03:56


Question:
Which type of JOIN is used to returns rows that do not have matching values?

1.Natural JOIN

2.Outer JOIN

3.EQUI JOIN

4.All of the above

Posted Date:-2021-07-19 00:03:56


Question:
Why we need to create an index if the primary key is already present in a table?

1.Index improves the speed of data retrieval operations on a table.

2.Indexes are special lookup tables that will be used by the database search engine.

3.Indexes are synonyms of a column in a table.

4.All of the above

Posted Date:-2021-07-19 00:03:56


Question:
____ command makes the updates performed by the transaction permanent in the database?

1.ROLLBACK

2.COMMIT

3.TRUNCATE

4.DELETE

Posted Date:-2021-07-19 00:03:56


Question:
_____ is NOT a type of constraint in SQL language?

1.FOREIGN KEY

2.PRIMARY KEY

3.UNIQUE

4.ALTERNATE KEY

Posted Date:-2021-07-19 00:03:56


Question:
______ clause creates temporary relation for the query on which it is defined.

1.WITH

2.FROM

3.WHERE

4.SELECT

Posted Date:-2021-07-19 00:03:56


Question:
______ is a program that performs some common action on database data and also stored in the database.

1.Stored Procedure

2.Trigger

3.Stored Function

4.None of the above

Posted Date:-2021-07-19 00:03:56


More MCQS

  1. SQL MCQ SET 1
  2. SQL MCQ SET 2
  3. SQL MCQ SET 3
  4. SQL MCQ SET 4
  5. SQL MCQ SET 5
  6. SQL MCQ SET 6
  7. SQL MCQ SET 7
  8. SQL MCQ SET 8
  9. SQL MCQ SET 9
  10. SQL MCQ SET 10
  11. SQL MCQ SET 11
  12. SQL MCQ SET 12
  13. SQL MCQ SET 13
  14. SQL MCQ SET 14
  15. SQL MCQ SET 15
  16. SQL MCQ SET 16
  17. SQL MCQ SET 17
  18. SQL MCQ SET 18
  19. MCQ | SQL – Basics
  20. MCQ | SQL – Data Types
  21. SQL Server DBA Multiple Choice Questions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!