0% found this document useful (0 votes)
27 views2 pages

SQL Queries and Commands for Beginners

This document is a test paper for the CCS subject for Standard VIII at Jajoo International School, Yavatmal for the session 2025-26. It contains multiple-choice questions related to SQL statements and database management. The questions cover topics such as data retrieval, table creation, and data manipulation commands.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

SQL Queries and Commands for Beginners

This document is a test paper for the CCS subject for Standard VIII at Jajoo International School, Yavatmal for the session 2025-26. It contains multiple-choice questions related to SQL statements and database management. The questions cover topics such as data retrieval, table creation, and data manipulation commands.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Jajoo International School, Yavatmal

Session - 2025 -26


CBCT Test-III
Std : VIII Marks :-----------
Sub : CCS Date :-----------
Name : __________________________________ Roll No. :-----------

Q1. Which SQL statement is used to retrieve data from a table?

(a) INSERT (b) SELECT (c) UPDATE (d) DELETE

Q2. What is the correct syntax to create a new table called Books with columns BookID (number) and Title
(text)?

(a) CREATE TABLE Books (BookID INT, Title VARCHAR(50));


(b) NEW TABLE Books (BookID, Title);
(c) TABLE CREATE Books (BookID, Title);
(d) INSERT TABLE Books (BookID, Title);

Q3. Which command is used to remove all records from a table without deleting the table structure?

(a) DELETE (b) DROP (c) TRUNCATE (d) REMOVE

Q4. Which command will show all tables in a MySQL database?

(a) SHOW TABLES; (b) LIST TABLES; (c) DESCRIBE TABLES; (d) SELECT TABLES;

Q5. A library wants to find all books with the title 'Mathematics'. Which query should be used?

(a) SELECT * FROM Books WHERE Title='Mathematics';


(b) FIND Books WHERE Title='Mathematics';
(c) GET * FROM Books WHERE Title='Mathematics';
(d) SEARCH Books Title='Mathematics';

Q6. What is the primary key in a table?

(a) A column that can have duplicate values


(b) A column that uniquely identifies each record
(c) A column that stores only numbers
(d) A column used for sorting

Q7. Which query is used to change the title of a book with BookID=101 to 'Physics'?

(a) UPDATE Books SET Title='Physics' WHERE BookID=101;


(b) MODIFY Books SET Title='Physics' WHERE BookID=101;
(c) CHANGE Books SET Title='Physics' WHERE BookID=101;
(d) INSERT Books SET Title='Physics' WHERE BookID=101;

Q8. Which query deletes the record of a book with BookID=102?

(a) DELETE FROM Books WHERE BookID=102;


(b) REMOVE FROM Books WHERE BookID=102;
(c) DROP FROM Books WHERE BookID=102;
(d) TRUNCATE Books WHERE BookID=102;

Page 1|2
Q9. Which SQL statement is used to add a new column Author to an existing table Books?

(a) ALTER TABLE Books ADD Author VARCHAR(50);


(b) ADD COLUMN Books Author VARCHAR(50);
(c) MODIFY TABLE Books ADD Author;
(d) CREATE COLUMN Books Author;

Q10. Which query will list books sorted by Title in ascending order?

(a) SELECT * FROM Books ORDER BY Title ASC;


(b) SELECT * FROM Books SORT BY Title;
(c) LIST * FROM Books ORDER Title;
(d) SELECT * FROM Books ORDER Title;

Q11. In a library database, which datatype is suitable to store BookID?

(a) INT (b) VARCHAR (c) DATE (d) CHAR

Q12. Which command removes a table and all its data from the database?

(a) DROP TABLE Books; (b) DELETE TABLE Books; (c) TRUNCATE TABLE Books; (d) REMOVE TABLE Books;

Q13. Which clause is used to combine two conditions where both must be true?

(a) AND (b) OR (c) NOT (d) IN

Q14. Which clause is used when at least one condition should be true?

(a) OR (b) AND (c) NOT (d) LIKE

Q15. Which query shows only the Title and Author of all books?

(a) SELECT Title, Author FROM Books;


(b) SELECT * FROM Books;
(c) SELECT BookID FROM Books;
(d) SELECT ALL Title, Author;

Q16. Which clause is used to exclude records that meet a condition?

(a) NOT (b) AND (c) OR (d) IN

Q17. Which SQL operator is used to search for a pattern in a column?

(a) LIKE (b) MATCH (c) FIND (d) SEARCH

Q18. A library database stores the book category as Fiction, Science, Math. Which datatype is suitable?

(a) VARCHAR (b) INT (c) DATE (d) FLOAT

Q19. Which query selects books not in the category 'Science' or 'Math'?

(a) SELECT * FROM Books WHERE Category NOT IN ('Science','Math');


(b) SELECT * FROM Books WHERE Category IN ('Science','Math');
(c) SELECT * FROM Books WHERE Category NOT LIKE ('Science','Math');
(d) SELECT * FROM Books WHERE Category AND NOT ('Science','Math');

Q20. Which query finds all books whose title starts with 'A'?

(a) SELECT * FROM Books WHERE Title LIKE 'A%'; (b) SELECT * FROM Books WHERE Title = 'A%';
(c) SELECT * FROM Books WHERE Title STARTS 'A'; (d) SELECT * FROM Books WHERE Title BEGIN 'A';

Page 2|2

You might also like