Ad Code

cs312 final term past papers

 

cs312 final term past papers

True/False Questions (30):

1. SQL is a database computer language designed for the retrieval and management of data. (True)

2. The WHERE clause is used to filter rows based on conditions in SQL queries. (True)

3. The SELECT statement is used to delete rows from a table. (False)

4. Anomalies in databases occur due to poor planning and single-table designs. (True)

5. In SQL, the keyword DISTINCT is used to retrieve duplicate records. (False)

6. The primary purpose of normalization is to reduce redundancy in databases. (True)

7. The TRUNCATE command deletes all rows but retains the table structure. (True)

8. The DROP TABLE command removes a table and its structure from the database. (True)

9. A foreign key is used to uniquely identify each record in a table. (False)

10. A transaction in a database is always committed automatically. (False)

11. Wildcards such as % and _ are used in SQL to perform pattern matching. (True)

12. The HAVING clause filters aggregated data, while the WHERE clause filters rows. (True)

13. First Normal Form (1NF) allows repeating groups in tables. (False)

14. The COMMIT command is used to undo changes in a transaction. (False)

15. Indexes in databases improve the performance of data retrieval. (True)

16. Atomicity ensures partial completion of database transactions. (False)

17. The UPDATE command modifies existing records in a table. (True)

18. DDL commands include SELECT and INSERT. (False)

19. Cartesian products occur when every row in one table pairs with every row in another. (True)

20. The LIKE operator can use % to represent zero or more characters. (True)

21. The GROUP BY clause is used to group rows with similar values. (True)

22. Data Manipulation Language (DML) includes commands like DELETE and UPDATE. (True)

23. A composite primary key consists of two or more attributes. (True)

24. A database anomaly can be fixed by introducing redundancy. (False)

25. Constraints in databases ensure data integrity and validity. (True)

26. The NOT operator reverses the result of a condition. (True)

27. Isolation in transactions ensures that changes are visible only after commitment. (True)

28. The ALTER command is used to delete rows from a table. (False)

29. The ACID properties define the reliability of database transactions. (True)

30. The ROLLBACK command undoes all changes since the last COMMIT. (True)

 

 Fill-in-the-Blank Questions: 100

1. SQL stands for **Structured Query Language**.

2. The **DELETE** command removes rows from a table.

3. The **SELECT** statement retrieves data from a database.

4. **Normalization** aims to reduce redundancy and improve data integrity.

5. The **PRIMARY KEY** uniquely identifies each record in a table.

6. The **FOREIGN KEY** establishes a relationship between two tables.

7. **DDL** stands for Data Definition Language.

8. The **TRUNCATE** command removes all rows from a table but retains the structure.

9. In SQL, **DISTINCT** is used to fetch unique records.

10. The **HAVING** clause filters aggregated results.

11. The **WHERE** clause is used to filter rows in a SQL query.

12. **Indexes** are used to speed up data retrieval in a database.

13. The **JOIN** operation combines rows from two or more tables.

14. A **transaction** in a database is a sequence of operations performed as a single unit.

15. The **ROLLBACK** command undoes uncommitted changes.

16. The **ALTER TABLE** command is used to modify a table's structure.

17. The **INSERT INTO** statement adds new rows to a table.

18. **Wildcards** like % and _ are used with the LIKE operator.

19. The **AND** operator returns TRUE if both conditions are TRUE.

20. **Data Redundancy** is minimized by normalization.

21. The **UPDATE** command changes existing data in a table.

22. The **DROP TABLE** command deletes a table and its structure permanently.

23. **Referential Integrity** ensures that foreign keys match primary keys.

24. **Cartesian Product** pairs every row of one table with every row of another.

25. **Data Anomalies** occur due to poor database design.

26. **ACID** properties include Atomicity, Consistency, Isolation, and Durability.

27. The **LIKE** operator is used to search for patterns in text.

28. **GROUP BY** groups rows with similar values for aggregation.

29. **Denormalization** introduces redundancy to improve performance.

30. **Constraints** are rules enforced on data columns in tables.

31. **First Normal Form (1NF)** ensures no repeating groups in a table.

32. The **COMMIT** command saves all changes made during a transaction.

33. **Secondary Index** helps improve query performance in large tables.

34. The **NOT NULL** constraint ensures a column cannot have a NULL value.

35. **Wildcard Characters** are % for multiple characters and _ for a single character.

36. **Data Integrity** refers to the accuracy and consistency of stored data.

37. **Logical Operators** include AND, OR, and NOT.

38. **Data Redundancy** increases the likelihood of data anomalies.

39. The **FROM** clause specifies the table to query data from.

40. The **DROP** command removes database objects permanently.

41. **Denormalization** increases query performance but may introduce redundancy.

42. The **TRUNCATE TABLE** statement removes all rows but keeps the table structure. (True)

43. In SQL, a **view** is a virtual table based on a SELECT query. (True)

44. **Second Normal Form (2NF)** removes partial dependencies on primary keys.

45. **Third Normal Form (3NF)** eliminates transitive dependencies from tables.

46. **Referential integrity** is maintained using primary and foreign key relationships.

47. The **HAVING clause** is used to filter grouped data.

48. The **ALTER command** can be used to add or remove table columns.

49. A **primary key** must contain unique and non-null values.

50. **Database anomalies** can be resolved by applying normalization rules.

51. A **unique constraint** ensures that all values in a column are distinct.

52. The **UPDATE** command modifies existing data in a table based on specified conditions.

53. **Data redundancy** leads to inconsistencies and increased storage costs.

54. **Indexes** are created on columns to improve search efficiency.

55. **SQL transactions** ensure atomicity, consistency, isolation, and durability.

56. The **ROLLBACK** command undoes uncommitted database transactions.

57. **DDL** commands include CREATE, ALTER, and DROP.

58. **Cartesian Product** is a result of joining every row of one table with another.

59. **HAVING** filters aggregated results, while **WHERE** filters individual rows.

60. The **JOIN clause** combines records from multiple tables based on a condition.

61. **Wildcard characters** such as _ and % are used with the LIKE operator.

62. **First Normal Form (1NF)** ensures no repeating groups exist in any table.

63. **Data Manipulation Language (DML)** includes commands like SELECT, INSERT, UPDATE, and DELETE.

64. The **ACID** properties ensure database transaction reliability.

65. **SQL views** simplify complex queries and enhance data security.

66. The **DROP** statement permanently removes database objects like tables and views.

67. **Atomicity** ensures that a transaction is all or nothing.

68. The **GROUP BY clause** groups rows based on one or more columns.

69. The **TRUNCATE command** cannot be rolled back once executed.

70. **Foreign keys** enforce referential integrity between tables.

71. **Logical operators** such as AND, OR, and NOT are used to combine query conditions.

72. **Normalization** organizes data to reduce redundancy and improve integrity.

73. **Composite keys** are a combination of two or more columns that uniquely identify rows.

74. The **HAVING clause** allows conditions to be applied to grouped data.

75. **Denormalization** balances performance and redundancy in database design.

76. **The ORDER BY clause** sorts query results in ascending or descending order.

77. The **ROLLBACK statement** reverts the database to its previous committed state.

78. **ACID properties** ensure database consistency even during system failures.

79. A **self-join** occurs when a table is joined to itself.

80. **Third Normal Form (3NF)** is achieved when a table is in 2NF and has no transitive dependencies.

81. **Data anomalies** occur when tables are poorly designed or redundant.

82. The **IN operator** checks if a value matches any value in a list.

83. **SQL subqueries** are queries nested within another query.

84. **LEFT JOIN** retrieves all records from the left table and matched records from the right.

85. **Right joins** retrieve all rows from the right table and matched rows from the left.

86. **Unique constraints** ensure no duplicate values exist in a column.

87. **ALTER TABLE** adds, modifies, or deletes columns in a table.

88. **CREATE INDEX** improves database query performance.

89. **SQL functions** like COUNT and AVG provide aggregate data.

90. **CROSS JOIN** produces a Cartesian product of two tables.

91. **A clustered index** determines the physical order of table data.

92. **BETWEEN** selects values within a specified range in SQL queries.

93. **Data types** define the nature of values stored in database columns.

94. **IS NULL** checks for NULL values in a column.

95. **DEFAULT constraints** specify default values for columns in case no value is provided.

96. **Inner joins** return only rows that satisfy the join condition.

97. **Database triggers** execute predefined actions in response to events.

98. **The UNION operator** combines the results of two SELECT statements.

99. **SQL privileges** control access to database resources.

100. **CHECK constraints** ensure column values meet specified conditions.

 


Post a Comment

0 Comments