70+ Important MCQ Introduction to SQL Class 11

Share with others

Introduction to SQL

Introduction to SQL
SQL

Q1. Which of the following is not an example of RDBMS?

a. MySQL

b. Oracle

c. PostgreSQL

d. None of the above

Q2. ___________ is the most popular query language used by major relational database management systems.

a. Structured Query Language

b. Structured Language of Query

c. Language of Structured Query

d. Query of Structured Language

Q3. SQL is a case sensitive language. (T/F)

a. True

b. False

Q4. Which of the following symbol is used to end SQL statements?

a. Comma (,)

b. Colon (:)

c. Semi Colon (;)

d. Question mark (?)

Q5. Identify the odd one out in reference to data type in MySQL.

a. Char (5)

b. Varchar (5)

c. String (5)

d. Integer

Q6. Which of the following is not correct about data type in MySQL?

a. Data type indicates the type of data value that an attribute can have.

b. The data type of an attribute decides the operations that can be performed on the data of that attribute.

c. Arithmetic operations can be performed on numeric data but not on character data.

d. Data type of at least two attribute in a table should be same..

Q7. Which of the following is fixed length data type?

a. Char(5)

b. Varchar(5)

c. Both of the above

d. None of the above

Q8. Which of the following is variable length data type?

a. Char(5)

b. Varchar(5)

c. Both of the above

d. None of the above

Q9. Char(n) Specifies character type data of length n where n could be any value from ________.

a. 0 to 254

b. 0 to 256

c. 0 to 255

d. 0 to 257

Q10. Varchar(n) specifies character type data of length ‘n’ where n could be any value from ____________

a. 0 to 655

b. 0 to 65535

c. 0 to 65536

d. 0 to 656

Introduction to SQL

Introduction to SQL
SQL

Click here to test yourself on Introduction to SQL Class 11 MCQ Questions

Introduction to SQL

Q11. INT data type in MySQL specifies an integer value. Each INT value occupies ________________ of storage

a. 6 bytes

b. 8 bytes

c. 4 bytes

d. 2 bytes

Q12. __________ data type holds numbers with decimal points.

a. INT

b. BIGINT

c. CHAR

d. FLOAT

Q13. Each FLOAT value in MySQL occupies ______

a. 2 bytes

b. 4 bytes

c. 6 bytes

d. 10 bytes

Q14. Default format of date in MySQL is ______

a. YYYY-MM-DD

b. MM-DD-YYYY

c. DD-MM-YYYY

d. DD-YYYY-MM

Q15. Name an attribute for which fixed length string is suitable?

a. Name

b. Address

c. Pin Code

d. City

Q16. It is mandatory to define constraint for each attribute of a table. (T/F)

a. True

b. False

Q17. ____ are certain types of restrictions on the data values that an attribute can have.

a. Data type

b. Constraints

c. Data Consistency

d. Data Redundancy

Q18. Which of the following is not the constraint in MySQL?

a. Primary Key

b. Foreign Key

c. Candidate Key

d. Unique

Q19. The column which can uniquely identify each record in a table is called _________

a. Primary Key

b. Foreign Key

c. Candidate Key

d. Unique

Q20. The column which refers to value of an attribute defined as primary key in another table is called ______

a. Primary Key

b. Foreign Key

c. Candidate Key

d. Unique

Introduction to SQL

Introduction to SQL
SQL

Click here to test yourself on Introduction to SQL Class 11 MCQ Questions

Introduction to SQL

Q21. A value which automatically appears in a column as soon as we enter the new record is called ________

a. Default Value

b. Primary Value

c. Auto Value

d. Unique Value

Q22. Which constraint ensures that a column cannot have NULL values?

a. NULL

b. NOT NULL

c. FOREIGN KEY

d. DEFAULT

Q23. _______ statement is used to create a database and its tables.

a. Use

b. New

c. Create

d. Design

Q24. DDL stands for ___________

a. Data & Database Language

b. Defining Data Language

c. Data Definition Language

d. None of the above

Q25. Write a command to create a database named ‘stock’ in MySQL.

a. Create stock;

b. Create database stock;

c. Create databases stock;

d. Use stock;

Q26. ________ command that lists names of all the tables within a database.

a. Show tables;

b. Show table;

c. Show all tables;

d. Show all table;

Q27. Which of the following command is used to open the database that we want to use?

a. Open

b. Use

c. New

d. Define

Q28. What is the degree of a table which has ‘N’ columns and ‘M’ tuples in a table?

a. N * M

b. N + M

c. N

d. M

Q29. What is the cardinality of a table which has ‘N’ columns and ‘M’ tuples in a table?

a. N * M

b. N + M

c. M

d. N

Q30. By default, each attribute can take NULL values except for the ________

a. Foreign Key

b. Primary Key

c. Alternate Key

d. None of the above

Introduction to SQL

Introduction to SQL
SQL

Click here to test yourself on Introduction to SQL Class 11 MCQ Questions

Introduction to SQL

Q31. Suppose we store guardian’s 12 digit Aadhaar number as GUID (Guardian ID) in School table, we can declare GUID as _________ since Aadhaar number is of fixed length and we are not going to perform any mathematical operation on GUID.

a. CHAR(12)

b. VARCHAR(12)

c. INT(12)

d. FLOAT(13,1)

Q32. Can we have a CHAR or VARCHAR data type for contact number (mobile, landline)?

a. YES

b. NO

Q33. Write a command to view the structure of table named ‘School’.

a. Desc School;

b. Describe School;

c. Both of the above

d. None of the above

Q34. What is the purpose of following command?

Show tables;

a. It shows all the tables in the MySQL.

b. It shows all the tables in the current database.

c. It return error.

d. None of the above

Q35. We can change the structure of the table by using the ____________ statement.

a. Modify

b. Alter

c. Update

d. Add

Q36. Ananya created a table ‘School’ in MySQL but forgot to declare an attribute ‘Rollno’ as primary key. Which command will help her to add primary key after table creation?

a. Update

b. Add

c. Modify

d. Alter

Q37. What is composite primary key?

a. When a table has two primary key then it is called composite primary key.

b. When a table has two or more primary key then it is called composite primary key.

c. When two or more field combined together and uniquely identify each record then it is called composite primary key.

d. A field uniquely identifies each record in a table then it is called composite primary key.

Q38. Write a command to add primary key to the ATTENDANCE relation. The primary key of this relation is a composite key made up of two attributes — AttendanceDate and RollNumber.

a. ALTER TABLE ATTENDANCE ADD PRIMARY KEY(AttendanceDate, RollNumber);

b. ALTER TABLE ATTENDANCE ADD PRIMARY (AttendanceDate, RollNumber);

c. ALTER TABLE ATTENDANCE MODIFY PRIMARY KEY(AttendanceDate, RollNumber);

d. CREATE TABLE ATTENDANCE ADD PRIMARY KEY(AttendanceDate, RollNumber);

Q39. A relation may have multiple foreign keys. (T/F)

a. True

b. False

Q40. Which of the following points need to be taken care while adding foreign key to a relation

a. The referenced relation must be already created.

b. The referenced attribute must be a part of primary key of the referenced relation.

c. Data types and size of referenced and referencing attributes must be same.

d. All of the above

Introduction to SQL


Click here to test yourself on Introduction to SQL Class 11 MCQ Questions

Introduction to SQL

Q41. Which command will help to set Foreign key in MySQL?

a. Update

b. Select

c. Create

d. Alter

Q42. ____ key involved two tables.

a. Primary

b. Foreign

c. Alternate

d. Candidate

Q43. Candidate key – Primary key = ____________

a. Alternate Key

b. Foreign Key

c. Candidate Key

d. Primary Key

Q44. UNIQUE constraint means no two values in that column should be same. (T/F)

a. True

b. False

Q45. Which command is used to add an attribute to an existing table.

a. Create

b. Alter

c. Update

d. Select

Q46. Write a command to add a new column “contactno” of data type char(10) in an already existing table “school”.

a. Alter table school add contactno char(10);

b. Alter school add contactno char(10);

c. Alter table school new contactno char(10);

d. Alter table school add contactno datatype char(10);

Q47. Suppose the principal of the school has decided to award scholarship to some needy students for which income of the guardian must be known. But school has not maintained income attribute with table GUARDIAN so far. Therefore, the database designer now needs to add a new attribute ‘income’ of data type INT in the table GUARDIAN.

a. Alter table GUARDIAN add attribute income INT;

b. Update table GUARDIAN add income INT;

c. Alter table GUARDIAN add income INT;

d. Modify table GUARDIAN add income INT;

Q48. Alter statement in MySQL is used to __________

a. Add a new column in a table

b. Delete a column from the table

c. Modify the data type of a column

d. All of the above

Q49. Suppose we need to change the size of attribute NAME from VARCHAR(30) to VARCHAR(40) of the SCHOOL table. The MySQL statement will be

a. Alter table STUDENT MODIFY NAME VARCHAR(40);

b. Alter STUDENT MODIFY NAME VARCHAR(40);

c. Alter table STUDENT MODIFY column NAME VARCHAR(40);

d. Alter table STUDENT MODIFY NAME data type VARCHAR(40);

Q50. We can change an attribute’s constraint from NULL to NOT NULL using _________

a. Create Statement

b. Modify Statement

c. Update Statement

d. Alter Statement

Introduction to SQL


Click here to test yourself on Introduction to SQL Class 11 MCQ Questions

Introduction to SQL

Q51. What is the purpose of following command?

Alter Table Student Drop Fee;

a. It will delete Fee column from table Student.

b. It will delete Student column from table Fee.

c. It will delete last column of table Student.

d. It will remove table Student completely from MySQL

Q52. Write a command to remove primary key of table EMP.

a. Alter EMP Drop Primary Key;

b. Alter table EMP Drop Primary Key;

c. Alter table EMP Remove Primary Key;

d. Alter table EMP Delete Primary Key;

Q53. Name a constraint used to specify the default value to an attribute in a table.

a. By Default

b. Default

c. Set

d. Update

Q54. Write a command to remove an attribute “Author” from the table “Book”.

a. Alter Book drop column Author

b. Alter Book drop Author

c. Alter table Book drop Author

d. Alter Book delete column Author

Q55. What is the purpose of following query?

ALTER TABLE table_name DROP PRIMARY KEY;

a. It will remove the primary key column from the table.

b. It will remove the primary key constraint from the table.

c. It will delete the entire table.

d. None of the above

Q56. We can use ______ statement to remove a database permanently from the system.

a. Remove

b. Delete

c. Drop

d. Cut

Q57. We can use ______ statement to remove a table permanently from the system.

a. Remove

b. Delete

c. Drop

d. Cut

Q58. Write a command to delete table ‘Stock’ permanently.

a. Drop Stock

b. Drop table Stock Permanently.

c. Drop table Stock

d. Drop Stock Permanently

Q59. Write a command to delete database ‘mydb’ permanently.

a. Drop mydb;

b. Drop database mydb Permanently;

c. Drop databases mydb;

d. Drop database mydb;

Q60. ________ statement is used to insert new records in a table.

a. Insert into

b. Alter

c. Create

d. Update

Introduction to SQL


Click here to test yourself on Introduction to SQL Class 11 MCQ Questions

Introduction to SQL

Q61. Write an SQL statement to view all the inserted records in table “employee”

a. Select all from employee;

b. Select all records from employee;

c. Select * from employee;

d. Show * from employee;

Q62. Which of the following syntax is used to insert values of specific columns?

SYNTAX-1 : INSERT INTO tablename (column1, column2, ...)
VALUES (value1, value2, ...);

SYNTAX-2 : INSERT INTO tablename VALUES (value1, value2, ...);

a. SYNTAX-1

b. SYNTAX-2

c. Both SYNTAX-1 & SYNTAX-2

d. None of the above

Q63. Which of the following types of values should be enclosed in single quotes while inserting into table?

a. Integers

b. Text

c. Date

d. Both Text & Date

Q64. Amit has written the following query in MySQL to insert a record in table ‘Student’ which has degree 6. Read this query carefully and tell that how many NULL values will be inserted in this record?

Insert into student(Rolno, Name, Class, Section) Values (1, NULL, ‘X’, ‘A’);

a. 1

b. 2

c. 3

d. 4

Q65. Which of the following will display detail of all from table ‘Student’ in increasing order of Roll Number?

a. Select * from Student;

b. Select * from Student order by Rolno;

c. Select Rolno from Student order by Rolno;

d. Select * from Student order by Rolno desc;

Q66. Can we insert two records with the same roll number? Identify the most appropriate option from the following.

a. Yes, we can if roll number is not a primary key.

b. No, we can not

c. Yes we can if roll number is a primary key.

d. No, we can not if roll number is not a primary key.

Q67. The following query is returning an error. Identify the correct query from the following.

Select salary from emp where name = NULL;

a. Select salary from emp where name == NULL;

b. Select salary from emp where name is NULL;

c. Select salary from emp where name = “NULL”;

d. Select salary from emp where name NULL;

Q68. In case we want to rename any column while displaying the output, we can do so by using ______________ in the query.

a. as

b. change

c. rename

d. alternate

Q69. The following query is returning an error. Identify the correct query from the following.

Select salary * 12 as Annual Salary from emp;

a. Select salary * 12 Annual Salary from emp;

b. Select salary * 12 as Annual Salary from emp

c. Select salary * 12 as “Annual Salary” from emp;

d. Select salary * 12 from emp as Annual Salary;

Q70. The SELECT statement when combined with _______ clause, returns records without repetition.

a. DISTINCT

b. WHERE

c. ORDER BY

d. GROUP BY

Introduction to SQL


Click here to test yourself on Introduction to SQL Class 11 MCQ Questions

Introduction to SQL



Chapter Wise MCQ

1. Functions in Python

2. Flow of Control (Loop and Conditional statement)

3. 140+ MCQ on Introduction to Python

4. 120 MCQ on String in Python

5. 100+ MCQ on List in Python

6. 50+ MCQ on Tuple in Python

7. 100+ MCQ on Flow of Control in Python

8. 60+ MCQ on Dictionary in Python


Important Links

100 Practice Questions on Python Fundamentals

120+ MySQL Practice Questions

90+ Practice Questions on List

50+ Output based Practice Questions

100 Practice Questions on String

70 Practice Questions on Loops

70 Practice Questions on if-else


Disclaimer : I tried to give you the correct answers of ”Introduction to SQL Class 11 MCQ” , but if you feel that there is/are mistakes in the answers of “Introduction to SQL Class 11 MCQ “ given above, you can directly contact me at csiplearninghub@gmail.com. This study material is taken from CBSE content.

Introduction to SQL


Share with others

Leave a Reply

error: Content is protected !!