Top SQL MCQ
Top SQL MCQ
A. Update Records
B. Insert Records
C. Both A and B
D. None of the above
Explanation:
SQL (Structured Query Language) is used to update, insert, delete, create, modify, and
maintain the records stored in the database.
Explanation:
SQL database language is designed to maintain the data in relational database management
systems.
A. ASCII
B. ANSI
C. ISO
D. Both B and C
Explanation:
SQL became the standard of ANSI and ISO in the year 1986 and 1987 respectively.
A. Using SQL in relational databases is all about inserting, updating, and deleting data.
B. Sample data can also be described with the aid of this tool.
C. It helps develop relational database functions, events, and views.
D. A SQL user can also set restrictions and permissions for a table column, a view, and a
stored procedure.
Answer: B) Sample data can also be described with the aid of this tool
Explanation:
Structured data can also be described with the aid of this tool.
A. Optimization Engines
B. SQL Query Engines
C. Query Dispatchers
D. All of the above
Explanation:
The SQL query process consists of components such as Optimization Engines, SQL Query
Engines, and Query Dispatchers, etc.
A. CREATE
B. UPDATE
C. DELETE
D. All of the above
Explanation:
Commonly used SQL commands are CREATE, UPDATE, and DELETE, etc.
A. Using this command, you can remove or erase recorded information from a database
table.
B. It enables you to create new databases, tables, table views, and other objects using
this command.
C. Inserting records or data into the database tables is accomplished with this command.
In addition to inserting records in single rows, we can insert records in multiple rows
as well.
D. A single or multiple rows can be accessed using this command from one or more
tables of a database. Using the WHERE clause with this command is also possible.
Answer: B) It enables you to create new databases, tables, table views, and other objects
using this command
Explanation:
INSERT command enables you to create new databases, tables, table views, and other
objects.
A. A single or multiple rows can be accessed using this command from one or more
tables of a database. Using the WHERE clause with this command is also possible.
B. Using this command, you can remove or erase recorded information from a database
table.
C. Database data can be updated or changed using this command.
D. It enables you to create new databases, tables, table views, and other objects using
this command.
Explanation:
A. A single or multiple rows can be accessed using this command from one or more
tables of a database. Using the WHERE clause with this command is also possible.
B. Database data can be updated or changed using this command.
C. Database objects such as tables, table views, and other objects can be deleted using
this command.
D. Using this command, you can remove or erase recorded information from a database
table.
Answer: D) Using this command, you can remove or erase recorded information from a
database table
Explanation:
Using DELETE command, you can remove or erase recorded information from a database
table.
A. Database objects such as tables, table views, and other objects can be deleted using
this command.
B. Database objects such as tables, table views, and other objects can be deleted using
this command.
C. One or more rows from one or more tables of the database can be accessed with this
command. Using the WHERE clause with this command is also possible.
D. It enables you to create new databases, tables, table views, and other objects using
this command.
Answer: C) One or more rows from one or more tables of the database can be accessed with
this command. Using the WHERE clause with this command is also possible
Explanation:
Using the SELECT command, one or more rows from one or more tables of the database can
be accessed. Using the WHERE clause with this command is also possible.
A. Using this command, you can remove or erase recorded information from a database
table.
B. Database objects such as tables, table views, and other objects can be deleted using
this command.
C. One or more rows from one or more tables of the database can be accessed with this
command. Using the WHERE clause with this command is also possible.
D. It enables you to create new databases, tables, table views, and other objects using
this command.
Answer: B) Database objects such as tables, table views, and other objects can be deleted
using this command
Explanation:
Using the DROP command, Database objects such as tables, table views, and other objects
can be deleted.
A. Inserting records or data into the database tables is accomplished with this command.
In addition to inserting records in single rows, we can insert records in multiple rows
as well.
B. Database objects such as tables, table views, and other objects can be deleted using
this command.
C. One or more rows from one or more tables of the database can be accessed with this
command. Using the WHERE clause with this command is also possible.
D. It enables you to create new databases, tables, table views, and other objects using
this command.
Answer: A) Inserting records or data into the database tables is accomplished with this
command. In addition to inserting records in single rows, we can insert records in multiple
rows as well
Explanation: Using the INSERT command, inserting records or data into the database tables
is accomplished. In addition to inserting records in single rows, we can insert records in
multiple rows as well.
14. Which statement is not true?
Answer: B) SQL follows BASE Model whereas No-SQL follows ACID Model
Explanation:
Explanation:
SQL is vertically scalable. SQL follows the ACID Model. SQL database can easily handle
complex queries. SQL database does require object-relational mapping.
Answer: C) Dynamic schemas for unstructured data are used in No-SQL databases
Explanation: Dynamic schemas for unstructured data are used in No-SQL databases. No-SQL
follows BASE Model. No-SQL does not require object-relational mapping. No-SQL databases
are preferable for the storage of hierarchal data.
17. SQL has the advantage of?
Explanation:
A. SQL is cheap.
B. SQL interface is simple.
C. Both A and B.
D. None of the above.
Explanation:
SQL has the disadvantage that it is costly and its interface is complex.
Explanation:
SQL has the disadvantage of Partial Database Control which means that the business rules are
hidden and the users or professionals can't have full control over the database.
20. What is meant by 'SQL is an interactive language'?
Explanation:
SQL is an interactive language – it means that learning and understanding SQL is easy, it can
also be used for communicating with the database and In a few seconds, complex queries can
also be answered using this language.
A. Case-sensitive
B. Not case-sensitive
Explanation:
A. There is no difference between a lower case and upper case keyword in SQL.
B. It is easier to read SQL queries when the keywords are in lowercase.
C. An SQL statement's syntax is determined by its text line.
D. One or more SQL statements can be placed on a single line of text.
Answer: B) It is easier to read SQL queries when the keywords are in lowercase
Explanation:
Explanation:
SQL statements are used for most operations in a database and Relational algebra and tuple
relationship calculus are needed for SQL syntax.
A. SELECT Statement
B. UPDATE Statement
C. TRUNCATE TABLE Statement
D. FROM Statement
Explanation:
A. Data is read from the SQL database by this statement and displayed to the database
user.
B. The stored data in the SQL database is changed or modified by this SQL statement.
C. By deleting the stored data, this SQL statement deletes the database.
D. A new table in SQL is created using this SQL statement.
Answer: A) Data is read from the SQL database by this statement and displayed to the
database user
Explanation:
Using SELECT Statement, Data is read from the SQL database and displayed to the database
user.
A. By deleting the stored data, this SQL statement deletes the database.
B. A new table in SQL is created using this SQL statement.
C. The stored data in the SQL database is changed or modified by this SQL statement.
D. Columns in the SQL database can be created, deleted, or modified with this SQL
statement.
Answer: C) The stored data in the SQL database is changed or modified by this SQL statement
Explanation:
The stored data in the SQL database is changed or modified by UPDATE SQL statement.
Answer: B) By deleting the stored data, this SQL statement deletes the database
Explanation:
By deleting the stored data, DELETE SQL statement deletes the database.
A. The stored data in the SQL database is changed or modified by this SQL statement.
B. By deleting the stored data, this SQL statement deletes the database.
C. A new table in SQL is created using this SQL statement.
D. Columns in the SQL database can be created, deleted, or modified with this SQL
statement.
Explanation:
A. By deleting the stored data, this SQL statement deletes the database.
B. Columns in the SQL database can be created, deleted, or modified with this SQL
statement.
C. A new table in SQL is created using this SQL statement.
D. The table, its structure, views, permissions, and triggers will also be deleted or
removed with this SQL statement.
Answer: B) Columns in the SQL database can be created, deleted, or modified with this SQL
statement
Explanation:
Columns in the SQL database can be created, deleted, or modified with ALTER TABLE SQL
statement.
A. The table, its structure, views, permissions, and triggers will also be deleted or
removed with this SQL statement.
B. A new table in SQL is created using this SQL statement.
C. Columns in the SQL database can be created, deleted, or modified with this SQL
statement.
D. A new database will be created through this SQL statement.
Answer: A) The table, its structure, views, permissions, and triggers will also be deleted or
removed with this SQL statement
Explanation:
The table, its structure, views, permissions, and triggers will also be deleted or removed with
DROP TABLE SQL statement.
A. Columns in the SQL database can be created, deleted, or modified with this SQL
statement.
B. The table, its structure, views, permissions, and triggers will also be deleted or
removed with this SQL statement.
C. In the database management system, this SQL statement deletes the existing
database, together with all the database tables and views.
D. A new database will be created through this SQL statement.
Explanation:
A. The table, its structure, views, permissions, and triggers will also be deleted or
removed with this SQL statement.
B. In the database management system, this SQL statement deletes the existing
database, together with all the database tables and views.
C. A new database will be created through this SQL statement.
D. In this SQL statement, the data or records are inserted into an existing database table.
One query statement can insert multiple records simultaneously using this statement.
Answer: B) In the database management system, this SQL statement deletes the existing
database, together with all the database tables and views
Explanation:
In the database management system, DROP DATABASE SQL statement deletes the existing
database, together with all the database tables and views.
A. In this SQL statement, the data or records are inserted into an existing database table.
One query statement can insert multiple records simultaneously using this statement.
B. A new database will be created through this SQL statement.
C. In the database management system, this SQL statement deletes the existing
database, together with all the database tables and views.
D. By executing this SQL statement, all records in the SQL database will be deleted.
Answer: A) In this SQL statement, the data or records are inserted into an existing database
table. One query statement can insert multiple records simultaneously using this statement
Explanation:
In INSERT INTO SQL statement, the data or records are inserted into an existing database
table. One query statement can insert multiple records simultaneously using this statement.
A. In the database management system, this SQL statement deletes the existing
database, together with all the database tables and views.
B. In this SQL statement, the data or records are inserted into an existing database table.
One query statement can insert multiple records simultaneously using this statement.
C. By executing this SQL statement, all records in the SQL database will be deleted.
D. The data specified in this table or view is reported in this SQL statement.
Answer: C) By executing this SQL statement, all records in the SQL database will be deleted
Explanation:
By executing TRUNCATE TABLE SQL statement, all records in the SQL database will be
deleted.
15. What does the DESCRIBE Statement do?
A. In this SQL statement, the data or records are inserted into an existing database table.
One query statement can insert multiple records simultaneously using this statement.
B. By executing this SQL statement, all records in the SQL database will be deleted.
C. Specify the columns of the table in this SQL statement to return distinct values.
D. The data specified in this table or view is reported in this SQL statement.
Answer: D) The data specified in this table or view is reported in this SQL statement
Explanation:
The data specified in this table or view is reported in DESCRIBE SQL statement.
A. Specify the columns of the table in this SQL clause to return distinct values.
B. By executing this SQL statement, all records in the SQL database will be deleted.
C. The data specified in this table or view is reported in this SQL statement.
D. Changes made in the SQL database transaction are permanently saved using this SQL
statement.
Answer: A) Specify the columns of the table in this SQL clause to return distinct values
Explanation:
Specify the columns of the table in DISTINCT SQL clause to return distinct values.
A. The data specified in this table or view is reported in this SQL statement.
B. Changes made in the SQL database transaction are permanently saved using this SQL
statement.
C. Specify the columns of the table in this SQL statement to return distinct values.
D. By running this SQL statement, the transaction will be undone and the operations not
yet saved to the SQL database will be undone.
Answer: B) Changes made in the SQL database transaction are permanently saved using this
SQL statement
Explanation:
Changes made in the SQL database transaction are permanently saved using COMMIT SQL
statement.
A. Specify the columns of the table in this SQL statement to return distinct values.
B. Changes made in the SQL database transaction are permanently saved using this SQL
statement.
C. By running this SQL statement, the transaction will be undone and the operations not
yet saved to the SQL database will be undone.
D. An index is created in a SQL database table with this SQL statement.
Answer: C) By running this SQL statement, the transaction will be undone and the operations
not yet saved to the SQL database will be undone
Explanation:
By running ROLLBACK SQL statement, the transaction will be undone and the operations not
yet saved to the SQL database will be undone.
Answer: A) An index is created in a SQL database table with this SQL statement
Explanation:
An index is created in a SQL database table with CREATE INDEX SQL statement.
A. By running this SQL statement, the transaction will be undone and the operations not
yet saved to the SQL database will be undone.
B. The SQL database table's index is deleted using this SQL statement.
C. An index is created in a SQL database table with this SQL statement.
D. An existing SQL database is selected with this SQL statement. A database must be
selected from several existing databases before you can perform operations on the
table.
Answer: B) The SQL database table's index is deleted using this SQL statement
Explanation:
The SQL database table's index is deleted using DROP INDEX SQL statement.
MCQ | SQL – Data Types
1. In the database table, data types describe the kind of ___ that it can contain.
A. Table
B. Data
C. Number
D. None of the above
Answer: B) Data
Explanation:
In the database table, data types describe the kind of Data that they can contain.
A. 2
B. 3
C. 4
D. 5
Answer: B) 3
Explanation:
Explanation:
Data types are classified into 3 categories named as String, numeric, and date and time
category.
4. Which of the following is not MySQL String Data Type?
A. TEXT(Size)
B. TINYTEXT
C. MEDIUMTEXT
D. LARGETEXT
Answer: D) LARGETEXT
Explanation:
MySQL String Data Types are TEXT(Size), TINYTEXT, MEDIUMTEXT, and LONGTEXT.
A. BIT(Size)
B. CHAR(Size)
C. INTEGER(Size)
D. INT(Size)
Answer: B) CHAR(Size)
Explanation:
6. Which of the following are not MySQL Date and Time Data Type?
A. DATE
B. TIME(fsp)
C. YEAR
D. None of the above
Explanation:
MySQL Date and Time Data Types are DATE, TIME(fsp), and YEAR.
A. ntext
B. binary(n)
C. varbinary
D. All of the above
Explanation:
SQL Server String Data Types are ntext, binary(n), and varbinary.
A. image
B. nchar
C. money
D. cursor
Answer: C) money
Explanation:
9. Which of the following is SQL Server Date and Time Data Type?
A. timestamp
B. sql_variant
C. real
D. text
Answer: a) timestamp
Explanation:
A. 254
B. 255
C. 256
D. 257
Answer: B) 255
Explanation:
Explanation:
12. How MySQL determines which one to use, FLOAT or DOUBLE, using the p parameter?
Answer: D) If p comes between 0 to 24, data type becomes FLOAT(). If p comes between 25
to 53, data type becomes DOUBLE()
Explanation:
MySQL determines to use FLOAT or DOUBLE using the p parameter. If p comes between 0 to
24, the data type becomes FLOAT(). If p comes between 25 to 53, the data type
becomes DOUBLE().
Explanation:
A Boolean value is specified by this variable. When a value is nonzero, it is considered true,
and zero is considered false.
14. What can be the maximum size of char(n) in SQL Server String Data Type?
A. 7000
B. 8000
C. 9000
D. 10000
Answer: B) 8000
Explanation:
A maximum of 8000 characters is the size of char(n) in SQL Server String Data Types.
Explanation:
nchar is fixed and nvarchar is variable width Unicode string data type.
Answer: C) nvarchar can be of the maximum size upto 4000 characters and ntext can be of
the maximum size upto 2GB of the text data
Explanation:
nvarchar can be of the maximum size upto 4000 characters and ntext can be of the maximum
size upto 2GB of the text data.
A. 0
B. 1
C. Null
D. All of the above
Explanation:
Explanation:
19. What is the similarity between CLOB and NCLOB Oracle Large Object Data Types?
A. Both CLOB and NCLOB are used for multibyte national character set data.
B. Both CLOB and NCLOB can range upto 2^32-1 bytes or 4 GB.
C. Both CLOB and NCLOB can range upto 2^32-1 bytes or 8GB.
D. Both CLOB and NCLOB are used for singlebyte and multibyte national character set
data.
Answer: B) Both CLOB and NCLOB can range upto 2^32-1 bytes or 4 GB
Explanation:
Both CLOB and NCLOB can range upto 2^32-1 bytes or 4 GB.
A. VARCHAR can store upto 4000 bytes and VARCHAR2 can store upto 8000 bytes.
B. VARCHAR can store upto 2000 bytes and VARCHAR2 can store upto 4000 bytes.
C. Both VARCHAR and VARCHAR2 are similar but use of VARCHAR2 is mostly
recommended.
D. There is no similarity between VARCHAR and VARCHAR2.
Answer: C) Both VARCHAR and VARCHAR2 are similar but use of VARCHAR2 is mostly
recommended
Explanation:
Both VARCHAR and VARCHAR2 are similar but use of VARCHAR2 is mostly recommended.
1. Using a WHERE clause in a SQL query is used to specify SQL reserved words and characters,
known as ____?
A. Operators
B. Data Types
C. Numbers
D. Syntax
Answer: A) Operators
Explanation:
Using a WHERE clause in a SQL query is used to specify SQL reserved words and characters,
known as Operators.
A. Unary
B. Binary
C. Both A and B
D. None of the above
Explanation:
A. 1
B. 2
C. 3
D. 4
Answer: A) 1
Explanation:
A. 1
B. 2
C. 3
D. 4
Answer: B) 2
Explanation:
Explanation:
6. When an expression includes ___ SQL operator(s), the sequence in which they are
evaluated is known as the SQL operator's precedence.
A. 0
B. 1
C. Multiple
D. NULL
Answer: C) Multiple
Explanation:
When an expression includes Multiple SQL operators, the sequence in which they are
evaluated is known as the SQL operator's precedence.
Explanation:
The precedence-high operators are evaluated first in SQL and precedence-low operators are
evaluated last in SQL.
Explanation:
Exponentiation operator (**) > Identity operator (+) > Logical Negation Operator (NOT) >
Inclusion Operator (OR).
Explanation:
Comparison Operator has higher precedence than Conjunction Operator and Identity
Operator has higher precedence than Multiplication Operator.
10. Which of these are the types of operators?
A. Arithmetic
B. Comparison
C. Set
D. All of the above
Explanation:
A. Addition
B. Subtraction
C. Unary
D. Modulus
Answer: C) Unary
Explanation:
Addition, Subtraction and Modulus are all the SQL Arithmetic Operators.
12. Which of the following statement is TRUE for SQL Additional Operator?
A. SELECT operand1-operand2;
B. SELECT operand1*operand2;
C. SELECT operand1+operand2;
D. SELECT operand1>operand2;
Explanation:
13. The numerical values of two ___ of the ___ table can be easily subtracted using SQL
Subtraction Operator.
A. Rows, same
B. Columns, same
C. Rows, different
D. Columns, different
The numerical values of two columns of the same table can be easily subtracted using SQL
Subtraction Operator.
14. Which of the following statement is correct for SQL Multiplication Operator?
A. SELECT Operand1+Operand2;
B. SELECT Operand1*Operand2;
C. SELECT Operand1**Operand2;
D. SELECT Operand1<Operand2;
Explanation:
15. SQL Division operator divides the operand on the ____ side by the operand on the ____
side.
A. Left, Left
B. Right, Left
C. Left, Right
D. Right, Right
Explanation:
SQL Division operator divides the operand on the left side by the operand on the right side.
A. Quotient
B. Percentage
C. Sum
D. Reminder
Answer: D) Reminder
Explanation:
Explanation:
SQL Equal Operator (=), SQL Less Than Operator (<), and SQL Greater Than Operator (>) are
all SQL Comparison Operators.
18. Using which SQL Comparison Operator can we find the data that matches our query?
Explanation:
Using SQL Equal Operator from SQL Comparison Operators, we can find the data that
matches our query.
Explanation:
SQL ALL, SQL OR and SQL LIKE are all SQL Logical Operators.
Explanation:
SQL ANY, SQL BETWEEN, and SQL IN Operators are all SQL Logical Operators.
A. DDL
B. DML
C. DCL
D. All of the above
Explanation:
Explanation:
A. CREATE
B. DROP
C. TRUNCATE
D. All of the above
Explanation:
Commands that come under DDL are CREATE, ALTER, DROP, TRUNCATE & RENAME.
4. Full form of DML is –
Explanation:
A. Our data is stored in a table that is described by the schema, thus DDL commands
deal with the schema.
B. With the DDL commands, any structural changes can be made to the table, including
creation, deletion, and alteration.
C. Both A. and B.
D. None of the above
Explanation:
i. Our data is stored in a table that is described by the schema, thus DDL commands
deal with the schema.
ii. With the DDL commands, any structural changes can be made to the table, including
creation, deletion, and alteration.
A. ROLLBACK
B. GRANT
C. UPDATE
D. All of the above
Answer: C) UPDATE
Explanation:
Commands that comes under DML are INSERT, SELECT, UPDATE & DELETE.
7. Select the correct statement.
A. With the DDL commands, any structural changes can be made to the table, including
creation, deletion, and alteration.
B. With the DML commands, any structural changes can be made to the table, including
creation, deletion, and alteration.
C. With the DCL commands, any structural changes can be made to the table, including
creation, deletion, and alteration.
D. With the TCL commands, any structural changes can be made to the table, including
creation, deletion, and alteration.
Answer: A) With the DDL commands, any structural changes can be made to the table,
including creation, deletion, and alteration
Explanation:
With the DDL commands, any structural changes can be made to the table, including
creation, deletion, and alteration.
Explanation:
A. GRANT
B. REVOKE
C. Both A. and B.
D. None of the above
Explanation:
Explanation:
A. COMMIT
B. ROLLBACK
C. SAVEPOINT
D. All of the above
Explanation:
Commands that comes under TCL are COMMIT, ROLLBACK & SAVEPOINT.
Explanation:
In the case of the SAVEPOINT command, a specific part of a transaction can be given a name.
13. Following the completion of a transaction, it must be executed to save all the operations
performed in the transaction. Here we are talking about which command?
A. REVOKE
B. COMMIT
C. ROLLBACK
D. SAVE
Answer: B) COMMIT
Explanation:
Following the completion of a transaction, the COMMIT command must be executed to save
all the operations performed in the transaction.
A. The GRANT command can be used to grant a user access to databases and tables
whereas The REVOKE command can be used to revoke all access privileges already
assigned to the user.
B. The REVOKE command can be used to grant a user access to databases and tables
whereas The GRANT command can be used to revoke all access privileges already
assigned to the user.
C. A transaction can be rolled back to its last saved state.
D. None of the above
Answer: A) The GRANT command can be used to grant a user access to databases and tables
whereas The REVOKE command can be used to revoke all access privileges already assigned
to the user
Explanation:
The GRANT command can be used to grant a user access to databases and tables whereas
The REVOKE command can be used to revoke all access privileges already assigned to the
user.
A. The DCL commands in SQL allow us to control which users have access to the data
stored in SQL tables.
B. There will be certain privileges that each user has; consequently, the data can be
accessed by them.
C. The DCL commands in SQL allow us to grant privileges to a user on the SQL database
and its table(s), or revoke privileges that have already been granted.
D. All of the above
Explanation:
1. The DCL commands in SQL allow us to control which users have access to the data
stored in SQL tables.
2. There will be certain privileges that each user has; consequently, the data can be
accessed by them.
3. The DCL commands in SQL allow us to grant privileges to a user on the SQL database
and its table(s), or revoke privileges that have already been granted.
A. RETRIEVE
B. SELECT
C. CREATE
D. ALTER
Answer: B) SELECT
Explanation:
17. Which command will remove the records from the table, but not affect the structure of
the table?
A. REMOVE
B. DELETE
C. DROP
D. TRUNCATE
Answer: B) DELETE
Explanation:
The TRUNCATE command will remove the records from the table, but not affect the structure
of the table.
18. The records and structure of a table may be removed or deleted from the database using
which command?
A. REMOVE
B. DELETE
C. DROP
D. TRUNCATE
Answer: C) DROP
Explanation:
The records and structure of a table may be removed or deleted from the database using the
DROP command
19. Select the correct statement.
Explanation:
i. DDL consist of 5 commands, i.e., CREATE, ALTER, DROP, TRUNCATE & RENAME.
ii. DML consist of 4 commands, i.e., SELECT, INSERT, UPDATE & DELETE.
iii. DCL consist of 2 commands, i.e., GRANT & REVOKE.
iv. TCL consist of 3 commands, i.e., COMMIT, ROLLBACK & SAVEPOINT.
A. Transactions can be saved to the database and rolled back with the help of TCL
commands in SQL.
B. There will be certain privileges that each user has; consequently, the data can be
accessed by them using TCL.
C. Our data is stored in a table that is described by the schema, thus TCL commands deal
with the schema.
D. SQL TCL commands can be used to perform any kind of retrieval or manipulation of
the data present in SQL tables.
Answer: A) Transactions can be saved to the database and rolled back with the help of TCL
commands in SQL
Explanation:
Transactions can be saved to the database and rolled back with the help of TCL commands in
SQL.
A. In some cases you may not have any unique identifying characteristics in data;
therefore, it makes sense to create a Primary Key.
B. Explicitly initializing and modifying the auto-increment value is possible at any time.
C. Record identifiers can easily be created that are unique to each record.
D. All of the above
Explanation:
i. In some cases you may not have any unique identifying characteristics in data;
therefore, it makes sense to create a Primary Key.
ii. Explicitly initializing and modifying the auto-increment value is possible at any time.
iii. Record identifiers can easily be created that are unique to each record.
iv. Automatic incrementing allows flexibility in handling gaps between records.
v. Syntax-speaking, auto-increment queries in SQL are straightforward.
A. UNIQUE
B. IDENTITY
C. INCREMENT
D. ADD
Answer: B) IDENTITY
Explanation:
A. Relational
B. Logical
C. Additional
D. Unique
Answer: B) Logical
Explanation:
In SQL, LIKE is an Additional operator.
A. DELETE
B. SELECT
C. UPDATE
D. ALTER
Answer: D) ALTER
Explanation:
SQL LIKE is used with DELETE, SELECT and UPDATE statements and not with ALTER
statements.
6. The character(s) which are used independently or in conjunction with SQL Like Operator:
A. %
B. _
C. Both A. and B.
D. None of the above
Explanation:
The characters which are used independently or in conjunction with SQL Like Operator are
'%' & '_'.
A. Commit
B. Rollback
C. Both A. and B.
D. None of the above
Explanation:
8. A single unit of work for all commands executed consecutively is known as-
A. Transaction
B. Commit
C. Rollback
D. Control
Answer: A) Transaction
Explanation:
A single unit of work for all commands executed consecutively is known as Transaction.
9. To get the table's previous permanent status, use the ____ command.
A. Commit
B. Transaction
C. Rollback
D. None of the above
Answer: C) Rollback
Explanation:
To get the table's previous permanent status, use the rollback command.
Explanation:
A. Create a table
B. Create a database
C. Create a column
D. Create a row
Explanation:
SQL CREATE DATABASE is used to create a database.
2. A database does not need to be created in ____. A direct table creation option is provided
in ____.
A. MySQL
B. Oracle
C. Both A and B
D. None of the above
Explanation:
A database does not need to be created in Oracle. A direct table creation option is provided
in Oracle.
3. SQL ___ can be used to delete or drop existing databases in a SQL schema.
A. CREATE DATABASE
B. RENAME DATABASE
C. DROP DATABASE
D. SELECT DATABASE
Explanation:
SQL DROP DATABASE can be used to delete or drop existing databases in a SQL schema.
Explanation:
Explanation:
Explanation:
Explanation:
A. SELECT
B. USE
C. ALTER
D. CREATE
Answer: B) USE
Explanation:
A. USE
B. SELECT
C. RENAME
D. None of the above
Explanation:
A. USE DATABASES;
B. SELECT DATABASES;
C. SHOW DATABASES;
D. None of the above
Explanation:
A. Relation, Tuple
B. Tuple, Tuple
C. Tuple, Relation
D. Relation, Relation
Explanation:
A. In a table, there could be any number of rows and any number of columns.
B. In a table, there could be any number of rows and specified number of columns.
C. In a table, there could be any number of columns and specified number of rows.
D. In a table, there could be specified number of rows and specified number of columns.
Answer: B) In a table, there could be any number of rows and specified number of columns
Explanation:
In a table, there could be any number of rows and specified number of columns.
A. In case a transaction is rolled back, the data allied with table variable also get rolled
back.
B. In case a transaction is rolled back, the data allied with table variable does not roll
back.
C. In case a transaction is not rolled back, the data allied with table variable get rolled
back.
D. None of the above.
Answer: B) In case a transaction is rolled back, the data allied with table variable does not roll
back
Explanation:
In case a transaction is rolled back, the data allied with table variable does not roll back.
A. More
B. Less
C. Equal
D. None of the above
Answer: A) More
Explanation:
A. True
B. False
Answer: B) False
Explanation:
A. To Update table
B. To Create table
C. To Delete table
D. None of the above
Explanation:
A. INT
B. Number
C. Digit
D. None of the above
Answer: B) Number
Explanation:
8. To delete table definition and all data from the table, which statement is used?
A. DELETE
B. DROP
C. ALTER
D. None of the above
Answer: B) DROP
Explanation:
To delete table definition and all data from the table, DROP statement is used.
A. DELETE statement free up the space kept in check by the table whereas TRUNCATE
statement does not free up the space kept in check by the table.
B. DELETE statement does not free up the space kept in check by the table whereas
TRUNCATE statement free up the space kept in check by the table.
C. DELETE statement only deletes rows from the table whereas TRUNCATE statement
can only delete columns from the table.
D. DELETE statement only deletes columns from the table whereas TRUNCATE
statement can only delete rows from the table.
Answer: B) DELETE statement does not free up the space kept in check by the table whereas
TRUNCATE statement free up the space kept in check by the table
Explanation:
DELETE statement does not free up the space kept in check by the table whereas TRUNCATE
statement free up the space kept in check by the table.
Explanation:
When the table is dropped, the table structure, integrity constraints, relationship and access
privileges are dropped.
Explanation:
When the table is truncated, table structure remains same; therefore none of the above
problems occur.
12. In SQL, which statement can help in changing the name of the table?
A. RENAME
B. ALTER
C. Both A) and B)
D. None of the above
In SQL, RENAME and ALTER statement can help change the name of the table.
A. WHERE clause
B. HAVING clause
C. Both a and b
D. None of the above
Explanation:
Explanation:
TRUNCATE TABLE uses fewer resources and is faster than DELETE TABLE command.
Answer: C) Copy the content from one table into another existing table
Explanation:
SELECT INTO statement copy the content from one table into another existing table.
Explanation:
At run time, temporary tables can be created and temporary table can do similar operations
to normal table.
A. 1
B. 2
C. 3
D. 4
Answer: B) 2
Explanation:
18. Which of the following are the types of the temp tables?
A. Local Temp
B. Global Temp
C. Both A) and B)
D. None of the above
Explanation:
Local and Global temp, both are the types of the temp tables.
A. ?
B. @
C. #
D. &
Answer: C) #
Explanation:
A. ###
B. ####
C. #
D. ##
Answer: D) ##
Explanation:
MCQ | SQL – Select, Clause, Order By, Insert, Update and Delete Statements
A. WHERE
B. ORDER BY
C. HAVE
D. HAVING
Answer: C) HAVE
Explanation:
WHERE, ORDER BY and HAVING are all OPTIONAL Clauses in SELECT statement.
Explanation:
Explanation:
In order to group the rows that share the same property, GROUP BY Clause is used.
Answer: C) In order to select the defined groups by the GROUP BY Clause, HAVING Clause is
used
Explanation:
In order to select the defined groups by the GROUP BY Clause, HAVING Clause is used.
Answer: A) In order to return the rows in a specific order, ORDER BY Clause is used
Explanation:
A. WHERE
B. GROUP BY
C. ORDER BY
D. None of the above
Explanation:
WHERE, GROUP BY and ORDER BY all are optional clauses in SQL SELECT Statement.
7. Which of the following clause is optional in SQL SELECT Statement?
A. SELECT
B. FROM
C. HAVING
D. None of the above
Answer: C) HAVING
Explanation:
A. SELECT UNIQUE
B. SELECT DISTINCT
C. Both A) and B)
D. None of the above
Explanation:
SELECT UNIQUE and SELECT DISTINCT clauses are used to retrieve a unique element from a
table.
Explanation:
A. Column Name
B. Row Name
C. Table Name
D. None of the above
11. The SELECT TOP statement shows the limited number of:
A. Rows
B. Columns
C. Tables
D. None of the above
Answer: A) Rows
Explanation:
The SELECT TOP statement shows the limited number of records or rows.
Explanation:
13. Using the SQL first() function, one can return the ____ value of the selected column.
A. First
B. Second
C. Third
D. Last
Answer: A) First
Explanation:
Using the SQL first() function, one can return the first value of the selected column.
14. Using the SQL last() function, one can return the ______ value of the selected column.
A. First
B. Second
C. Third
D. Last
Answer: D) Last
Explanation:
Using the SQL last() function, one can return the last value of the selected column.
15. Using SQL SELECT RANDOM() function, one can return the random –
A. Table
B. Database
C. Row
D. Column
Answer: C) Row
Explanation:
Using SQL SELECT RANDOM() function, one can return the random row.
16. In order to assign a random name to a column or table, which SQL SELECT Clause is used?
A. FROM
B. WHERE
C. HAVING
D. AS
Answer: D) AS
Explanation:
In order to assign a random name to a column or table, SQL SELECT AS Clause is used.
A. ADD
B. MERGE
C. CONCAT
D. None of the above
Answer: C) CONCAT
Explanation:
A. HAVING clause is used in column operation whereas WHERE clause is used in row
operation.
B. HAVING clause is post-filter whereas WHERE clause is pre-filter.
C. HAVING clause filters the groups whereas WHERE clauses filter the single record of
the table.
D. All of the above
Explanation:
a. HAVING clause is used in column operation whereas WHERE clause is used in row
operation.
b. HAVING clause is post-filter whereas WHERE clause is pre-filter.
c. HAVING clause filters the groups whereas WHERE clauses filter the single record of
the table.
A. MIN function is used to show the minimum data and MAX function is used to show
the maximum data.
B. MIN function is used to show the maximum data and MAX function is used to show
the minimum data.
C. Both of the above
D. None of the above
Answer: A) MIN function is used to show the minimum data and MAX function is used to
show the maximum data
Explanation:
MIN function is used to show the minimum data and MAX function is used to show the
maximum data.
20. In order to sort the records according to the columns, which clause is used?
A. HAVING
B. GROUP BY
C. ORDER BY
D. None of the above
Answer: C) ORDER BY
Explanation:
ORDER BY clause is used to sort the records according to the columns
A. Ascending
B. Descending
Answer: A) Ascending
Explanation:
A. ASCE, DESC
B. ASC, DES
C. ASCE, DES
D. ASC, DESC
Explanation:
Explanation:
24. In order to insert a row directly in the table, which command is used?
A. INSERT IN
B. INSERT INSIDE
C. INSERT UNDER
D. INSERT INTO
25. In order to update one table using another table and join condition, which statement is
used.
Explanation:
SQL UPDATE JOIN is used to update one table using another table and join condition.
A. Rows
B. Database
C. View
D. All of the above
Explanation:
SQL DELETE can be used to delete Rows, Database and View using specific SQL clauses.
27. What is the clause to delete all rows from the table?
Explanation:
DELETE FROM Table_Name is used to delete all rows from the table.
28. In order to delete duplicate rows from the table, which keyword is used?
A. DELETE
B. DISTINCT
C. FROM
D. WHERE
Answer: B) DISTINCT
Explanation:
A. DROP
B. DELETE
C. ALTER
D. None of the above
Answer: A) DROP
Explanation:
A. DELETE
B. ON
C. WHERE
D. All of the above
Explanation:
DELETE, ON, WHERE and few other keywords are used to delete the Join.
1. A Key which uniquely identifies each row in the table is known as?
A. Primary Key
B. Unique Key
C. Composite Key
D. Foreign Key
A Key which uniquely identifies each row in the table is known as Primary Key.
A. Row
B. Column
C. Table
D. Database
Answer: B) Column
Explanation:
A. Unique
B. Composite
C. Foreign
D. None of the above
Answer: B) Composite
Explanation:
Explanation:
we can have up to 16 columns as primary key column and the total size of the key columns
should be less than or equal to 900 bytes.
Answer: A) Once
Explanation:
6. To add a Primary Key constraint after table is created, which clause is used?
A. UPDATE
B. ADD
C. ALTER
D. JOIN
Answer: C) ALTER
Explanation:
To add a Primary key constraint after table is created, ALTER clause is used.
A. DELETE
B. DROP
C. ALTER
D. REMOVE
Answer: B) DROP
Explanation:
A. Primary
B. Foreign
C. Composite
D. Unique
Answer: B) Foreign
Explanation:
In order to build a link between two tables, foreign key is used.
Explanation:
The option (B) is false, because a foreign key can be NULL or duplicate.
10. Foreign key is a field in a table that is _______ key in another table?
A. Primary
B. Unique
C. Composite
D. None of the above
Answer: A) Primary
Explanation:
11. When two or more columns are combined to be used to uniquely identify each row in the
table, it is known as -
A. Primary Key
B. Unique Key
C. Composite Key
D. Foreign Key
Explanation:
When two or more columns are combined to be used to uniquely identify each row in the
table, it is known as Composite Key.
A. 1
B. NULL
C. Many
D. None of the above
Answer: C) Many
Explanation:
13. All other columns other than the column which is termed as Primary Key, are known as –
A. Unique Keys
B. Alternate Keys
C. Composite Keys
D. None of the above
Explanation:
All other columns other than the column which is termed as Primary Key, are known as
Alternate Keys.
A. HAVING
B. WHERE
C. ORDER BY
D. FROM
Answer: C) ORDER BY
Explanation:
2. Which one if these is used to put the same value in all the rows?
Explanation:
Group by single column is used to put the same value in all the rows.
3. In order to convert the expression from one to another data type, which SQL Function is
used?
A. CONVERT
B. CHANGE
C. CAST
D. TRANSIT
Answer: C) CAST
Explanation:
In order to convert the expression from one to another data type, SQL CAST Function is used.
Explanation:
CAST (expression AS [data type]) is the syntax of the SQL CAST function.
5. What is the default length of any data type in the CAST function?
A. 10
B. 20
C. 30
D. 40
Answer: C) 30
Explanation:
A. Inline Comments
B. Single Line Comments
C. Multi-line Comments
D. All of the above
Answer: D) All of the above
Explanation:
Type of SQL Comments are Inline Comments, Single Line Comments and Multi-line
Comments.
A. .
B. !
C. --
D. #
Answer: C) --
Explanation:
8. Comments whose starting and ending lines are different are known as –
A. Inline Comments
B. Multi-line Comments
C. Single Line Comments
D. Varied line Comments
Explanation:
Comments whose starting and ending lines are different are known as Multi-line Comments.
A. //*Line1
B. Line2*//
C.
D. /*Line1
E. Line2/*
F.
G. */Line1
H. Line2*/
I.
J. /*Line1
K. Line2*/
L.
Answer: D)
/*Line1
Line2*/
Explanation:
A. 25
B. 26
Answer: A) 25
Explanation:
A. 25
B. 26
C. 25.65
D. 25.00
Answer: C) 25.65
Explanation:
A. 2021-10-06 00:00:00.000
B. 2021-10-06
C. 2021 OCT 06
D. 06-10-2021
Explanation:
1. In how many parts are the SQL functions are divided into?
A. 1
B. 2
C. 3
D. 4
Answer: B) 2
Explanation:
SQL functions are divided into 2 parts, Aggregate, and Scalar Functions.
A. Single
B. Twice
C. NULL
D. Infinite
Answer: A) Single
Explanation:
A. AVG()
B. FIRST()
C. LAST()
D. All of the above
Explanation:
AVG(), FIRST() and LAST() are all the aggregate functions.
Explanation:
A. MIN()
B. MAX()
C. LARGE()
D. AVG()
Answer: B) MAX()
Explanation:
A. Average value
B. Largest value
C. Smallest value
D. Number of rows
Explanation:
A. UCASE()
B. LEN()
C. SUM()
D. NOW()
Answer: C) SUM()
Explanation:
Explanation:
A. LEN()
B. NOW()
C. MID()
D. FORMAT()
Answer: C) MID()
Explanation:
A. DATE()
B. NOW()
C. TIME()
D. DATETIME()
Answer: B) NOW()
Explanation:
11. In order to merge two or more strings, which string function is used?
A. CHAR
B. ALTER
C. CONCAT
D. MERGE
Answer: C) CONCAT
Explanation:
12. We can use literal in the CONCAT function. What does literal refer to?
A. Number
B. Character
C. Date
D. All of the above
Explanation:
Literals are the numbers, characters and the data in the CONCAT function.
A. |
B. ||
C. //
D. \\
Answer: B) ||
Explanation:
Explanation:
Common Table Expressions is the full form of CTE in SQL.
A. FOR
B. AS
C. WITH
D. TO
Answer: C) WITH
Explanation:
A. Round
B. Hierarchal
C. Linear
D. None of the above
Answer: B) Hierarchal
Explanation:
A. Infinite Loop
B. Null State
C. False State
D. True State
Explanation:
A. MAXLINEAR
B. MAXROUND
C. MAXRECURSION
D. None of the above
Answer: C) MAXRECURSION
Explanation:
19. From the set of results, in order to remove the duplicate columns, ____ Clause is used.
A. DUPLICATE
B. DISTINCT
C. REMOVE
D. DROP
Answer: B) DISTINCT
Explanation:
From the set of results, in order to remove the duplicate columns, DISTINCT Clause is used. It
is used in conjunction with SELECT keyword.
Explanation:
A. Tables
B. WHERE Conditions
C. Expressions
D. None of the above
Answer: C) Expressions
Explanation:
Explanation:
A. N
B. N-1
C. N-2
D. N+1
Answer: B) N-1
Explanation:
24. ____ Clause is used in Parent-child relationship in order to join two or more tables.
A. FROM
B. TO
C. WHERE
D. IN
Answer: C) WHERE
Explanation:
WHERE Clause is used in Parent-child relationship in order to join two or more tables.
A. Opera
B. Google Chrome
C. Android Browsers
D. All of the above
Answer: D) All of the above
Explanation:
The WEB SQL API is supported by Opera, Google Chrome and Android Browsers.
26. In order to manage or store the data in the database, WEB SQL Database is used which is
a–
A. Web site
B. Web page
C. Web browser
D. None of the above
Explanation:
In order to manage or store the data in the database, WEB SQL Database is used which is a
Webpage.
Explanation:
A. Execute SQL
B. Transaction
C. Open Database
D. All of the above
Explanation:
Execute SQL, Transaction and Open Database are all the methods of Web SQL.
Answer: C) transaction()
Explanation:
A. Transaction
B. Commit
C. Rollback
D. All of the above
Explanation:
A. UPDATE
B. INSERT
C. SELECT
D. Both A and B
Explanation:
SQL Indexes slows the execution time of UPDATE and INSERT statements.
A. SELECT
B. WHERE
C. Both A and B
D. None of the above
SQL Indexes speed up the execution time of SELECT and WHERE statements.
Explanation:
A. ALTER
B. UPDATE
C. CREATE
D. ADD
Answer: C) CREATE
Explanation:
A. Primary Key
B. Foreign Key
C. Composite Key
D. Alternate Key
A. RENAME
B. ALTER
C. UPDATE
D. ADD
Answer: B) ALTER
Explanation:
A. REMOVE
B. DELETE
C. DROP
D. DEL
Answer: C) DROP
Explanation:
Explanation:
Correct statement to remove an Index from MySQL Database is - ALTER TABLE Table_Name
DROP INDEX Index_Name;
9. In the relational database, in order to modify index, we need to use which command?
A. ALTER
B. MODIFY
C. UPDATE
D. ADD
Answer: A) ALTER
Explanation:
In the relational database, in order to modify index, we need to use ALTER command.
10. Which of the following states the correct situation in which Indexes should not be used in
SQL?
Explanation:
A. Row
B. Column
C. Table
D. Database
Answer: D) Database
Explanation:
Explanation:
3. What is the difference between Column Level and Table Level Constraints?
A. Constraints are applied to a single row using Column Level Constraints whereas
Multiple rows can be constrained using a Table Level Constraint.
B. Constraints are applied to multiple rows using Column Level Constraints whereas a
single row can be constrained using a Table Level Constraint.
C. Constraints are applied to a single column using Column Level Constraints whereas
Multiple columns can be constrained using a Table Level Constraint.
D. Constraints are applied to multiple columns using Column Level Constraints whereas
only a single column can be constrained using a Table Level Constraint.
Answer: C) Constraints are applied to a single column using Column Level Constraints
whereas Multiple columns can be constrained using a Table Level Constraint
Explanation:
Constraints are applied to a single column using Column Level Constraints whereas Multiple
columns can be constrained using a Table Level Constraint.
Explanation:
The constraints that are needed to be put in the Password system are:
A. NOT NULL
B. CHECK
C. DEFAULT
D. All of the above
Explanation:
i. CHECK
ii. CREATE INDEX
iii. DEFAULT
iv. FOREIGN KEY
v. NOT NULL
vi. PRIMARY KEY
vii. UNIQUE
A. In columns that are subject to the NOT NULL constraint, duplicate values are not
allowed.
B. When a table's column is declared as NOT NULL, no record in the table can have an
empty value for that column.
C. By applying the NOT NULL constraint, we will always ensure that the column contains
a unique value and won't allow nulls.
D. The value will first be checked for certain conditions before inserting it into the
column when a NOT NULL constraint applies to a column in the table.
Answer: B) When a table's column is declared as NOT NULL, no record in the table can have
an empty value for that column
Explanation:
When a table's column is declared as NOT NULL, no record in the table can have an empty
value for that column.
7. NULL means –
A. ZERO
B. -1
C. 1
D. Empty
Answer: D) Empty
Explanation:
A. In columns that are subject to the UNIQUE constraint, duplicate values are not
allowed.
B. Unique values will always be present in the column containing the unique constraint.
C. A single table can have more than one unique constraint, since it can be applied to
more than one column.
D. All of the above
Explanation:
i. In columns that are subject to the UNIQUE constraint, duplicate values are not
allowed.
ii. Unique values will always be present in the column containing the unique constraint.
iii. A single table can have more than one unique constraint, since it can be applied to
more than one column.
9. You can also _______ the existing tables by using the UNIQUE constraint.
A. Change
B. Delete
C. Modify
D. Drop
Answer: C) Modify
Explanation:
You can also modify the existing tables by using the UNIQUE constraint.
10. ___________ and __________constraints form the core of the PRIMARY KEY constraint.
NOT NULL and UNIQUE constraints form the core of the PRIMARY KEY constraint.
A. Referential Integrity
B. Domain Integrity
C. User-defined Integrity
D. Entity Integrity
Explanation:
A. The value will first be checked for certain conditions before inserting it into the
column when a DEFAULT constraint applies to a column in the table.
B. In the event of a DEFAULT constraint being applied to a table's column without a user
specifying the value to be inserted when that constraint was applied, the default
value that was specified when the constraint was applied will be put into that column.
C. An index can be created on the table using the DEFAULT constraint.
D. None of the above
Answer: B) In the event of a DEFAULT constraint being applied to a table's column without a
user specifying the value to be inserted when that constraint was applied, the default value
that was specified when the constraint was applied will be put into that column
Explanation:
In the event of a default constraint is applied to a table's column without a user specifying
the value to be inserted when that constraint was applied, the default value that was
specified when the constraint was applied will be put into that column.
1. A Sub query is an SQL expression that is placed ________ another SQL statement.
A. Before
B. After
C. Inside
D. Outside
Answer: C) Inside
Explanation:
A Sub query is an SQL expression that is placed inside another SQL statement.
2. With which of the following statement(s) can the SQL sub queries be used?
A. SELECT
B. UPDATE
C. INSERT
D. All of the above
Explanation:
SQL sub queries can be used with SELECT, UPDATE, INSERT and DELETE statements.
3. Whenever a sub query appears in SQL, it is enclosed within ___________ and placed to
the _____ of the SQL operators.
A. Brackets, Left
B. Brackets, Right
C. Parenthesis, Left
D. Parenthesis, Right
Explanation:
Whenever a sub query appears in SQL, it is enclosed within parenthesis and placed to the
right of the SQL operators.
A. GROUP BY
B. ORDER BY
C. DELETE
D. FROM
Answer: B) ORDER BY
Explanation:
5. In order to prevent multiple records from being returned by the sub query, _______ must
be used before the sub query.
A. Many Value Operators
B. Multiple Value Operators
C. Single Value Operator
D. Unique Value Operator
Explanation:
In order to prevent multiple records from being returned by the sub query, multiple value
operators must be used before the sub query.
6. The _________ operator cannot be used with the sub query, but within it.
A. IN
B. INTO
C. BETWEEN
D. JOIN
Answer: C) BETWEEN
Explanation:
The BETWEEN operator cannot be used with the sub query, but within it.
7. An SQL ____ is a virtual table, whose contents are based on the SQL statement's results.
A. Concatenate
B. Virtual
C. View
D. None of the above
Answer: C) View
Explanation:
An SQL View is a virtual table, whose contents are based on the SQL statement's results.
A. CREATE statement
B. CREATE VIEW statement
C. VIEW CREATE statement
D. SQL VIEW statement
Explanation:
We can create View in SQL using CREATE VIEW statement.
Explanation:
10. When SELECT statements used to create Views contain ______________ clauses, the
views cannot be updated.
A. JOIN
B. HAVING
C. GROUP BY
D. All of the above
Explanation:
When SELECT statements used to create Views contain JOIN, HAVING, or GROUP BY clauses,
the views cannot be updated.
A. Relational
B. Logical
C. Arithmetic
D. Assignment
Answer: B) Logical
Explanation:
SQL BETWEEN is a logical operator and within the range specified in the query, it retrieves
the records from the table.
A. Dates
B. Texts
C. Numbers
D. All of the above
Explanation:
SQL BETWEEN operators can be used to select the dates, texts or numbers.
A. Starting Value
B. In Between Value
C. Ending Value
D. All of the above
Explanation:
SQL BETWEEN operators include the starting value, in between value and the ending value.
A. IF
B. AS
C. WHERE
D. EXCEPT
Answer: C) WHERE
Explanation:
A. SELECT
B. DELETE
C. INSERT
D. All of the above
Answer: D) All of the above
Explanation:
BETWEEN operators is used with SELECT, DELETE and INSERT SQL Statements.
Explanation:
BETWEEN Operator returns the TRUE value if the column value is >=Value1 & <=Value2.
A. Upper
B. Unique
C. Update
D. Uppercase
Answer: C) Update
Explanation:
Explanation:
C in CRUD Operator is an acronym of Create which means to add or insert data in the table.
Explanation:
Read in CRUD Operator means to retrieve and fetch the data from the table.
10. Using the DELETE Query from the CRUD Operator, we can delete –
Explanation:
Using the DELETE Query from the CRUD Operator, we can delete all the rows from the table.
A. CONNECT
B. ADD
C. COMBINE
D. CONCAT
Answer: D) CONCAT
Explanation:
A. It is also possible to combine more than two strings into one string.
B. Two columns of the table may be used to store the strings that are to be combined,
or they may just be stored individually without being stored into the table.
C. When the concatenated strings are stored in separate columns of a table, they are
stored in the column in which they were initially stored.
D. All of the above
Answer: D) All of the above
Explanation:
1. It is also possible to combine more than two strings into one string.
2. Two columns of the table may be used to store the strings that are to be combined,
or they may just be stored individually without being stored into the table.
3. When the concatenated strings are stored in separate columns of a table, they are
stored in the column in which they were initially stored.
3. Which function is used to obtain the month from the entire data stored in a table's
column?
A. DATE
B. TIME
C. MONTH
D. DATE & TIME
Answer: C) MONTH
Explanation:
MONTH function is used to obtain the month from the entire data stored in a table's column.
4. In more readable form, you can retrieve the date values, using ______ function?
A. DATE
B. DATE_FORM
C. DATE_FORMAT
D. DATE_VALUE
Answer: C) DATE_FORMAT
Explanation:
In more readable form, you can retrieve the date values, using DATE_FORMAT function.
A. Commit
B. Transaction
C. Rollback
D. None of the above
Answer: C) Rollback
Explanation:
Explanation:
Explanation:
A. MM:HH:SS;
B. SS:HH:MM;
C. HH:SS:MM;
D. HH:MM:SS;
Answer: D) HH:MM:SS;
Explanation:
A. TIME
B. TIME_FORM
C. TIME_FORMAT
D. TIME & DATE
Answer: C) TIME_FORMAT
Explanation:
A. 12-hour format
B. 24-hour format
C. Both A. and B.
D. None of the above
Explanation:
Using TIME_FORMAT() function, time can be retrieved in 12-hour and 24-hour formats.
********************HAPPY LEARNING*******************