CUET Computer Science MCQs Chapter 8 Structured Query Language

Refer to CUET Computer Science MCQs Chapter 8 Structured Query Language provided below available for download in Pdf. The MCQ Questions for UG Computer Science with answers are aligned as per the latest syllabus and exam pattern suggested by CUET, NCERT and KVS. Multiple Choice Questions for Chapter 8 Structured Query Language are an important part of exams for UG Computer Science and if practiced properly can help you to improve your understanding and get higher marks. Refer to more Chapter-wise MCQs for CUET UG Computer Science and also download more latest study material for all subjects

MCQ for UG Computer Science Chapter 8 Structured Query Language

UG Computer Science students should refer to the following multiple-choice questions with answers for Chapter 8 Structured Query Language in UG.

Chapter 8 Structured Query Language MCQ Questions UG Computer Science with Answers

Question. Which of the following is not an example of RDBMS?
a. MySQL
b. Oracle
c. PostgreSQL
d. None of the above

Answer : D

Question. What is the full form of SQL?
a. Structured Query List
b. Structure Query Language
c. Sample Query Language
d. None of these.

Answer : B

Question. 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

Question. Which datatype can store unstructured data in a column?
a. CHAR
b. RAW
c. NUMERIC
d. VARCHAR

Answer : B

Question. 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

Answer : C

Question. What operator tests column for absence of data
a. NOT Operator
b. Exists Operator
c. IS NULL Operator
d. None of the above

Answer : C

Question. The column which can uniquely identify each record in a table is called _________
a. Primary Key
b. Foreign Key
c. Candidate Key
d. Unique

Answer : A

Question. 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

Question. _______ statement is used to create a database and its tables.
a. Use
b. New
c. Create
d. Design

Answer : C

Question. _________ command makes the updates performed by the transaction permanent in the database?
a. ROLLBACK
b. COMMIT
c. TRUNCATE
d. DELETE
Answer : B

Question. 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

Answer :C

Question. Which statement is true regarding procedures?
a. They include procedural and SQL statements.
b. They work similarly to the functions.
c. It does not need unique names.
d. It cannot be created with SQL statements.

Answer : A

Question. 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)

Answer : A

Question. Which of the following is the correct order of a SQL statement?
a. SELECT, GROUP BY, WHERE, HAVING
b. SELECT, WHERE, GROUP BY, HAVING
c. SELECT, HAVING, WHERE, GROUP BY
d. SELECT, WHERE, HAVING, GROUP BY

Answer : B

Question. 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);

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

Question. Candidate key – Primary key = ____________
a. Alternate Key
b. Foreign Key
c. Candidate Key
d. Primary Key

Answer : A

Question. 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

Answer : D

Question. Which of the following options are correct regarding these three keys (Primary Key, Super Key, and Candidate Key) in a database?
I. Minimal super key is a candidate key
II. Only one candidate key can be a primary key
III. All super keys can be a candidate key
IV. We cannot find a primary key from the candidate key
a) I and II
b) II and III
c) I and III
d) II and IV

Answer : A

Question. 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

Answer : C

Question. 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?
a) SELECT * FROM weather WHERE humidity IN (60 to 75)
b) SELECT * FROM weather WHERE humidity BETWEEN 60 AND 75
c) SELECT * FROM weather WHERE humidity NOT IN (60 AND 75)
d) SELECT * FROM weather WHERE humidity NOT BETWEEN 60 AND 75

Answer : B

Question. Write a command to delete table ‘Stock’ permanently.
a. Drop Stock
b. Drop table Stock Permanently.
c. Drop table Stock
d. Drop Stock Permanently

Answer : C

Question. 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

Answer : A

Question. Which of the following is not a DDL command?
a. TRUNCATE
b. ALTER
c. CREATE
d. UPDATE

Answer : D

Question. In which of the following cases a DML statement is not executed?
a. When existing rows are modified.
b. When a table is deleted.
c. When some rows are deleted.
d. All of the above

Answer : B

Question. 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;

Answer : B

Question. Which of the following is true about the HAVING clause?
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

Question. The SELECT statement when combined with _______ clause, returns records without repetition.
a. DISTINCT
b. WHERE
c. ORDER BY
d. GROUP BY

Answer : A

Question. A CASE SQL statement is ________?
a. A way to establish a loop in SQL.
b. A way to establish an IF-THEN-ELSE in SQL
c. A way to establish a data definition in SQL
d. All of the above.

Answer : B

Question. 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

Answer : C

Question. Sequence can generate
a. Numeric value
b. Alphanumeric value
c. A & B both
d. None of the above

Answer : C

Question. 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;

Answer : C

Question. ___________ 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

Answer : A

Question. 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

Question. 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

Answer : A

Question. _______ 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

Question. Which of the following is not the constraint in MySQL?
a. Primary Key
b. Foreign Key
c. Candidate Key
d. Unique

Answer : C

Question. Which constraint ensures that a column cannot have NULL values?
a. NULL
b. NOT NULL
c. FOREIGN KEY
d. DEFAULT

Answer : B

Question. 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

Answer : C

Question. Which command will help to set Foreign key in MySQL?
a. Update
b. Select
c. Create
d. Alter

Answer : D

Question. Shared locks are applied while performing
a. Read operations
b. Write operations
c. A & B both
d. None of the above

Answer : A

Question. Which of the following symbol is used to end SQL statements?
a. Comma (,)
b. Colon (:)
c. Semi Colon (;)
d. Question mark (?)

Answer : C

Question. Which operator is used to compare the NULL values in SQL?
a. Equal
b. IN
c. IS
d. None of Above

Answer : C

Question. 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

Answer : B

Question. 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

Answer : C

Question. 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

Answer : A

Question. Which of the following is not a valid SQL type?
a. FLOAT
b. NUMERIC
c. DECIMAL
d. CHARACTER

Answer : C

Question. 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;

Answer : B

Question. Which of the following is not a valid aggregate function?
a. COUNT
b. COMPUTE
c. SUM
d. MAX

Answer : B

Question. 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

Answer : B

Question. 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

Question. ____ key involved two tables.
a. Primary
b. Foreign
c. Alternate
d. Candidate

Answer : B

Question. How can you change "Thomas" into "Michel" in the "LastName" column in the Users table?
a. UPDATE User SET LastName = 'Thomas' INTO LastName = 'Michel'
b. MODIFY Users SET LastName = 'Michel' WHERE LastName = 'Thomas'
c. MODIFY Users SET LastName = 'Thomas' INTO LastName = 'Michel'
d. UPDATE Users SET LastName = 'Michel' WHERE LastName = 'Thomas'

Answer : D

Question. 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);

Answer : B

Question. 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

Question. Name a constraint used to specify the default value to an attribute in a table.
a. By Default
b. Default
c. Set
d. Update

Answer : B

Question. When the wildcard in a WHERE clause is useful?
a. When an exact match is required in a SELECT statement.
b. When an exact match is not possible in a SELECT statement.
c. When an exact match is required in a CREATE statement.
d. When an exact match is not possible in a CREATE statement.

Answer : B

Question. Write a command to delete database ‘mydb’ permanently.
a. Drop mydb;
b. Drop database mydb Permanently;
c. Drop databases mydb;
d. Drop database mydb;

Answer : D

Question. Which statement is used to get all data from the student table whose name starts with p?
a. SELECT * FROM student WHERE name LIKE '%p%';
b. SELECT * FROM student WHERE name LIKE 'p%';
c. SELECT * FROM student WHERE name LIKE '_p%';
d. SELECT * FROM student WHERE name LIKE '%p';

Answer : B

Question. 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;

Answer : B

Question. Which of the following are TCL commands?
a. COMMIT and ROLLBACK
b. UPDATE and TRUNCATE
c. SELECT and INSERT
d. GRANT and REVOKE

Answer : A

Question. Identify the odd one out in reference to data type in MySQL.
a. Char (5)
b. Varchar (5)
c. String (5)
d. Integer

Answer : C

Question. 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

Question. Name an attribute for which fixed length string is suitable?
a. Name
b. Address
c. Pin Code
d. City

Answer : C

Question. 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..

Answer : D

Question. SQL Views are also known as
a. Simple tables
b. Virtual tables
c. Complex tables
d. Actual Tables

Answer : B

Question. ____ 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

Answer : B

Question. Which operator is used to compare a value to a specified list of values?
a. ANY
b. BETWEEN
c. ALL
d. IN

Answer : D

Question. ________ 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;

Answer : A

Question. _______ clause creates temporary relation for the query on which it is defined.
a. WITH
b. FROM
c. WHERE
d. SELECT

Answer : A

Question. We can change the structure of the table by using the ____________ statement.
a. Modify
b. Alter
c. Update
d. Add

Answer : B

Question. Which statement is true regarding routines and triggers?
a. Both run automatically.
b. Both are stored in the database.
c. Both consist of procedural code.
d. Both have to be called to operate.

Answer : C

Question. 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

Answer : D

Question. A sequence in SQL can generate a maximum number:
a. 39 digits
b. 38 digits
c. 40 digits
d. 37 digits

Answer : B

Question. 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

Answer : D

Question. _____ is NOT a type of constraint in SQL language?
a. FOREIGN KEY
b. PRIMARY KEY
c. UNIQUE
d. ALTERNATE KEY

Answer : D

Question. We can use ______ statement to remove a database permanently from the system.
a. Remove
b. Delete
c. Drop
d. Cut

Answer : C

Question. How many Primary keys can have in a table?
a. Only 1
b. Only 2
c. Depends on no of Columns
d. Depends on DBA

Answer : A

Question. 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

Answer : D

Question. What is returned by INSTR ('JAVAT POINT', 'P')?
a. 6
b. 7
c. POINT
d. JAVAT

Answer : B

Question. 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.

Answer : A

Question. 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

Question. 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

Answer : B

Question. Which command is used to change the definition of a table in SQL?
a. CREATE
b. UPDATE
c. ALTER
d. SELECT

Answer : C

Question. 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.

Answer : C

Question. Why we need to create an index if the primary key is already present in a table?
a. Index improves the speed of data retrieval operations on a table.
b. Indexes are special lookup tables that will be used by the database search engine.
c. Indexes are synonyms of a column in a table.
d. All of the above

Answer : A

Question. 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;

Answer : C

Question. 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
t) None of these

Answer : B

Question. We can use ______ statement to remove a table permanently from the system.
a. Remove
b. Delete
c. Drop
d. Cut

Answer : C

Question. 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

Answer : C

Question. 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

Answer : B

Question. 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

Answer : C

Question. Which command is used to add an attribute to an existing table.
a. Create
b. Alter
c. Update
d. Select

Answer : B

Question. 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

Answer : A

MCQs for Chapter 8 Structured Query Language Computer Science UG

Expert teachers of studiestoday have referred to NCERT book for UG Computer Science to develop the Computer Science UG MCQs. If you download MCQs with answers for the above chapter you will get higher and better marks in UG test and exams in the current year as you will be able to have stronger understanding of all concepts. Daily Multiple Choice Questions practice of Computer Science will help students to have stronger understanding of all concepts and also make them expert on all critical topics. After solving the questions given in the MCQs which have been developed as per latest books also refer to the NCERT solutions for UG Computer Science. We have also provided lot of MCQ questions for UG Computer Science so that you can solve questions relating to all topics given in each chapter. After solving these you should also refer to UG Computer Science MCQ Test for the same chapter.

Where can I download latest CUET MCQs for UG Computer Science Chapter 8 Structured Query Language

You can download the CUET MCQs for UG Computer Science Chapter 8 Structured Query Language for latest session from StudiesToday.com

Are the UG Computer Science Chapter 8 Structured Query Language MCQs available for the latest session

Yes, the MCQs issued by CUET for UG Computer Science Chapter 8 Structured Query Language have been made available here for latest academic session

Where can I find CUET UG Computer Science Chapter 8 Structured Query Language MCQs online?

You can find CUET UG Computer Science Chapter 8 Structured Query Language MCQs on educational websites like studiestoday.com, online tutoring platforms, and in sample question papers provided on this website.

How can I prepare for Chapter 8 Structured Query Language UG MCQs?

To prepare for Chapter 8 Structured Query Language MCQs, refer to the concepts links provided by our teachers and download sample papers for free.

Are there any online resources for CUET UG Computer Science Chapter 8 Structured Query Language?

Yes, there are many online resources that we have provided on studiestoday.com available such as practice worksheets, question papers, and online tests for learning MCQs for UG Computer Science Chapter 8 Structured Query Language