MCQ SQL 1
MCQ SQL 1
1.
Which of the following are some common RDBMS in use?
Oracle
MySQL
HeidiSQL
All of the above
Hide
Wrong Answer
Explanation: All of the above options are examples of some famous RDBMS in use.
2.
What command is used to create a new table in SQL?
CREATE TABLE
BUILD TABLE
GENERATE TABLE
None of the above
Hide
Wrong Answer
Explanation: The CREATE TABLE command is used to create a new table in SQL.
3.
What does the following statement in SQL do?
DROP TABLE student;
Deletes a table called student.
Creates a table called student.
Check if there is a table called student.
None of the above.
Hide
Wrong Answer
Explanation: The DROP command is used to delete/drop a table in SQL.
4.
Which of the following are types of Unicode character string types in SQL?
nchar
ntext
Both A and B
None of the above
Hide
Wrong Answer
Explanation: nchar and ntext are types of Unicode character strings datatypes in SQL.
5.
What does BLOB in SQL stand for?
Binary Large Objects
Big Large Objects
Binary Language for Objects
None of the above
Hide
Wrong Answer
Explanation: BLOB in SQL stands for Binary Large Objects which is an SQL Object
datatype.
6.
Which of the following datatype is most appropriate for storing a string of up to 255
characters?
TEXT
TINY TEXT
BLOB
BINARY
Hide
Wrong Answer
Explanation: TINY TEXT can contain a string of up to 255 characters or 255 bytes.
7.
What happens when no value is inserted in an ENUM list?
Nothing happens
The code will crash
A blank value is inserted in that case
None of the above
Hide
Wrong Answer
Explanation: In the case an ENUM list is empty and no value is inserted, a blank value
is inserted in the list.
8.
What is the range of integers that can be held in the MEDIUMINT datatype of SQL?
Signed numbers in the range of -8388608 to 8388607.
Unsigned numbers in the range of 0 to 16777215.
Both A and B.
None of the above.
Hide
Wrong Answer
Explanation: Integer with values in the signed range of -8388608 to 8388607 and
values in the unsigned range of 0 to 16777215 can be stored in the MEDIUMINT
datatype.
9.
What does the following code snippet do?
ALTER TABLE STUDENT ADD(ADDRESS VARCHAR2(20));
Adds a column called ADDRESS in the table student.
Checks if a column called ADDRESS is present in the table student.
Invalid Syntax
None of the above
Hide
Wrong Answer
Explanation: The ADD command is used to add a new column with given
specifications into a table by altering the contents of the table.
10.
Which of the following commands is used to delete all rows and free up space from a
table?
TRUNCATE
DROP
DELETE
ALTER
Hide
Wrong Answer
Explanation: TRUNCATE command is used to delete all rows and free up space from a
table.
11.
Which of the following commands are a part of Data Control Language?
Revoke
Grant
Both A and B
None of the above
Hide
Wrong Answer
Explanation: Revoke and Grant are the 2 commands that are a part of Data Control
Language.
12.
What does the following code snippet do?
DELETE FROM STUDENTS
WHERE AGE = 16;
ROLLBACK;
Performs an undo operation on the delete operation.
Deletes the rows from the table where AGE = 16
Deletes the entire table
None of the above
Hide
Wrong Answer
Explanation: The ROLLBACK command is used to perform a rollback onto the latest
unsaved changes.
13.
When is the wildcard in WHERE clause used?
An exact match is necessary for a CREATE statement.
An exact match is not possible in a SELECT statement.
An exact match is necessary for a SELECT statement.
None of the above.
Hide
Wrong Answer
Explanation: Wildcard in WHERE clause is used when an exact match is not possible in
a SELECT statement.
14.
Which of the following is the full form of DDL?
Data definition language
Data derivation language
Dynamic data language
Detailed data language
Hide
Wrong Answer
Explanation: The full form of DDL is Data definition language.
15.
Which SQL constraint do we use to set some value to a field whose value has not been
added explicitly?
UNIQUE
NOT NULL
DEFAULT
CHECK
Hide
Wrong Answer
Explanation: The DEFAULT constraint is used to set a default value for a column which
comes into use when a value for a field in that column is not set.
16.
What are rows of a relation known as?
Degree
Entity
Tuple
None
Hide
Wrong Answer
Explanation: The rows of a relation are known as tuples.
17.
During transaction before commit which of the following statements is done
automatically in case of shutdown?
Rollback
Commit
View
Flashback
Hide
Wrong Answer
Explanation: In case of a shutdown, before committing, Rollback is done.
18.
Which of the following allows you to uniquely identify a tuple?
Schema
Attribute
Super key
Domain
Hide
Wrong Answer
Explanation: Super Key is used to uniquely identify a tuple in a relation.
19.
How many operations are considered to be the most basic SQL operations?
4
3
2
1
Hide
Wrong Answer
Explanation: The 4 basic SQL operations are: Create, Read, Update and Delete(CRUD).
20.
Which of the following is not a SQL command?
DELETE
ORDER BY
SELECT
WHERE
Hide
Wrong Answer
Explanation: DELETE is not a SQL command.
21.
What does the following code snippet do?
SELECT TOP 5 * FROM students;
Select the top 5 entries for all the columns in the students' table.
Select all the entries from the students' table other than the top 5 entries
Selects all entries from the student table except 5 random rows
None of the above
Hide
Wrong Answer
Explanation: The above code snippet basically selects all the top 5 rows from the
students' table.
22.
Which of the following matches the definition given below: It is an artificial key that
aims to uniquely identify each record.
Primary Key
Foreign Key
Surrogate Key
Composite Key
Hide
Wrong Answer
Explanation: Surrogate Key is an artificial key that aims to uniquely identify each
record.
23.
Which of the following commands are used to put a restriction on the number of rows
returned from a query?
LIMIT
LIKE
WHERE
GROUP BY
Hide
Wrong Answer
Explanation: LIMIT is used to put a restriction on how many rows are returned from a
query.
24.
Which of the following are valid logical operators in SQL?
SOME
ALL
AND
All of the above
Hide
Wrong Answer
Explanation: All of the above expressions are valid logical operators in SQL.
25.
Which of the following SQL functions compares the similarities of 2 strings and returns
the result as a 4 character code?
SOUNDEX
DIFFERENCE
CONCAT
None of the above
Hide
Wrong Answer
Explanation: SOUNDEX compares 2 strings and returns their similarity as a 4 character
code.
26.
To select some particular columns, which of the following commands is used?
PROJECTION
SELECTION
JOIN
UNION
Hide
Wrong Answer
Explanation: To select some particular commands, PROJECTION is used.
27.
Primary key can be?
NULL
NOT NULL
Both NULL and NOT NULL
Depends on situation
Hide
Wrong Answer
Explanation: Primary key must always be NOT NULL.
28.
Select the valid SQL type.
NUMERIC
CHARACTER
FLOAT
All of the above
Hide
Wrong Answer
Explanation: All of the above options are valid SQL types.
29.
Which of the following functions do we use to get a specified day of the month for a
given date?
DAY
DATEPART
GETDATE
CURRENT_TIMESTAMP
Hide
Wrong Answer
Explanation: DAY is used to get the specified day of the month for a given date.
30.
Which of the following operators is used to compare a value to a list of literal values
that have been specified?
ANY
BETWEEN
IN
ALL
Hide
Wrong Answer
Explanation: The BETWEEN operator is used to compare a value to a list of literal
values that have been specified.
31.
What is a table joined with itself called?
Join
Self-join
Outer join
None of the above
Hide
Wrong Answer
Explanation: Table joined with itself is called a self join.
32.
NATURAL JOIN can also be termed as -
Combination of Union and cartesian product
Combination of Selection and cartesian product
Combination of Projection and cartesian product
None of the above
Hide
Wrong Answer
Explanation: NATURAL JOIN can also be termed as a combination of Projection and
cartesian product.
33.
Which of the following commands is used to delete a trigger in SQL?
DROP
DELETE
ALTER
None of the above
Hide
Wrong Answer
Explanation: The DROP command is used to delete a trigger in SQL.
34.
How can we view all the triggers currently in the database?
SHOW
VIEW
READ
None of the above
Hide
Wrong Answer
Explanation: The SHOW command will display all the triggers that are currently
present in the table.
35.
Which of the following is known as the minimal super key?
Primary key
Foreign key
Candidate key
None of the above
Hide
Wrong Answer
Explanation: The Candidate Key is also known as the minimal super key.
36.
Select the correct foreign key constraint?
Referential integrity
Entity integrity
Domain integrity
None of the above
Hide
Wrong Answer
Explanation: The most important foreign key constraint is Referential Integrity.
37.
What is NOLOCK in SQL equivalent to?
WRITE UNCOMMITTED
READ COMMITTED
WRITE COMMITTED
READ UNCOMMITTED
Hide
Wrong Answer
Explanation: The NOLOCK in SQL is equivalent to READ UNCOMMITTED.
38.
Which of the following can replace the below query?
SELECT Name, ID
FROM Student, Courses
WHERE Student_ID = Courses_ID;
Select Name,ID from Courses,Student where Student_ID = ID;
Select Name, ID from Student natural join Courses;
Select Name, ID from Student;
Select ID from Student join Courses;
Hide
Wrong Answer
Explanation: The correct replacement of the above query is shown in option B.
39.
What will be the output of the following code snippet?
SELECT ROUND (TRUNCATE (MOD (2500, 20), -1), 2) FROM dual;
Error
00
0
1
Hide
Wrong Answer
Explanation: The MOD(2500, 20) expression will return 0, after which the rest of the
functions will just be applied on the value 0.
40.
How can the user change “Scaler” into “Interviewbit” in the “Name” column in the
Users table?
UPDATE User SET Name = 'Scaler' INTO Name = 'Interviewbit'
MODIFY Users SET Name = 'Interviewbit' WHERE Name = 'Scaler'
MODIFY Users SET Name = 'Scaler' INTO Name = 'Interviewbit'
UPDATE Users SET Name = 'Interviewbit' WHERE Name = 'Scaler'
Hide
Wrong Answer
Explanation: The UPDATE command and WHERE clause are used together to change
the name as asked in the question.
41.
What is the name of the query that is placed within a WHERE or HAVING clause of
another query?
Multi query
Subquery
Super query
Master query
Hide
Wrong Answer
Explanation: It is called subquery.
42.
Which is the AS clause used for?
Rename
Selection
Join
Projection
Hide
Wrong Answer
Explanation: The AS is used for the renaming functionality.
43.
Which of the following are valid SQL constraints?
NOT NULL
CHECK
UNIQUE
All of the above
Hide
Correct Answer
Explanation: All of the above are valid SQL constraints.
44.
Which of the following is also known as a concatenated key?
Primary Key
Foreign Key
Surrogate Key
Composite Key
Hide
Wrong Answer
Explanation: Composite key is also known as a concatenated key since it is composed
of one or more columns.
45.
The program which performs some common action on database data and is also
stored there is called?
Trigger
Stored Procedure
Stored Function
None of the above
Hide
Wrong Answer
Explanation: SQL procedures are stored in SQL codes, which can be saved for reuse
again and again.
46.
How can SQL injections occur?
Data is used to dynamically construct an SQL Query.
Unintended data from an untrusted source enters the application.
Both A and B.
None of the above.
Hide
Wrong Answer
Explanation: SQL injections can occur in the 2 ways described in options A and B.
47.
Which of the following constraints can be defined only at the column level?
UNIQUE
NOT NULL
CHECK
PRIMARY KEY
Hide
Wrong Answer
Explanation: NOT NULL constraint can be defined only at the column level.
48.
Group of operations that form a single logical unit of work called?
Network
Unit
Transaction
None of the above
Hide
Wrong Answer
Explanation: A logical group of statements that is written to perform a single unit of
work is called a transaction.
49.
Identify the concurrency-based protocol?
Lock based protocol
Two-phase locking protocol
Timestamp ordering protocol
All
Hide
Wrong Answer
Explanation: All of the above options are concurrency-based protocols.
50.
Which of the following is not a valid SQL type?
NUMERIC
DECIMAL
CHARACTER
None of the above
Hide
Wrong Answer
Explanation: DECIMAL is not a valid SQL type.
51.
What is the full form of SQL?
Structured Query Language
Sample Query Language
Structured Query List
None of the above.
Hide
Wrong Answer
Explanation: SQL is the abbreviation for Structured Query Language.
52.
Which of the following is not a DDL command?
REVOKE
GRANT
UPDATE
RENAME
Hide
Wrong Answer
Explanation: RENAME is not a DDL command.
53.
Which of the following are TCL commands?
ROLLBACK
SAVEPOINT
Both A and B
None of the above
Hide
Wrong Answer
Explanation: Both A and B are TCL commands.
54.
SQL views are also known as?
Schema
Virtual Table
Instance
None of the above
Hide
Wrong Answer
Explanation: SQL Views are also known as Virtual Table.
55.
Which of the following is not a valid aggregate function?
count()
Sum()
Avg()
None of the above
Hide
Wrong Answer
Explanation: All of the above options are valid aggregate functions in SQL.
Answer: B
Answer: C
Explanation:
DECIMAL is not a valid SQL type because it is nothing but numeric only in SQL.
NUMERIC has fixed precision, and scale numbers range from -10^38+1 to 10^38-1.
FLOAT has floating precision number ranges from -1.79E + 308 to 1.79E + 308.
CHARACTER is a fixed-width character string data type that can be up to 8000 characters.
a. TRUNCATE
b. ALTER
c. CREATE
d. UPDATE
Answer: D
Explanation: DDL commands are used to define the structure of the database, table,
schemas, etc. It enables us to perform the operations like CREATE, DROP, ALTER, RENAME,
and TRUNCATE schema objects.
An UPDATE command is used for managing the data stored in a database. It is an example
of a DML command that also includes the INSERT and DELETE commands.
4) Which of the following are TCL commands?
Answer: A
Explanation: TCL stands for Transaction Control Commands used for managing the
changes made by DML commands like INSERT, DELETE, and UPDATE. The TCL commands
are automatically committed in the database; that's why we cannot use them directly while
creating tables or dropping them.
5) Which statement is used to delete all rows in a table without having the action logged?
a. DELETE
b. REMOVE
c. DROP
d. TRUNCATE
Answer: D
Explanation: TRUNCATE statement removes all rows in a table without logging the
individual row deletions. It uses fewer system and transaction log resources, which makes
its execution fast. This statement is similar to the DELETE statement without the WHERE
clause.
a. Simple tables
b. Virtual tables
c. Complex tables
d. Actual Tables
Answer: B
Explanation: A view is also known as a virtual table because it contains rows and columns
similar to a real table. It shows the table interface but cannot be stored in a database.
a. Only 1
b. Only 2
c. Depends on no of Columns
d. Depends on DBA
Answer: A
Explanation: The primary key can consist of a single or combination of the field that
uniquely identifies each record in a table. It cannot be null or empty. A table may have
duplicate columns, but it can contain only one primary key.
a. CHAR
b. RAW
c. NUMERIC
d. VARCHAR
Explanation:
RAW datatype stores variable-length binary data that can be queried and inserted but not
manipulated. Its maximum length is 32767 bytes.
VARCHAR stores variable string data in a fixed length. Its maximum length is 4000 bytes.
a. Primary Key
b. Not Null
c. Check
d. Union
Answer: D
Explanation:
Constraint specifies the rule to allow or restrict what data will be stored in a table. The
PRIMARY KEY, NOT NULL, and CHECK are the constraints that specify rules for data
insertion.
UNION is an operator that combines two or more results from multiple SELECT queries
into a single result set.
a. COUNT
b. COMPUTE
c. SUM
d. MAX
Answer: B
11) Which data manipulation command is used to combines the records from one or more
tables?
a. SELECT
b. PROJECT
c. JOIN
d. PRODUCT
Answer: C
Explanation: JOIN command is used with the SELECT statement to retrieve data from
multiple tables. It must be needed whenever we want to fetch records from two or more
tables.
a. ANY
b. BETWEEN
c. ALL
d. IN
Answer: D
Explanation: The IN operator easily tests the expression if it matches any value in a
specified list of values. It reduces the use of multiple OR conditions.
The WHERE or HAVING clause uses the ANY and ALL operators. ANY gives the result when
any subquery value matches the specified condition. The ALL give the result when all
subquery values match the specified condition.
a. NOT Operator
b. Exists Operator
c. IS NULL Operator
d. None of the above
Answer: C
Explanation: The IS NULL operator is used to testing the empty values in the table's
column. It returns true if column values are NULL.
The NOT operator gives the result only when the specified condition is not true.
The EXISTS operator used in combination with a subquery, and if a subquery returns any
record, this operator returns true. Otherwise, it will return false.
Answer: B
Explanation: The DML statement is used to access and manipulate the data in an existing
table. Therefore, it cannot be used in table deletion.
15) If we have not specified ASC or DESC after a SQL ORDER BY clause, the following is used
by default
a. DESC
b. ASC
c. There is no default value
d. None of the mentioned
Answer: B
Explanation: If we have not specified any sorting with the ORDER BY clause, SQL always
uses the ASC as a default sorting order. SQL treats Null as the lowest possible values while
sorting.
Explanation:
The TRUNCATE statement in SQL removes all data from the table and free the table's
space.
SQL's DELETE statement removes all data from the table but does not free the table's
space.
a. 6
b. 7
c. POINT
d. JAVAT
Answer: B
Explanation: The INSTR function searches the string for substring and returns the
numeric value of the specified character's first occurrence.
18) A command that lets you change one or more field in a table is:
a. INSERT
b. MODIFY
c. LOOK-UP
d. All of the above
Answer: B
Explanation: The modify command is used to change one or more columns in the
existing table. It is generally used with ALTER TABLE statement as follows.
a. SELF JOIN
b. EQUI JOIN
c. NON-EQUI JOIN
d. None of the above
Answer: B
Explanation: The INNER JOIN returns data from the two or more tables that match the
specified condition and hides other records. EQUI JOIN is similar to INNER JOIN that
returns records for equality or matching column(s) values of the relative tables.
NON-EQUI JOIN is returned those records that are not matching in the relative tables.
a. Similar to the WHERE clause but is used for columns rather than groups.
b. Similar to WHERE clause but is used for rows rather than columns.
c. Similar to WHERE clause but is used for groups rather than rows.
d. Acts exactly like a WHERE clause.
Answer: C
Explanation: The HAVING clause is always used with the GROUP BY clause and returns
the rows where the condition is TRUE.
21) _______ clause creates temporary relation for the query on which it is defined.
a. WITH
b. FROM
c. WHERE
d. SELECT
Answer: A
Explanation: The WITH clause in SQL allows us to provide a sub-query block, a name that
can be referenced in several places within the main query. It is used for defining a
temporary relation whose definition is available by the query in which the WITH clause is
associated.
Prints:
a. is illegal
b. garbage
c. 726
d. 70
Answer: D
Explanation: Here, the ROUND() function statement will produce the rounded result of
the given number 65.726 from the left of decimal point up to 1.
23) Which of the following is true about the SQL AS clause?
a. The AS clause in SQL is used to change the column name in the output or assign a
name to a derived column.
b. The SQL AS clause can only be used with the JOIN clause.
c. The AS clause in SQL is used to defines a search condition.
d. All of the mentioned
Answer: A
Explanation: SQL AS clauses are defined for columns and tables to give an alias name.
Basically, aliases are created to increase the readability of the query and column headings
in the output.
24) _________ command makes the updates performed by the transaction permanent in the
database?
a. ROLLBACK
b. COMMIT
c. TRUNCATE
d. DELETE
Answer: B
Explanation:
The COMMIT statement is a transactional command used to end the current transaction
and make all changes performed in the transaction permanent.
The ROLLBACK statement is a transactional command used to back out or cancels the
current transaction changes and restores changed data in its previous state.
Answer: D
Explanation: The UPDATE statement is used for modifying the table data by using the
SET and WHERE clause. The SET clause is used to change the values of the column
specified in the WHERE clause. See the below syntax:
a. CREATE
b. UPDATE
c. ALTER
d. SELECT
Answer: C
Explanation: The ALTER statement is used to change our table's definition, such as table
name, column name, column constraint, etc. It also allows us to add or delete an existing
column in a table. This statement must be used with ADD, DROP, and MODIFY clauses
according to the situation.
27) Which type of JOIN is used to returns rows that do not have matching values?
a. Natural JOIN
b. Outer JOIN
c. EQUI JOIN
d. All of the above
Answer: B
Explanation:
OUTER JOIN is the only join that returned the unmatched rows in one or both tables. It
can be classified into the following types:
o LEFT JOIN that shows only the unmatched rows from the left table.
o RIGHT JOIN that shows only the unmatched rows from the right table.
o FULL OUTER JOIN that shows the unmatched rows from both tables.
EQUI JOIN shows records for equality or matching column(s) values of the relative tables.
A Natural join can only be performed if at least one common attribute exists between two
relations (the attributes should be the same name and domain).
Answer: B
Explanation: A CASE statement is one of the control flow function that allows us to write
an if-else or if-then-else logic in a SQL query. This expression validates various conditions
and shows the output when the first condition is true, and stops traversing. If any
condition is not true, it executes the else block. It shows a null value if the else block is
not found.
Answer: C
Explanation:
Routines, also known as subroutines, are the group of multiple commands that can be
called whenever required.
Triggers are a special type of stored procedure containing a set of SQL statements that
will be fired automatically whenever any database event occurs. It always resides in the
system catalog.
Answer: A
Explanation: A procedure is a prepared SQL code that can be saved in the system and
reused whenever needed. It can return one or more values through parameters. So option
A is the correct choice.
31) Which of the following is the basic approaches for joining tables?
a. Union JOIN
b. Natural JOIN
c. Subqueries
d. All of the above
Answer: D
Explanation:
We already know that Union and Natural are the approaches for joining two or more
tables.
A subquery is a query nested into another SQL query. It can be embedded with SELECT,
INSERT, UPDATE or DELETE statement. A subquery is known as the inner query. In many
cases, we can use the subquery instead of a JOIN. Therefore, option D is the correct choice.
32) Why we need to create an index if the primary key is already present in a table?
Answer: A
Explanation: When we define a primary key in a table, the Database Engine enforces the
data's uniqueness by creating a unique index for those columns. This indexing process
improves data retrieval when the primary key is used in queries. Therefore, we need to
create an index if a primary key is already present in a table.
33) Group of operations that form a single logical unit of work is known as
a. View
b. Network
c. Unit
d. Transaction
Answer: D
a. Read operations
b. Write operations
c. A & B both
d. None of the above
Answer: A
Explanation: A shared lock can only be applied while reading or changing in data is
performed. It is also known as the READ lock. Therefore, option A is the right choice.
35) Sequence can generate
a. Numeric value
b. Alphanumeric value
c. A & B both
d. None of the above
Answer: C
a. 39 digits
b. 38 digits
c. 40 digits
d. 37 digits
Answer: B
Explanation: The number generated using a sequence can have a maximum of 38 digits.
Answer: B
Explanation: In SQL statements, the WHERE clause always comes before GROUP BY, and
the HAVING clause always comes after GROUP BY. Therefore, option B is the correct
choice.
38) What is the difference between a PRIMARY KEY and a UNIQUE KEY?
a. Primary key can store null value, whereas a unique key cannot store null value.
b. We can have only one primary key in a table while we can have multiple unique
keys
c. Primary key cannot be a date variable whereas unique key can be
d. None of these
Answer: B
Explanation:
The primary key is a single or combination of the field that identifies each record in a table
uniquely. It cannot take a NULL value. A table can have only one primary key. Also, we can
create a date variable as a primary key in a table.
Unique key also determines each row of the table uniquely, but it can take null value into.
A table can have more than one unique key. We cannot create a date variable as a unique
key in a table.
39) Which of the following are the synonyms for Column and ROW of a table?
a. 1 and 2
b. 3 and 4
c. Only 1
d. Only 2
Answer: A
Explanation: In Database Management System (DBMS), we can say that each record is
also called a tuple and rows. And each column is called fields and attributes.
a. Equal
b. IN
c. IS
d. None of Above
Answer: C
Explanation:
In SQL, we can use the IS operator to compare a NULL. This operator can be used with
select, insert, update, and delete commands.
The IN is a conditional operator used to reduce the use of multiple OR conditions in select,
insert, update, and delete commands.
The EQUAL operator is used to check whether the given expressions are equal or not. The
condition becomes true if the expressions are equal and then return matched records.
41) Which of the following statement is correct regarding the difference between TRUNCATE,
DELETE and DROP command?
I. DELETE operation can be rolled back but TRUNCATE and DROP operations cannot be
rolled back.
II. TRUNCATE and DROP operations can be rolled back but DELETE operations cannot be
rolled back.
III. DELETE is an example of DML, but TRUNCATE and DROP are examples of DDL.
IV. All are an example of DDL.
a. I and III
b. II and III
c. II and IV
d. II and IV
Answer: A
Explanation:
DELETE is used to remove existing records from the database. DELETE command is a DML
statement so that it can be rolled back.
DROP is used to delete the whole table, including its structure. DROP is a DDL command
that lost the data permanently, and it cannot be rolled back.
TRUNCATE is used to delete the whole records, but it preserves the table's schema or
structure. TRUNCATE is a DDL command, so it cannot be rolled back.
42) Which of the following options are correct regarding these three keys (Primary Key, Super
Key, and Candidate Key) in a database?
Answer: A
Explanation: Candidate key in SQL is a set of fields that identify each record in a table
uniquely. It is a super key with no repeated fields that means the minimal super key is a
candidate key. A table can contain multiple candidate keys, but it can have only a single
primary key. Therefore option A is the correct choice.
Answer: B
Explanation: The wildcard is a character used to search complex data from the database
quickly. We can use it in conjunction with the LIKE or NOT LIKE comparison operators and
the WHERE clause to find the result for a specified pattern. Hence, the wildcard is very
useful when the exact match is not possible in the SELECT statement.
a. FOREIGN KEY
b. PRIMARY KEY
c. UNIQUE
d. ALTERNATE KEY
Answer: D
Explanation: ALTERNATE KEY is a key associated with one or more columns to identify
each row in a table uniquely. If a table with one or more candidate keys, then the keys
other than the primary key is an alternate key. Since the alternate key is a part of the
candidate key, it is not a constraint in SQL. Hence, option D is the correct choice.
45) Find the cities name with the condition and temperature from table 'whether' where
condition = sunny or cloudy but temperature >= 60.
Answer: C
Explanation: We know that the AND operator gives the output only when both the first
conditions are true. In contrast, the OR operator gives the output when either the first
condition OR the second condition is true. Hence the option C is the correct choice.
46) Which of the following statement is correct to display all the cities with the condition,
temperature, and humidity whose humidity is in the range of 60 to 75 from the 'whether'
table?
Answer: B
Explanation:
The BETWEEN is a conditional operator that is used to retrieve values from an expression
within a range. It can be used with the SELECT, INSERT, UPDATE and DELETE statement.
The IN is a conditional operator used to reduce the use of multiple OR conditions in the
SELECT, INSERT, UPDATE and DELETE statement.
47) ________ is a program that performs some common action on database data and also
stored in the database.
a. Stored Procedure
b. Trigger
c. Stored Function
d. None of the above
Answer: A
Explanation: A stored procedure is a precompiled set of SQL commands that we can save
in our database. It can be reused over and over again whenever we need to perform some
common tasks.
A trigger is also the set of SQL commands that reside in a system catalog, but it will be
invoked automatically in response to an event. It is a special kind of stored procedure.
A stored function is one of the types of stored programs used to encapsulate the common
business rules or formulas reusable in stored programs. It returns a single value or
sometimes does not produce any result.
48) Which statement is used to get all data from the student table whose name starts with p?
Answer: B
Explanation: The '%' symbol indicates zero or more characters next to where it will be
used. And the _ symbol is used to match exactly one character. Therefore option B is the
correct choice.
Answer: C
Explanation: A clustered index is actually a table where the data is stored in rows. It stores
data in only one way based on the key values. It helps us to store data and indexes
simultaneously but takes a long time to update the records. They are scan and index seek
that minimizes the page transfer and maximizes the cache hits. Hence option C is the
correct choice.
Answer: D
Explanation: Option D is the correct choice because it is the example of an inline view,
which is the subquery in the FROM clause of the main query.
51) Which of the following are the DATETIME data types that can be used in column
definitions?
a. TIMESTAMP
b. INTERVAL MONTH TO DAY
c. INTERVAL YEAR TO MONTH
d. TIMESTAMP WITH DATABASE TIMEZONE
Hide Answer Workspace
Answer: A, C
Explanation:
Options A and C are correct. It is because they are the DATETIME data types that can be
used to specify column definitions.
Option B cannot be used to specify the column definitions because there are only
INTERVAL DAY TO SECOND and INTERVAL YEAR TO MONTH data types.
Option D cannot be used to specify the column definitions because there are only
TIMESTAMP WITH TIME ZONE and TIMESTAMP WITH LOCAL TIME ZONE data types.
52) Which data dictionary table can be used to show the object privileges granted to the user
on specific columns?
a. USER_TAB_PRIVS_MADE
b. USER_COL_PRIVS_MADE
c. USER_TAB_PRIVS
d. USER_COL_PRIVS
Answer: D
Explanation: The USER_COL_PRIVS data dictionary table will display the object privileges
granted to the user on specific columns. The USER_TAB_PRIVS data dictionary table will
display the object privileges granted to the user on the tables. Options A and B are not
data dictionary.
Answer: A
Explanation: This statement will give the result 0. A function MOD(1600, 10) returns 0 by
calculating the modulus of 1600 when 1600 is divided by 10 until no further whole number
can be produced. TRUNCATE(x, y) function truncates x to the decimal precision of y.
Finally, the ROUND(x, y) function rounds x to the decimal precision of y. Hence option A
is the correct choice.
54) What is the need for our query to execute successfully on an existing view?
Answer: B
Explanation: It is required to have a SELECT privilege to query on the existing view. Hence
option B is the right choice.
55) Which of the following operator can be used with a multiple-row subquery?
a. =
b. BETWEEN
c. NOT IN
d. <>
Answer: C
Explanation: The multiple-row subqueries produces multiple rows of results. We can only
use the NOT IN operator in SQL can only be used with multiple-row subqueries. And all
other operators must be used with single row subquery only. Therefore, BETWEEN, '=',
and '<>' operators work with single row subquery. Hence option C is the correct choice.
56) _______ is a constraint that can be defined only at the column level?
a. UNIQUE
b. NOT NULL
c. CHECK
d. PRIMARY KEY
Answer: B
Explanation: The SQL NOT NULL constraint prevents inserting NULL values into the
specified column. It enforces that a value must be defined for this column cannot accept
a NULL value. Hence, we can say that the NOT NULL constraint can be defined only at the
column level.
A. Strings
B. Numbers
C. Both A. and B.
D. None of the above
Explanation:
A. /
B. _
C. *
D. %
Answer: D) %
Explanation:
A. -
B. _
C. !
D. &
Answer: B) _
Explanation:
A. % operator
B. _ operator
C. NOT operator
D. All of the above
Explanation:
Explanation:
The above statement finds any values that start with "a"
Explanation:
The above statement finds any values that end with "a"
Explanation:
The above statement finds any values that have "or" in any position
Answer: C) Finds any values that start with "a" and are at least 2 characters in
length
Explanation:
The above statement finds any values that start with "a" and are at least 2
characters in length
A. Finds any values that start with "a" and ends with "o"
B. Finds any values whose first character is "a" and third character is "o"
C. Both A. and B.
D. None of the above
Answer: A) Finds any values that start with "a" and ends with "o"
Explanation:
The above statement finds any values that start with "a" and ends with "o"
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
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:
ADVERTISEMENT
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
Answer: C) Both A. and B.
Explanation:
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
Explanation:
BETWEEN operators is used with SELECT, DELETE and INSERT SQL Statements.
ADVERTISEMENT
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:
A. To retrieve data
B. To fetch data
C. Both A. and B.
D. None of the above
Explanation:
Read in CRUD Operator means to retrieve and fetch the data from the table.
Explanation:
Using the DELETE Query from the CRUD Operator, we can delete all the rows
from the table.
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.
A. Brackets, Left
B. Brackets, Right
C. Parenthesis, Left
D. Parenthesis, Right
Explanation:
A. GROUP BY
B. ORDER BY
C. DELETE
D. FROM
Answer: B) ORDER BY
Explanation:
Explanation:
In order to prevent multiple records from being returned by the sub query,
multiple value operators must be used before the sub query.
ADVERTISEMENT
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.
Discuss this Question
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:
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. Row
B. Column
C. Table
D. Database
Answer: D) Database
Explanation:
A. Column Level
B. Table Level
C. Both A and B
D. None of the above
Explanation:
Explanation:
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
ADVERTISEMENT
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.
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.
Explanation:
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:
1. To get a record from one table, which is not present in another table, we
can use the clause –
A. CONCAT
B. COPY
C. EXCEPT
D. ALTER
Answer: C) EXCEPT
Explanation:
To get a record from one table, which is not present in the other table, we can
use the clause EXCEPT.
A. Sum
B. Multiply
C. Minus
D. Divide
Answer: C) Minus
Explanation:
A. There must be the same number of columns in each table and the same
order in every select statement.
B. It is desirable that the columns have similar or compatible data types.
C. Both SELECT statements must have the same fields in their respective
columns.
D. All of the above
Explanation:
i. There must be the same number of columns in each table and the same
order in every select statement.
ii. It is desirable that the columns have similar or compatible data types.
iii. Both SELECT statements must have the same fields in their respective
columns.
Answer: C)
Explanation:
A. MySQL
B. PostgreSQL
C. Both A and B
D. None of the above
Answer: B) PostgreSQL
Explanation:
ADVERTISEMENT
Explanation:
In the case of the SQL EXCEPT clause, the result is purged of duplicates.
Explanation:
In the case of the NOT IN clause, Duplicate records are not removed.
A. Before
B. After
C. Flexible to before or after
D. None of the above
Answer: B) After
Explanation:
ORDER BY clauses comes after the EXCEPT clause in SQL statement.
Explanation:
SQL EXCEPT returns the record from the first SELECT Query which is not present
in the second SELECT Query.
10. Using which clause, can SQL EXCEPT be used in single table?
A. TO
B. AS
C. WHERE
D. IN
Answer: C) WHERE
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
Explanation:
SQL Indexes speed up the execution time of SELECT and WHERE statements.
A. ALTER
B. UPDATE
C. CREATE
D. ADD
Answer: C) CREATE
Explanation:
A. Primary Key
B. Foreign Key
C. Composite Key
D. Alternate Key
Explanation:
ADVERTISEMENT
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:
A. ALTER
B. MODIFY
C. UPDATE
D. ADD
Answer: A) ALTER
Explanation:
10. Which of the following states the correct situation in which Indexes
should not be used in SQL?
Explanation:
Explanation:
SET Operators are used to compile the results from two queries.
A. UNION
B. INTERSECT
C. MINUS
D. All of the above
Explanation:
1. UNION
2. INTERSECT
3. MINUS
Explanation:
A. One
B. Two
C. Three
D. Four
Answer: B) Two
Explanation:
Combining the results of two select statements will be done using UNION.
Explanation:
ADVERTISEMENT
6. A SELECT statement is intersected to use it as a join, but it only returns
the records that are ________ between both statements.
A. Distinct
B. Common
C. Shared
D. Both B and C
Explanation:
A SELECT statement is intersected to use as a join, but it only returns the records
that are common or shared between both statements.
A. Detected in the second query, absent in the first query, and there are no
duplications.
B. Detected in the first query, absent in the second query, and there are no
duplications.
C. Detected in the first query, absent in the second query, and there are
duplications.
D. Detected in the second query, absent in the first query, and there are
duplications.
Answer: B) Detected in the first query, absent in the second query, and there are
no duplications
Explanation:
Detected in the first query, absent in the second query, and there are no
duplications.
A. Combining the results of two select statements will be done using UNION
whereas combined records from both queries are returned by UNION ALL
operator.
B. Combining the results of two select statements will be done using UNION
ALL whereas combined records from both queries are returned by UNION
operator.
C. After performing the UNION operation, duplicate rows will not be removed
whereas after performing the UNION ALL operation, duplicate rows will be
removed.
D. None of the above
Answer: A) Combining the results of two select statements will be done using
UNION whereas combined records from both queries are returned by UNION ALL
operator
Explanation:
i. Combining the results of two select statements will be done using UNION
whereas combined records from both queries are returned by UNION ALL
operator.
ii. After performing the UNION ALL operation, duplicate rows will not be
removed whereas after performing the UNION operation, duplicate rows
will be removed.
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:
Explanation:
A. MIN()
B. MAX()
C. LARGE()
D. AVG()
Answer: B) MAX()
Explanation:
ADVERTISEMENT
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:
ADVERTISEMENT
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:
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:
i. DISTINCT can return only distinct values.
ii. DISTINCT operates only on the single column
iii. DISTINCT can be used with the aggregates such as COUNT, AVG, etc.
ADVERTISEMENT
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:
A. FROM
B. TO
C. WHERE
D. IN
Answer: C) WHERE
Explanation:
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.
A. open()
B. translate()
C. transaction()
D. execute()
Answer: C) transaction()
Explanation:
A. Transaction
B. Commit
C. Rollback
D. All of the above
Explanation:
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?
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.
A. 10
B. 20
C. 30
D. 40
Answer: C) 30
Explanation:
ADVERTISEMENT
A. Inline Comments
B. Single Line Comments
C. Multi-line Comments
D. All of the above
Explanation:
Type of SQL Comments are Inline Comments, Single Line Comments and Multi-
line Comments.
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:
SQL Injection is a Code Penetration Technique and loss to our database could be
caused due to SQL Injection.
Explanation:
SQL Injection occurs when the user is asked to input a username. In replacement
of the name or the user ID, a SQL statement is provided by the user.
Explanation:
To insert, update and delete the data are all the types of SQL Injection attacks
and the attack can be used to modify the cookies to harm the database query of
the web application.
4. Which of the following is TRUE about the type of SQL Injection attack?
Explanation:
5. Select the correct statement which will return all the rows from the Table
and then also deletes the Table_Add table?
Explanation:
The correct statement which will return all the rows from the Table and then also
deletes the Table_Add table is – SELECT * FROM Table; DROP TABLE
Table_Add.
ADVERTISEMENT
Explanation:
Explanation:
Explanation:
Explanation:
Host-based IDS can be used to monitor the web server logs and when something
weird occurs.
Explanation:
In order to prevent the SQL Injection attack, we should pre-define the input type,
input field, and length of the user data to validate the input for the user
authentication. Access privileges should be restricted for the users and
administrator accounts should not be used.
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
Explanation:
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.
A. Once
B. Twice
C. Thrice
D. None of the above
Answer: A) Once
Explanation:
ADVERTISEMENT
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.
Answer: B) DROP
Explanation:
A. Primary
B. Foreign
C. Composite
D. Unique
Answer: B) Foreign
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:
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.
Explanation:
Explanation:
Relational databases are required in The Foundation Rule of 12 Codd's Rules. By
using its relational capabilities, the system will be able to manage the database.
A. The primary key value, table name, and column name are characteristics
that allow us to access the precise data (atomic value) logically from a
relational database.
B. Null values are treated in database records according to this rule.
C. Database systems must update all views tables on a regular basis.
D. Databases contain a wide variety of information, and each row and column
of each table must hold this information.
Answer: D) Databases contain a wide variety of information, and each row and
column of each table must hold this information
Explanation:
4. In case of ____Rule, the primary key value, table name, and column name
are characteristics that allow us to access the precise data (atomic value)
logically from a relational database.
Explanation:
In case of Guaranteed Access Rule, the primary key value, table name, and
column name are characteristics that allow us to access the precise data (atomic
value) logically from a relational database.
A. No value in cell
B. Inappropriate Information
C. Unknown data
D. All of the above
Explanation:
Null Values in Systematic Treatment of Null Values in the 12 Codd's Rules has
different meanings such as no value in the cell, missing the data, inappropriate
information, the primary key should not be null and unknown data.
ADVERTISEMENT
A. The primary key value, table name, and column name are characteristics
that allow us to access the precise data (atomic value) logically from a
relational database.
B. Null values are treated in database records according to this rule.
C. Database dictionaries represent the complete logic of all descriptive data,
which must be stored online.
D. None of the above
Explanation:
A. Data Definition
B. View Definition
C. Data Manipulation
D. All of the above
Explanation:
Explanation:
In the case of the Physical Independence Rule, the Physical independence of data
to access the database is a requirement for a database or an application.
A. Physical Data
B. Logical Data
C. Integrity
D. Distribution
Explanation:
In the case of the Logical Data Independence Rule, It shouldn't make a difference
what the user sees (application) if the logical structure changes.
10. In the case of ____ Independence Rule, if using the SQL queries language
to insert data into table's cells, the database must maintain integrity
independence.
A. Interdependent
B. Intradependent
C. Integration
D. Integrity
Answer: D) Integrity
Explanation:
In the case of the Integrity Independence Rule, if using the SQL queries language
to insert data into table's cells, the database must maintain integrity
independence.
Explanation:
A. Bind
B. Dynamic
C. Both A) and B)
D. None of the above
Answer: C) Both A) and B)
Explanation:
A. Script
B. Owner
C. Opinion
D. All of the above
Explanation:
Name of the controls in SQL Script are Script, Owner and Opinion.
A. Script Name
B. Script Number
C. Script ID
D. Script Symbol
Explanation:
In the script field, script is finding by entering the partial name or script name.
A. One Line
B. Two Line
C. Three Line
D. Many Lines
Explanation:
ADVERTISEMENT
Explanation:
Description allows the Script to load the owner of the script, script name and
script editor.
Explanation:
Task list consist of Import, Export, Show Quotas and Manage Results in SQL
Script.
A. Minimum
B. Maximum
C. Average
D. None of the above
Answer: B) Maximum
Explanation:
A. Workspace_name_size/sql
B. Workspace_number_script/sql
C. Workspace_name_script/sql
D. Workspace_name_script/spl
Answer: C) Workspace_name_script/sql
Explanation:
A. Ctrl+Shift+S
B. Ctrl+Shift+Q
C. Ctrl+Shift+N
D. Ctrl+Shift+O
Answer: D) Ctrl+Shift+O
Explanation:
ADVERTISEMENT
11. In order to delete the Script in the Script Editor, the following steps need
to be followed:
Options:
Explanation:
The correct order in which the steps need to be followed in order to delete the
script in the script editor is as follows:
i. Go to the workspace home page and select SQL Workshop, then SQL
Scripts. On the screen, you will see the SQL Scripts page.
ii. In the Script Editor, select the script to be deleted.
iii. Remove the script from the Script Repository by clicking the Delete button.
Prior to the deletion of the script, we are required to confirm our action.
12. Scripts ____ from various workspaces can be imported through import.
A. Exported
B. Imported
C. Changed
D. Saved
Answer: A) Exported
Explanation:
13. With export, you can ____ SQL Scripts from the SQL repositories in your
workspace.
A. Export
B. Import
C. Save
D. Exchange
Answer: B) Import
Explanation:
With export, you can import SQL Scripts from the SQL repositories in your
workspace.
A. Single Value
B. Multiple Value
C. Two Values
D. None of the above
Explanation:
A. Dependently
B. Independently
C. Interdependently
D. Intradependently
Answer: B) Independently
Explanation:
The scalar functions operate on each record independently in SQL.
A. UCASE()
B. MID()
C. ROUND()
D. All of the above
Explanation:
• UCASE()
• MID()
• ROUND()
• FORMAT()
• LCASE()
• LENGTH()
• NOW()
UCASE function is used to change the case of the string to uppercase characters.
A. Low case
B. Letter case
C. Light case
D. Lower case
Explanation:
ADVERTISEMENT
6. Which function is used to extract substrings from the column of the table
–
A. ROUND()
B. MID()
C. FORMAT()
D. NOW()
Answer: B) MID()
Explanation:
The MID() function is used to extract substrings from the column of the table.
Discuss this Question
A. Time
B. Date
C. Date & Time
D. Day
Explanation:
NOW function is used to return the current Date & Time of the system.
A. FORM()
B. DISPLAY()
C. COL()
D. FORMAT()
Answer: D) FORMAT()
Explanation:
In order to format, how the column should be displayed, the FORMAT function is
used.
Answer: B) Two
Explanation:
A. SELECT ()NOW;
B. NOW() SELECT;
C. SELECT NOW();
D. SELECT OWN();
Explanation: