17 Lecture

CS101

Midterm & Final Term Short Notes

Database Systems

A database system is a collection of data that is organized and managed to meet the information needs of an organization. It is a crucial component of most modern applications, providing a way to store and retrieve data efficiently and effective


Important Mcq's
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. Which of the following is a popular database management system? A) MySQL B) Photoshop C) Microsoft Word D) Google Chrome Answer: A) MySQL


  2. Which of the following is not a type of database model? A) Relational model B) Object-oriented model C) Hierarchical model D) Sequential model Answer: D) Sequential model


  3. Which of the following is a type of join in SQL? A) Standalone join B) Inner join C) Random join D) Dynamic join Answer: B) Inner join


  4. Which of the following SQL statements is used to create a new table? A) INSERT INTO B) DELETE FROM C) CREATE A TABLE D) UPDATE Answer: C) CREATE TABLE


  5. What is the purpose of a primary key in a table? A) To ensure data consistency B) To enforce data validation rules C) To uniquely identify each record in the table D) To prevent unauthorized access to the table Answer: C) To uniquely identify each record in the table


  6. Which of the following is a characteristic of a database transaction? A) It must be committed before it can be rolled back B) It must be rolled back before it can be committed C) It must be both committed and rolled back at the same time D) It must be committed or rolled back based on user input Answer: A) It must be committed before it can be rolled back


  7. What is the purpose of the WHERE clause in an SQL query? A) To specify the order in which the results should be displayed B) To specify the columns to be displayed in the results C) To filter the results based on a condition D) To group the results based on a common attribute Answer: C) To filter the results based on a condition


  8. Which of the following is a type of data inconsistency that can occur in a database? A) Primary key inconsistency B) Foreign key inconsistency C) Data type inconsistency D) All of the above Answer: D) All of the above


  9. Which of the following is not a commonly used database model? A) Relational model B) Object-oriented model C) Hierarchical model D) Circular model Answer: D) Circular model


  10. Which of the following SQL statements is used to modify data in a table? A) INSERT INTO B) DELETE FROM C) ALTER TABLE D) UPDATE Answer: D) UPDATE



Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is a data model? Answer: A data model is a conceptual representation of the data that is stored in a database. It defines the structure, relationships, and constraints of the data.


  2. What is the most widely used data model in modern database systems? Answer: The relational model is the most widely used data model in modern database systems.


  3. What is a database management system (DBMS)? Answer: A DBMS is a software system that manages the storage, retrieval, and manipulation of data in a database.


  4. What is data integrity? Answer: Data integrity refers to the accuracy and consistency of the data in a database. It is maintained through a set of constraints that ensure that the data meets certain standards.


  5. What is a primary key constraint? Answer: A primary key constraint ensures that each record in a table is uniquely identified by a specific attribute or set of attributes.


  6. What is a foreign key constraint? Answer: A foreign key constraint ensures that the relationship between two tables is maintained, by requiring that a record in one table must exist in another table.


  7. What is a check constraint? Answer: A check constraint ensures that the data in a table meets a specific set of criteria, such as a range of values or a pattern.


  8. What is data normalization? Answer: Data normalization is the process of organizing data in a database to reduce redundancy and improve data consistency.


  9. What is a first normal form (1NF)? Answer: In the first normal form, each table has a primary key, and all attributes in the table are atomic, meaning they cannot be further broken down.


  10. What is third normal form (3NF)? Answer: In third normal form, each attribute in a table is dependent only on the primary key, and not on any other attributes in the table.

What is Database System?

A database system is a collection of data that is organized and managed to meet the information needs of an organization. It is a crucial component of most modern applications, providing a way to store and retrieve data efficiently and effectively. In this article, we will explore the key concepts of database systems. Data Model: A data model is a conceptual representation of the data that is stored in a database. It defines the structure, relationships, and constraints of the data. The most common types of data models are relational, hierarchical, and network models. Relational model: The relational model is the most widely used data model in modern database systems. In this model, data is organized into tables, with each table representing a specific entity, such as customers or orders. The tables are related to each other through a set of common attributes, called keys. The relational model provides a powerful way to query and manipulate data, using a language called SQL. Hierarchical model: The hierarchical model organizes data into a tree-like structure, with each node representing a record and each level representing a specific entity. This model is useful for representing data with a clear hierarchy, such as a company organization chart. Network model: The network model is similar to the hierarchical model, but with more flexibility. It allows for each node to have multiple parent and child nodes, creating a more complex network structure. This model is useful for representing complex relationships between entities. Database Management System (DBMS): A DBMS is a software system that manages the storage, retrieval, and manipulation of data in a database. The DBMS provides a way for users to access the data through a variety of interfaces, such as forms, reports, and queries. The most popular DBMSs are Oracle, Microsoft SQL Server, MySQL, and PostgreSQL. Data Integrity: Data integrity refers to the accuracy and consistency of the data in a database. It is maintained through a set of constraints that ensure that the data meets certain standards. The most common types of data constraints are primary key constraints, foreign key constraints, and check constraints. Primary key constraint: The primary key constraint ensures that each record in a table is uniquely identified by a specific attribute or set of attributes. This constraint is critical for maintaining data consistency and accuracy. Foreign key constraint: The foreign key constraint ensures that the relationship between two tables is maintained, by requiring that a record in one table must exist in another table. Check constraint: The check constraint ensures that the data in a table meets a specific set of criteria, such as a range of values or a pattern. Data Normalization: Data normalization is the process of organizing data in a database to reduce redundancy and improve data consistency. It involves breaking down a table into smaller tables, each with a specific set of attributes. The most common levels of data normalization are first normal form (1NF), second normal form (2NF), and third normal form (3NF). First normal form: In first normal form, each table has a primary key, and all attributes in the table are atomic, meaning they cannot be further broken down. Second normal form: In second normal form, each attribute in a table is dependent on the primary key, and not on any other attributes in the table. Third normal form: In third normal form, each attribute in a table is dependent only on the primary key, and not on any other attributes in the table. Conclusion: Database systems are a critical component of modern applications, providing a way to store and retrieve data efficiently and effectively. Understanding the key concepts of data modeling, database management systems, data integrity, and data normalization is essential for designing and implementing effective database systems.