SQL Basic Questions and Answers
SQL MCQs : This section focuses on the "Basics" of the SQL. These Multiple Choice Questions (mcq) should be practiced to improve the SQL skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exam and other competitive examinations.
1. Which one of the following is used to define the structure of the relation ,deleting relations and relating schemas ?
A. DML(Data Manipulation Langauge)
B. DDL(Data Definition Langauge)
C. Query
D. Relational Schema
View Answer
Ans : B
Explanation: Data Definition language is the language which performs all the operation in defining structure of relation.
2. The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character.
A. Fixed, equal
B. Fixed, variable
C. Equal, variable
D. Variable, equal
View Answer
Ans : B
Explanation: Fixed, variable Varchar changes its length accordingly whereas char has a specific length which has to be filled by either letters or spaces .
3. Insert into Business values (10211, "Jhon", "Chemist", 66000); What type of statement is this ?
A. Query
B. DML
C. Relational
D. DDL
View Answer
Ans : B
Explanation: The values are manipulated .So it is a DML.
4. Aggregate functions can be used in the select list or the_______clause of a select statement or subquery. They cannot be used in a ______ clause.
A. Having, where
B. Group by, having
C. Group by, where
D. Where, having
View Answer
Ans : A
Explanation: To include aggregate functions having clause must be included after where.
5. Subqueries cannot:
A. Appear in select, update, delete, insert statements.
B. Retrieve data from a table different from the one in the outer query
C. Join tables
D. Use group by or group functions
View Answer
Ans : C
Explanation: No Explanation.
6. How can you find rows that do not match some specified condition?
A. EXISTS
B. Double use of NOT EXISTS
C. NOT EXISTS
D. None of the mentioned is correct.
View Answer
Ans : B
Explanation: Double use of NOT EXISTS
7. DBMS is an interface between
A. Database and User
B. Database application and database
C. Database and SQL
D. Data and Database
View Answer
Ans : B
Explanation: DBMS is an interface between Database application and database
8. Which of the following is an advantage of database management approach?
A. Data is dependent on programs
B. Data redundancy increases
C. Data can be accessed by multiple programs
D. Multiple users cannot access data concurrently
View Answer
Ans : C
Explanation: Data can be accessed by multiple programs following is an advantage of database management approach
9. The attribute value that is currently unknown is
A. 0
B. -1
C. NULL
D. "
View Answer
Ans : C
Explanation: The attribute value that is currently unknown is NULL
10. A relationship among a set of values in a table is represented by a
A. Relation
B. Column
C. Row
D. Attributes
View Answer
Ans : C
Explanation: A relationship among a set of values in a table is represented by a Row.
Also check :
Discussion