14 Lecture
CS403
Midterm & Final Term Short Notes
Relational Data Model
The relational data model is a conceptual framework for organizing and structuring data in a relational database. It uses a series of tables to represent data entities and their relationships, with each table consisting of columns and rows. The
Important Mcq's
Midterm & Finalterm Prepration
Past papers included
Download PDF
In a relational database, what is a table? a) A group of related files b) A collection of related records c) A list of related fields d) A collection of related database objects Answer: b) A collection of related records What is a primary key? a) A key used for sorting records in a table b) A key that uniquely identifies each record in a table c) A key that defines the relationship between two tables d) A key that is used for authentication purposes Answer: b) A key that uniquely identifies each record in a table Which of the following is not a data type commonly used in a relational database? a) Integer b) Float c) Character d) Image Answer: d) Image What is a foreign key? a) A key that uniquely identifies each record in a table b) A key used for sorting records in a table c) A key that defines the relationship between two tables d) A key that is used for authentication purposes Answer: c) A key that defines the relationship between two tables In a relational database, what is a view? a) A subset of data from one or more tables b) A temporary table that can be used for sorting data c) A table that is used to store historical data d) A table that is used to store metadata Answer: a) A subset of data from one or more tables Which of the following is not a property of a relation in a relational database? a) Atomicity b) Consistency c) Durability d) Reliability Answer: d) Reliability What is normalization in the context of a relational database? a) The process of removing redundancy and ensuring data consistency b) The process of converting data from one format to another c) The process of adding new tables to a database d) The process of backing up a database Answer: a) The process of removing redundancy and ensuring data consistency What is a join in a relational database? a) A way of creating a new table from existing tables b) A way of selecting data from a table based on certain criteria c) A way of deleting data from a table d) A way of updating data in a table Answer: a) A way of creating a new table from existing tables Which of the following is an example of a one-to-many relationship in a relational database? a) One student taking many courses b) One course having many students c) One student having one course d) One course having one student Answer: b) One course having many students What is a transaction in a relational database? a) A set of SQL commands that are executed together b) A unit of work that is performed on a database c) A way of indexing data in a table d) A way of backing up a database Answer: b) A unit of work that is performed on a database
Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included
Download PDF
What is a relation in the relational data model? Answer: A relation is a table in the relational data model that contains a collection of related records. What is a primary key, and why is it important? Answer: A primary key is a unique identifier for a record in a table. It is important because it ensures data integrity and helps to establish relationships between tables. What is normalization in the context of the relational data model? Answer: Normalization is the process of organizing data in a database to reduce redundancy and improve data consistency. What is a foreign key, and how is it used in the relational data model? Answer: A foreign key is a field in a table that references the primary key of another table. It is used to establish relationships between tables. What is a join, and how is it used in the relational data model? Answer: A join is an operation in the relational data model that combines records from two or more tables based on a common field. What is the difference between a one-to-many relationship and a many-to-many relationship in the relational data model? Answer: In a one-to-many relationship, a record in one table can have many related records in another table, but a record in the second table can have only one related record in the first table. In a many-to-many relationship, a record in one table can have many related records in another table, and a record in the second table can have many related records in the first table. What is denormalization, and why is it used in the relational data model? Answer: Denormalization is the process of intentionally adding redundancy to a database to improve query performance. It is used when a database is heavily queried and needs to respond quickly. What is a view in the relational data model? Answer: A view is a virtual table in the relational data model that does not store data but is based on one or more tables. It is used to simplify queries and ensure data security. What is the difference between a clustered index and a non-clustered index in the relational data model? Answer: A clustered index determines the physical order of data in a table and can be created for only one field in a table. A non-clustered index is a separate data structure that can be created for multiple fields in a table. What is a transaction in the relational data model, and why is it important? Answer: A transaction is a sequence of database operations that are treated as a single unit of work. It is important because it ensures data consistency and integrity in a multi-user database environment.
- Tables: In the relational data model, data is organized into tables, where each table represents a collection of related data.
- Rows: Each row in a table represents a single record or entity, and each column represents a specific attribute of that record.
- Primary keys: A primary key is a unique identifier for a record in a table. It is used to ensure data integrity and to establish relationships between tables.
- Foreign keys: A foreign key is a field in a table that references the primary key of another table. It is used to establish relationships between tables.
- Joins: Joins are operations that combine records from two or more tables based on a common field.
- Normalization: Normalization is the process of organizing data in a database to reduce redundancy and improve data consistency.
- Denormalization: Denormalization is the process of intentionally adding redundancy to a database to improve query performance.
- Views: A view is a virtual table in the relational data model that does not store data but is based on one or more tables. It is used to simplify queries and ensure data security.
- Simplicity: The relational data model is easy to understand and use.
- Flexibility: Tables can be easily added, deleted, or modified to meet changing business needs.
- Data consistency: The use of primary keys and foreign keys ensures data consistency and integrity.
- Scalability: The relational data model is scalable, allowing databases to grow and handle large amounts of data.
- Security: Views can be used to restrict access to sensitive data.
- Performance: Joins can be slow, especially when working with large tables.
- Complexity: Designing a relational database requires careful planning and analysis.
- Lack of support for complex data types: The relational data model does not support complex data types such as arrays, XML, and JSON.