This quiz works best with JavaScript enabled. Home > Cbse > Class 12 > Science > Computer Science > Class 12 Computer Science Chapter 4 Structured Query Language (Sql) – Quiz 1 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 12 Computer Science Chapter 4 Structured Query Language (Sql) Quiz 1 (60 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. If you don't specify ASC or DESC after a SQL ORDER BY clause, the following is used by default A) ASC. B) DESC. C) There is no default value. D) None of the mentioned. Show Answer Correct Answer: A) ASC. 2. Which statement is used to extract data from a database? A) Select. B) Extract. C) Open. D) Get. Show Answer Correct Answer: A) Select. 3. .... datatype precision up to a maximum of 64. A) Int. B) Char. C) Float. D) Small int. Show Answer Correct Answer: C) Float. 4. Which operator test the column for absence of data? A) Not operator. B) And operator. C) Is null operator. D) None of these. Show Answer Correct Answer: C) Is null operator. 5. Define the type of SQL that used to insert, delete and retrieve data within the database tables. A) Data Control Language (DCL). B) Transaction Control Language (TCL). C) Data Definition Language (DDL). D) Data Manipulation Language (DML). Show Answer Correct Answer: D) Data Manipulation Language (DML). 6. What does the SQL statement 'SELECT name FROM world WHERE population > (SELECT population FROM world WHERE name = Algeria)' do? A) Updates records in the 'world' table. B) Inserts new records into the 'world' table. C) Retrieves the name of countries with a population greater than Algeria from the 'world' table. D) Deletes records from the 'world' table. Show Answer Correct Answer: C) Retrieves the name of countries with a population greater than Algeria from the 'world' table. 7. What is the built-in MySQL function that gives you the current time in an SQL statement? A) TODAY(). B) CURR DATE(). C) NOW(). D) DATE(false). Show Answer Correct Answer: C) NOW(). 8. The ..... statement is used to delete a table. A) REMOVE TABLE. B) DELETE TABLE. C) DEL TABLE. D) DROP TABLE. Show Answer Correct Answer: D) DROP TABLE. 9. Which of the following types of tables often are created without a primary key? A) One-to-one. B) Many-to-many. C) Hash Map. D) B-Trees. E) One-to-many. Show Answer Correct Answer: B) Many-to-many. 10. When editing the columns in a pre-existing table, which command adds a new column? A) ADD. B) DROP. C) CREATE NEW. D) MODIFY COLUMN. Show Answer Correct Answer: A) ADD. 11. What is a field (column) in a database table? A) A single entry in a table. B) A single piece of data or attribute stored for all records in a table. C) A collection of data in a database. D) A type of database that organises data into related tables. Show Answer Correct Answer: B) A single piece of data or attribute stored for all records in a table. 12. What is the purpose of the 'join' keyword in SQL? A) To delete records from a table. B) To modify existing records. C) To combine data from two or more tables. D) To create new tables. Show Answer Correct Answer: C) To combine data from two or more tables. 13. When editing columns in a pre-existing table, which command allows you to delete a column? A) ADD. B) MODIFY COLUMN. C) DROP. D) DELETE. Show Answer Correct Answer: C) DROP. 14. .... helps to set a limit value placed for a field. A) DEFAULT Constraint. B) Primary Key Constraint. C) TABLE CONSTRAINT. D) Check Constraint. Show Answer Correct Answer: D) Check Constraint. 15. State True or False:1. FROM statement groups rows with similar values in the specified grouping field. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 16. What is the label we give to a column that is an integer and used to point to a row in a different table? A) Remote key. B) Logical key. C) Foreign key. D) Primary key. E) Local key. Show Answer Correct Answer: C) Foreign key. 17. Which key is used to execute a query? A) House Key. B) Car Key. C) F5 Key. D) F4. Show Answer Correct Answer: C) F5 Key. 18. .... which helps to uniquely identify a record. A) Unique Constraint. B) Default constraint. C) Check constraint. D) Primary key Constraint. Show Answer Correct Answer: D) Primary key Constraint. 19. What is the purpose of the 'order by' command in SQL? A) To order the output in ascending or descending order. B) To update existing records. C) To filter records based on a condition. D) To join multiple tables. Show Answer Correct Answer: A) To order the output in ascending or descending order. 20. Can the result of a SELECT statement contain duplicate rows? A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes. 21. How can you perform an SQL query on more than one table? A) UPDATE. B) JOIN. C) DELETE FROM. D) INSERT INTO. Show Answer Correct Answer: B) JOIN. 22. .... is a computer programming language used for adding, removing, and modifying data in a database. A) DQL. B) TCL. C) DML. D) DCL. Show Answer Correct Answer: C) DML. 23. Which of the following is NOT a good rule to follow when developing a database model? A) Use a persons email address as their primary key. B) Never repeat string data in more than one table in a data model. C) Each "object" in the application should be modeled as one or more tables. D) Use integers as primary keys. Show Answer Correct Answer: A) Use a persons email address as their primary key. 24. State True or False:1. SELECT statement is used to extract records from one or more tables A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 25. What does * mean when writing code? A) Select all columns. B) Select all rows. C) Select all genres. D) Select jaskfjfjfjsfjiosjisjfjsfjsfjkjsk. Show Answer Correct Answer: A) Select all columns. 26. Which type of language is SQL? A) Functional. B) Declarative. C) Procedural. D) Object-oriented. Show Answer Correct Answer: B) Declarative. 27. What could be the correct datatype for 'H.NO. 234, SEC-14' data A) Int. B) Decimal. C) Date. D) Varchar. Show Answer Correct Answer: D) Varchar. 28. State the use of WHERE clause. A) In SELECT statement specifies the condition, which restricts the rows returned by the query. B) In SELECT statement indicates the table(s) from which data is to be retrieved. C) It is used to extract records from one or more tables. D) None of the above. Show Answer Correct Answer: A) In SELECT statement specifies the condition, which restricts the rows returned by the query. 29. Pernyataan SQL manakah yang digunakan untuk mengekstrak data daripada pangkalan data? A) SELECT. B) EXTRACT. C) OPEN. D) GET. Show Answer Correct Answer: A) SELECT. 30. Choose SQL command to display the name of cake that end with word cheese. A) SELECT cakeNameFROM CAKEWHERE cakeName LIKE "cheese";. B) SELECT cakeNameFROM CAKEWHERE cakeName LIKE "%cheese%";. C) SELECT cakeNameFROM CAKEWHERE cakeName LIKE "cheese%";. D) SELECT cakeNameFROM CAKEWHERE cakeName LIKE "%cheese";. Show Answer Correct Answer: C) SELECT cakeNameFROM CAKEWHERE cakeName LIKE "cheese%";. 31. SELECT *FROM BarangORDER BY NamaBarang DESCPernyataan diatas bertujuan untuk A) Menyenaraikan SEMUA maklumat dalam jadual Barang secara menurun. B) Menyenaraikan SEMUA maklumat dalam jadual Barang secara menaik. C) Menyenaraikan BEBERAPA maklumat dalam jadual Barang secara menaik. D) Menyenaraikan BEBERAPA maklumat dalam jadual Barang secara menurun. Show Answer Correct Answer: A) Menyenaraikan SEMUA maklumat dalam jadual Barang secara menurun. 32. TRUE OR FALSE:when adding data to all fields in a table, you still have to specify the field names A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: B) FALSE. 33. Choose the CORRECT query for using comparison operators in SQL. A) SELECT eName, ePositionFROM employeeInfoWHERE age>40 AND <60;. B) SELECT eName, ePositionFROM employeeInfoWHERE age>40 AND age<60;. C) SELECT eName, ePositionFROM employeeInfoWHERE age>40 AND WHERE age<60;. D) SELECT eName, ePositionFROM employeeInfoWHERE >40 AND <60 age;. Show Answer Correct Answer: B) SELECT eName, ePositionFROM employeeInfoWHERE age>40 AND age<60;. 34. Which of the following SQL clauses is used to DELETE tuples from a database table? A) REMOVE. B) DELETE. C) CLEAR. D) DROP. Show Answer Correct Answer: B) DELETE. 35. What is the default sorting order of the ORDER BY clause in SQL? A) Ascending. B) Descending. C) All the above. D) None of the above. Show Answer Correct Answer: A) Ascending. 36. Arthur is working on a database for his school project and wants to retrieve specific data from a table. Which SQL statement should he use? A) INSERT. B) UPDATE. C) SELECT. D) DELETE. Show Answer Correct Answer: C) SELECT. 37. Apakah maksud SQL? A) Structured Question Language. B) Structured Query Language. C) Sorted Query Language. D) Strong Question Language. Show Answer Correct Answer: B) Structured Query Language. 38. What does the SQL command 'DROP TABLE' do? A) Modifies the structure of a table. B) Inserts new records into a table. C) Selects specific data from a table. D) Deletes existing tables. Show Answer Correct Answer: D) Deletes existing tables. 39. Which of the following is the label we give a column that the "outside world" uses to look up a particular row? A) Remote key. B) Local key. C) Foreign key. D) Logical key. E) Primary key. Show Answer Correct Answer: D) Logical key. 40. Which function is used to calculate the summary values? A) Aggregate. B) AVERAGE. C) SUM. D) F5. Show Answer Correct Answer: A) Aggregate. 41. .... have a special meaning in SQL. A) Variables. B) Commands. C) Arguments. D) Keyword. Show Answer Correct Answer: D) Keyword. 42. SQL query to find all the cities whose humidity is 95. A) SELECT city WHERE humidity = 95. B) SELECT city FROM weather WHERE humidity = 95. C) SELECT humidity = 89 FROM weather. D) SELECT city FROM weather. Show Answer Correct Answer: B) SELECT city FROM weather WHERE humidity = 95. 43. The ..... consist of SQL statements used to define the database structure or schema. A) DCL. B) TCL. C) DML. D) DDL. Show Answer Correct Answer: D) DDL. 44. Images, PDF, movies cannot be stored in a database. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: B) False. 45. Apakah penyataan SQL untuk mengemas kini nombor telefon '012345678' hanya untuk attribut DesignerID, "SMI01" dalam jadual "Designer" ? A) UPDATE Designer SET PhoneNo = '012345678' WHERE DesignerID = 'SMI01'. B) UPDATE Designer (PhoneNo) VALUES ('012345678'). C) UPDATE PhoneNo = '012345678' FROM Designer WHERE DesignerID = 'SMI01'. D) UPDATE Designer SET PhoneNo = '012345678'. Show Answer Correct Answer: A) UPDATE Designer SET PhoneNo = '012345678' WHERE DesignerID = 'SMI01'. 46. What does the SQL statement 'SELECT * FROM world WHERE name = Algeria' do? A) Retrieves all fields of the record for Algeria from the 'world' table. B) Deletes the record of Algeria from the 'world' table. C) Updates all fields of the record for Algeria in the 'world' table. D) Inserts a new record for Algeria into the 'world' table. Show Answer Correct Answer: A) Retrieves all fields of the record for Algeria from the 'world' table. 47. The UPDATE SQL clause can ..... A) Update more than one row at a time. B) Delete only one row at a time. C) Update only one row at a time. D) Delete more than one row at a time. Show Answer Correct Answer: A) Update more than one row at a time. 48. Pilih arahan SQL yang digunakan untuk memasukkan data ke dalam jadual SQL? A) ADD INTO namajadual WHERE(nilai1, nilai2, nilai ). B) INSERT INTO namajadual WHERE (nilai1, nilai2, nilai ). C) INSERT INTO namajadual VALUES(nilai1, nilai2, nilai ). D) ADD INTO namajadual VALUES(nilai1, nilai2, nilai ). Show Answer Correct Answer: C) INSERT INTO namajadual VALUES(nilai1, nilai2, nilai ). 49. Your friend accidentally runsDROP TABLE users;instead ofCREATE TABLE users;.What happens? A) The table is created successfully. B) The database explodes. C) The table is deleted permanently. D) The table is renamed to "users backup" . Show Answer Correct Answer: C) The table is deleted permanently. 50. TRUE OR FALSE:when inserting data into a table you must specify field names A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: A) TRUE. 51. If you were wanting to filter data, which clause would you use? A) Select. B) From. C) Order by. D) Where. Show Answer Correct Answer: D) Where. 52. A relation may have multiple foreign keys. A) Yes. B) No. C) All the above. D) None of the above. Show Answer Correct Answer: A) Yes. 53. What does the ALTER TABLE clause do? A) The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints. B) The SQL ALTER TABLE clause is used to insert data into database table. C) THE SQL ALTER TABLE deletes data from database table. D) The SQL ALTER TABLE clause is used to delete a database table. Show Answer Correct Answer: A) The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints. 54. In SQL, the truth value of (FALSE OR NULL) is ..... A) TRUE. B) FALSE. C) NULL. D) None of the above. Show Answer Correct Answer: C) NULL. 55. What does the SQL statement 'SELECT name, population FROM world WHERE name LIKE 'A%' OR name LIKE 'B%" do? A) Retrieves the name and population of countries whose names start with 'A' or 'B' from the 'world' table. B) Deletes records from the 'world' table. C) Updates records in the 'world' table. D) Inserts new records into the 'world' table. Show Answer Correct Answer: A) Retrieves the name and population of countries whose names start with 'A' or 'B' from the 'world' table. 56. When editing columns in a pre-existing table, which command allows you to change the data type of a column? A) MODIFY COLUMN. B) ADD. C) CHANGE DATA. D) EDIT COLUMN. Show Answer Correct Answer: A) MODIFY COLUMN. 57. What MySQL keyword is added to primary keys in a CREATE TABLE statement to indicate that the database is to provide a value for the column when records are inserted. A) PRIMARY. B) AUTO INCREMENT. C) INSERT AUTO PROVIDE. D) ASSERT UNIQUE. Show Answer Correct Answer: B) AUTO INCREMENT. 58. Which word is missing from the following SQL statement?Select * table ..... name A) With. B) Where. C) From. D) And. Show Answer Correct Answer: C) From. 59. Identify if there is an error in the SQL statement below in deleting a record:DELETE FROM Employee ..... details WHERE Employee ..... details.ID = 10; A) ;. B) ( ). C) Spelling error. D) Show. E) No errors. Show Answer Correct Answer: E) No errors. 60. Which of the following indexes would be best for fast look up for exact key matches but not so good for prefix lookups or sorting? A) BTREE. B) INDEX2. C) HASH. D) EXACT. Show Answer Correct Answer: C) HASH. Next →Related QuizzesScience QuizzesClass 12 QuizzesClass 12 Computer Science Chapter 4 Structured Query Language (Sql) Quiz 2Class 12 Computer Science Chapter 4 Structured Query Language (Sql) Quiz 3Class 12 Computer Science Chapter 1 Data Structures Using Python QuizClass 12 Computer Science Chapter 2 Advanced Python Programming QuizClass 12 Computer Science Chapter 3 Database Management Systems QuizClass 12 Computer Science Chapter 5 Networking And Cyber Security QuizClass 12 Computer Science Chapter 6 Boolean Algebra And Logic Gates Quiz 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books