SQL Test Questions Answers
Question No. 1 of 30
A SQL command that is used to reduce the access time is
• MINIMIZE
• REDUCETIME
• INDEX
• MINTIME
Correct Answer: INDEX
Question No. 2 of 30
The SQL command used to avoid the selection of duplicate rows is
• UNIQUE
• DISTINCT
• EXCLUSIVE
• DISCRETE
Correct Answer: DISTINCT
Question No. 3 of 30
SAVEPOINT is
• Saves the data in database
• Identifies a point in a transaction to which we can later rollback
• Saves the profiles in database
• None of the Above
Correct Answer:
Identifies a point in a transaction to which we can later rollback
Question No. 4 of 30
Using SQL it is possible to create
• Column Constraint
• Table Constraint
• Both A. and B.
• None of the Above
Correct Answer: Both A. and B.
Question No. 5 of 30
What does the following function value return? ABS(-50)
• 50
• -1
• -50
• 100 Correct
Answer: 50
Question No. 6 of 30
The SQL function SIGN (-50) gives value as
• -50
• 50
• -1
• 1
ANSWER : -1
Question No. 7 of 30
The ROWID data type value represents
• row.block.file
• block.row.file
• file.row.block
• block.file.row
Correct Answer: block.row.file
Question No. 8 of 30
The SQL query gives output as: select power(2,3) from dual;
• 8
• 9
• 6
• 10
Correct Answer: 8
Question No. 9 of 30
Which of the following SQL command represent character data type?
• CHAR
• VARCHAR
• VARCHAR2
• All the Above
Correct Answer: All the Above
Question No. 10 of 30
DDL stands for
• Data Definition Language
• Data Division Language
• Data Dividing Language
• Digital Defining Language
Correct Answer: Data Definition Language
Question No. 11 of 30
The default headsep character when SQLPLUS is activated first is
• The horizontal bar (-)
• The vertical bar (|)
• The hash symbol (#)
• The exclamation mark (!)
Correct Answer: The vertical bar (|)
Question No. 12 of 30
SQL commands are classified into how many broad categories
• Two
• Three
• Four
• Five
Correct Answer: Three
Question No. 13 of 30
Which of the following is FALSE about a ALTER TABLE command of SQL?
• ALTER TABLE command is used to create a table
• ALTER TABLE command is used to change the column elements in a table
• ALTER TABLE command is used to delete a table
• Both A. and C.
Correct Answer: Both A. and C.
Question No. 14 of 30
A table created within a table is called
• Sub query
• Normalization
• Nested Table
• Inner Table
Correct Answer: Nested Table
Question No. 15 of 30
The table dropped can be
• Retrieved by using commit
• Cannot be retrieved
• Retrieved by altering the table
• Retrieved by rollback
Correct Answer: Cannot be retrieved
Question No. 16 of 30
SysDate function contain
• Only Current Date
• Only Current Time
• Both Current Date and Current Time
• Only Hours of Time
Correct Answer: Both Current Date and Current Time
Question No. 17 of 30
While creating tables the concept that is used to reduce redundancy in data is called
• Views
• Aliases
• Sequence
• Normalization
Correct Answer: Normalization
Question No. 18 of 30
The number of records in a table emp is given by the SQL statement
• select total(*) from emp;
• select count(*) from emp;
• select sum(*) from emp;
• select total from emp;
Correct Answer: select count(*) from emp;
Question No. 19 of 30
Which of the following is TRUE about subqueries in SQL?
• Sub queries must be enclosed in parenthesis
• BETWEEN cannot be used with a sub query
• Both A. and B.
• None of the Above
Correct Answer: Both A. and B.
Question No. 20 of 30
An alias name for a base table is
• View
• Index
• Synonym
• Sequence
Correct Answer: Synonym
Question No. 21 of 30
In a database row is also called as
• Query
• Attribute
• Relation
• Record
Correct Answer: Record
Question No. 22 of 30
The ORDER BY in SQL is used to order rows
• in ascending order
• descending order
• both A. and B.
• None of the Above
Correct Answer: both A. and B.
Question No. 23 of 30
If the value is null in order to place a value in it the function used is
• Substitute( )
• Place value ( )
• NVL ( )
• Place( )
Correct Answer: NVL ( )
Question No. 24 of 30
Which of the following denote group clause in SQL
• having
• group by
• Where
• Both A. and B.
Correct Answer: Both A. and B.
Question No. 25 of 30
What does the following SQL statement return? Assume the value of SysDate is 05-05-5555 Select SysDate / 5 from dual;
• 01-01-1111
• Error
• 01
• 1111
Correct Answer: Error
Question No. 26 of 30
Which of the following is TRUE about Views in SQL?
• Views are windows of existing table
• Creation of view is done by using CREATE VIEW statement
• Views do not contain data but table from which it is created contain data
• All the Above
Correct Answer: All the Above
Question No. 27 of 30
Which of the following normalization forms are available?
• Third Normal Form
• Boyce Code Normal Form
• Fourth normal Form
• Both A. and B.
Correct Answer: Both A. and B
Question No. 28 of 30
The tables can be combined together in SQL using the concept of
• Normalization
• Indexing
• Sequence
• Join
Correct Answer: Join
Question No. 29 of 30
SQL is a
• Non- procedural language
• Procedural language
• Database Language
• Both A. and C.
Correct Answer: Both A. and C.
Question No. 30 of 30
Which of the following will insert a record into emp table having empno and eaname as columns?
• INSERT INTO EMP VALUES ( 1000,’SRI’);
• INSERT INTO EMP (1000,’SRI’);
• INSERT FROM EMP VALUES (1000,’SRI’);
• INSERT FROM EMP (1000,’SRI’);
Correct Answer:
INSERT INTO EMP VALUES ( 1000,’SRI’);