SQL Questions
SQL Questions
a. FLOAT
b. NUMERIC
c. DECIMAL
d. CHARACTER
ADVERTISEMENT
a. TRUNCATE
b. ALTER
c. CREATE
d. UPDATE
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
a. Simple tables
b. Virtual tables
c. Complex tables
d. Actual Tables
a. Only 1
b. Only 2
c. Depends on no of Columns
d. Depends on DBA
a. CHAR
b. RAW
c. NUMERIC
d. VARCHAR
ADVERTISEMENT
a. Primary Key
b. Not Null
c. Check
d. Union
a. COUNT
b. COMPUTE
c. SUM
d. MAX
11) Which data manipulation command is used to combines the records from one or
more tables?
a. SELECT
b. PROJECT
c. JOIN
d. PRODUCT
a. ANY
b. BETWEEN
c. ALL
d. IN
a. NOT Operator
b. Exists Operator
c. IS NULL Operator
d. None of the above
Show Answer Workspace
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
a. 6
b. 7
c. POINT
d. JAVAT
a. INSERT
b. MODIFY
c. LOOK-UP
d. All of the above
a. SELF JOIN
b. EQUI JOIN
c. NON-EQUI JOIN
d. None of the above
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.
21) _______ clause creates temporary relation for the query on which it is defined.
a. WITH
b. FROM
c. WHERE
d. SELECT
Prints:
a. is illegal
b. garbage
c. 726
d. 70
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
24) _________ command makes the updates performed by the transaction permanent
in the database?
a. ROLLBACK
b. COMMIT
c. TRUNCATE
d. DELETE
25) How can you change "Thomas" into "Michel" in the "LastName" column in the
Users table?
a. CREATE
b. UPDATE
c. ALTER
d. SELECT
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
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
32) Why we need to create an index if the 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
a. Read operations
b. Write operations
c. A & B both
d. None of the above
a. Numeric value
b. Alphanumeric value
c. A & B both
d. None of the above
a. 39 digits
b. 38 digits
c. 40 digits
d. 37 digits
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
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
a. Equal
b. IN
c. IS
d. None of Above
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
42) Which of the following options are correct regarding these three keys (Primary
Key, Super Key, and Candidate Key) in a database?
a. I and II
b. II and III
c. I and III
d. II and IV
a. FOREIGN KEY
b. PRIMARY KEY
c. UNIQUE
d. ALTERNATE KEY
45) Find the cities name with the condition and temperature from table 'whether'
where condition = sunny or cloudy but temperature >= 60.
a. SELECT city, temperature, condition FROM weather WHERE condition =
'cloudy' AND condition = 'sunny' OR temperature >= 60
b. SELECT city, temperature, condition FROM weather WHERE condition =
'cloudy' OR condition = 'sunny' OR temperature >= 60
c. SELECT city, temperature, condition FROM weather WHERE condition =
'sunny' OR condition = 'cloudy' AND temperature >= 60
d. SELECT city, temperature, condition FROM weather WHERE condition =
'sunny' AND condition = 'cloudy' AND temperature >= 60
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?
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
48) Which statement is used to get all data from the student table whose name starts
with p?
ADVERTISEMENT
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
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
a. 0
b. 1
c. 00
d. An error statement
54) What is the need for our query to execute successfully on an existing view?
ADVERTISEMENT
55) Which of the following operator can be used with a multiple-row subquery?
a. =
b. BETWEEN
c. NOT IN
d. <>
56) _______ is a constraint that can be defined only at the column level?
a. UNIQUE
b. NOT NULL
c. CHECK
d. PRIMARY KEY