0% found this document useful (0 votes)
0 views

CS doc - Google Docs

The document outlines key concepts in computer science databases, including the distinction between data and information, the roles of information systems and databases, and the importance of database constraints like primary and foreign keys. It also discusses the necessity of databases for data sharing, scalability, performance, accuracy, security, and redundancy reduction. Additionally, it covers database transactions, ACID properties, concurrency control, data validation, and the functions of Database Management Systems (DBMS).

Uploaded by

Achintya Agarwal
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)
0 views

CS doc - Google Docs

The document outlines key concepts in computer science databases, including the distinction between data and information, the roles of information systems and databases, and the importance of database constraints like primary and foreign keys. It also discusses the necessity of databases for data sharing, scalability, performance, accuracy, security, and redundancy reduction. Additionally, it covers database transactions, ACID properties, concurrency control, data validation, and the functions of Database Management Systems (DBMS).

Uploaded by

Achintya Agarwal
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
You are on page 1/ 19

‭CS Databases‬

‭Knowledge:‬
CS Option A: HL

‭A.1.1 Outline the difference between data and information‬


‭ ata:‬‭Data is stored by computers, and can come in‬‭many forms such as integers,‬
D
‭strings, and Booleans. Data becomes information when it is interpreted and given‬
‭context.‬
‭Information:‬‭Data that is given context to provide‬‭it with meaning.‬

‭ ns ) Data is a collection of facts that are meaningless on their own whereas‬


A
‭information puts data into clear understandable context.‬

‭A.1.2 Outline the differences between an information system and a database‬


I‭ nformation Systems:‬‭A combination of information‬‭technologies and peoples‬
‭activities using the technologies to support operations, management and‬
‭decision-making designed to collect, process, store, and distribute information.‬
‭ atabase:‬‭They are a component of information systems‬‭that contains the data‬
D
‭that is used by information systems‬

‭ omponents of an information system:‬


C
‭Hardware:‬‭Physical devices like computers and servers‬‭that process and store‬
‭data.‬
‭ oftware:‬‭Programs controlling hardware and performing‬‭tasks (e.g., operating‬
S
‭systems, applications).‬
‭Data:‬‭Raw information that is processed to generate‬‭insights.‬
‭People:‬‭Users and administrators who interact with‬‭and maintain the system.‬
‭Processes:‬‭Procedures governing how data is collected,‬‭processed, and used.‬
‭ etworks:‬‭Connections between devices enabling data communication (e.g., LAN,‬
N
‭WAN, internet).‬

‭SQL PRIMARY KEY Constraint‬


‭The PRIMARY KEY constraint uniquely identifies each record in a table.‬
‭Primary keys must contain UNIQUE values, and cannot contain NULL values.‬
‭A table can have only ONE primary key; and in the table, this primary key can consist of single or‬
‭multiple columns (fields).‬

‭SQL FOREIGN KEY Constraint‬


‭The FOREIGN KEY constraint is used to prevent actions that would destroy links between tables.‬
‭A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in‬
‭another table.‬
‭The table with the foreign key is called the child table, and the table with the primary key is called the‬
‭referenced or parent table.‬

‭A.1.3 Discuss the need for databases‬


‭Databases can:‬
-‭ ‬‭Facilitate data sharing:‬‭Databases enable data sharing‬‭by providing a centralized‬
‭storage system that allows multiple users and applications to access, modify, and‬
‭retrieve data efficiently and securely .‬
‭ dditionally, databases facilitate sharing through APIs, views, and SQL queries,‬
A
‭allowing users to extract and share specific data subsets as needed.‬
-‭ Scalability -store a large amount of data:‬‭Databases‬‭are designed to handle‬
‭large amounts of data, making them a scalable solution for organisations that need‬
‭to store and manage large volumes of data‬
-‭ Performance -Ease the updating of data:‬ ‭Databases‬‭are optimised for‬
‭performance, allowing users to access and manipulate data quickly and efficiently.‬
‭Multiple‬‭people cannot edit the same file at once,‬‭but multiple people can edit the‬
‭same database at once.‬
-‭ Improves accuracy:‬‭When a user is entering data, there is no process that‬
‭validates this data. Which might cause issues where data is incorrectly spelt, the‬
‭date is wrong, or the data itself is wrong. Databases solve this issue through data‬
‭validation.‬
-‭ Improve security:‬‭Databases provide a secure way‬‭to store data by allowing‬
‭administrators to control access to data.‬‭This helps‬‭protect sensitive data from‬
‭unauthorised access, ensuring that only authorised users can access the data.‬
-‭ Reduce redundancy:‬‭In a spreadsheet, it is possible‬‭to add the same data‬
‭multiple times, causing redundancy. A database solves this issue through a primary‬
‭key that ensures duplicates of data are not possible. -‬‭NF‬

‭ tate some difference between a Spreadsheet software application and a‬


S
‭Database Management System.‬
‭●‬ A
‭ Database Management System could be used for various tasks with data‬
‭associations that cannot be created with spreadsheets.‬
‭●‬ A
‭ Database Management System manages databases and serves a lot of‬
‭users.‬
‭●‬ ‭A Database Management System preserves data integrity easier.‬
‭●‬ A
‭ spreadsheet can be used to produce charts and graphs using automated‬
‭software tools.‬
‭●‬ ‭A spreadsheet can hold a limited amount of information.‬
‭●‬ ‭A spreadsheet usually serves the needs of a single person.‬
‭●‬ S
‭ preadsheet software can perform a lot of mathematical functions and‬
‭perform data analysis.‬

‭ .1.4 Describe the use of transactions, states and updates to maintain data‬
A
‭consistency and integrity‬
‭ tates:‬‭They are the states that a transaction goes through to keep track of changes‬
S
‭to the database (‬‭additions, updates, and deletions‬‭),‬ ‭they inform about the current‬
‭state of the transaction whether it was committed or was aborted to‬ ‭maintain‬
‭consistency across different bases to ensure data integrity.‬
‭ ransaction:‬‭A transaction ensures that these operations‬‭are completed as a single‬
T
‭logical unit, atomic unit.‬

‭ pdates‬‭:Updates refer to changes made to the database,‬‭including additions,‬


U
‭updates, and deletions. Database management systems use update operations to‬
‭make changes to the database while maintaining data consistency and integrity.‬
‭This is accomplished through the use of locking mechanisms, which ensure that‬
‭only one user can make changes to a particular record at a time. This helps prevent‬
‭conflicts and inconsistencies in the data.‬
‭ tate Management:‬‭During the transaction, different‬‭states such as "begin," "in‬
S
‭progress," and "committed" help track the process.‬
‭ ollback Mechanism:‬‭If both operations (debit and‬‭credit) are not successfully‬
R
‭completed, the transaction will be rolled back to revert all changes, maintaining the‬
‭integrity of the data.‬
‭ tomicity:‬‭This ensures that either all parts of a‬‭transaction are executed or none,‬
A
‭preventing partial updates that could lead to inconsistencies.‬

‭How do they ensure data consistency and integrity?‬


‭ onsistency‬‭in transactions refers to transactions‬‭never violating rules that dictate‬
C
‭what data is valid and not valid in a database. Whenever a transaction breaks one‬
‭of the rules and introduces data that is inconsistent, it will roll back.‬
‭ ata integrity‬‭is the overall completeness, accuracy‬‭and consistency of data. It is‬
D
‭ensured in the creation phase of the database, where certain rules are set in place to‬
‭ensure no data or updates are repeated, and all data follow the same format.‬

‭A.1.5 Define the term database transactions‬


‭ ransaction:‬‭A logical unit of work executed to retrieve or update data. For a‬
T
‭transaction to occur, it must exhibit the four properties of‬‭ACID‬‭(Atomicity,‬
‭Consistency, Isolation, Durability)‬
‭1.‬ A
‭ tomicity:‬‭A transaction is atomic, which means that‬‭either all of its‬
‭operations are executed successfully or none of them are executed at all.‬
‭This ensures that the database remains in a consistent state.‬
‭2.‬ C
‭ onsistency:‬‭A transaction ensures that the database‬‭remains in a consistent‬
‭state before and after it is executed.‬
‭3.‬ I‭ solation:‬‭Transactions are executed in isolation‬‭from one another, which‬
‭means that the changes made by one transaction are not visible to other‬
‭transactions until they are completed.‬
‭4.‬ D
‭ urability:‬‭Once a transaction is completed, its changes‬‭are permanently‬
‭stored in the database, even in the event of a system failure or other problem.‬

‭A.1.6 Explain concurrency in data sharing situation‬


‭ oncurrency is defined as operating two actions at the same time trying to access‬
C
‭the same row. In databases, two users can try to update the same data‬
‭simultaneously. This might cause issues regarding data integrity, which is why‬
‭databases place partitions and rules that do not allow concurrency when updating‬
‭the same data.‬

‭Concurrency Control:‬
‭ oncurrency control is crucial for designing high-performance database systems‬
C
‭that can handle multiple users simultaneously. It is essential to manage‬
‭concurrency effectively to maintain data consistency, integrity, and reliability‬
‭●‬ L
‭ ocking: This prevents other transactions from accessing data that's being‬
‭modified.‬
‭●‬ ‭Timestamp ordering: Transactions are ordered based on their timestamp.‬
‭●‬ M
‭ ultiversion concurrency control (MVCC): Keeps multiple versions of data‬
‭to allow read operations without blocking writes.‬
‭Indexing strategies:‬
‭1.‬ ‭B-tree indexes:‬‭Balanced tree structure, good for‬‭a wide range of queries‬
‭2.‬ ‭Hash indexes:‬‭Excellent for equality comparisons,‬‭but not range queries‬
‭3.‬ B
‭ itmap indexes:‬‭Efficient for low-cardinality columns‬‭(columns with few‬
‭distinct values)‬

‭ OTE:‬‭While indexes speed up reads, they slow down‬‭writes. It's all about‬
N
‭finding the right balance.‬

‭ .1.7 Explain the importance of the ACID properties of a database‬


A
‭transaction‬
‭Atomicity:‬‭The entire transaction takes place at once‬‭or it doesn’t happen‬
‭ onsistency:‬‭The database and its contents must be‬‭consistent before and after the‬
C
‭transaction‬
‭Isolation:‬‭Multiple transactions can occur independently‬‭without interference‬
‭ urability:‬‭The changes of a successful transaction‬‭occur even if the system‬
D
‭failure occurs‬

‭A.1.8 Describe the two functions databases require to be performed on them‬


‭ uery Functions:‬‭A request to view data or information‬‭from a table or‬
Q
‭combination of tables. This request can be specific to a certain extent that the user‬
‭is looking for such as a certain age, location, or any value in the database‬
‭Update Functions:‬‭Used to modify the existing records‬‭in a table‬

‭A.1.9 Explain the role of data validation and verification‬


‭ alidation:‬‭To check the data being inputted to make‬‭sure it matches the rules and‬
V
‭requirements set for current data in the database‬
-‭ Length(‬‭Verifies that data entered has the correct number of characters or isn't‬
‭longer than a certain number of characters), Range, Presence, Format(Ensures that‬
‭data follows a specific pattern or structure, often using input masks or regular‬
‭expressions), Data type Checks(Ensures that the data entered is of the expected‬
‭type)‬
‭ ata Verification:‬‭To ensure that the user is inputting‬‭the data that they want to‬
D
‭input, such as making the user input their password twice to make sure they didn’t‬
‭make a spelling mistake.‬
‭-Double entry, and actually proofreading.‬

‭ .2.1 Define the terms Database Management System (DBMS) and Relational‬
A
‭Database Management System (RDBMS)‬
‭ atabase Management System:‬‭A system software used‬‭to create and manage a‬
D
‭database. It provides the user with a systematic way to create, retrieve, update and‬
‭manage data‬
‭ elational Database Management System:‬‭It is a DBMS‬‭based on the relational‬
R
‭model. The data in a RDBMS is stored in a table, consisting of fields (UserID,‬
‭UserAge, UserName) and records where each record is an individual entry filling‬
‭out the fields.‬

‭A.2.2 Outline the functions and tools of a DBMS‬


‭- Data Dictionary Tool Management‬
‭- Data Definition Language‬
‭- Data storage management‬
‭- Data integrity management‬

‭Methods in DBMS for query optimization:‬


‭1.‬ ‭Analyzing the query structure‬
‭2.‬ ‭Estimating the cost of different execution plans‬
‭3.‬ ‭Choosing the plan with the lowest estimated cost‬

‭A.2.3 Explain how a DBMS can be used to promote data security‬


‭ atabase security involves protecting the database from unauthorised access,‬
D
‭malicious attacks, and accidental data loss.‬
‭ ata locking:‬‭When multiple transactions on the same‬‭data are occurring‬
D
‭concurrently, data locking is requested where certain data cannot be edited.‬
‭ ccess rights:‬‭Allowing access to the data through‬‭a PIN or password. The access‬
A
‭can vary as it can be read-only or read and write.‬
‭ udit trials:‬‭A trial that keeps up with everyone‬‭that accessed the data and edited‬
A
‭it. Keeping a track of database activities‬
‭ alidation:‬‭Previously talked about, ensures that‬‭the data inputted follows the‬
V
‭requirements and rules set by the database.‬
‭ ncryption:‬‭An algorithm is used to encrypt the data‬‭where it all becomes‬
E
‭unreadable code that can only be decrypted through a key also generated by the‬
‭algorithm provided to the user protecting data both at rest and in transit‬
‭ ackups:‬‭When a file is corrupt, it is safer and easier‬‭to delete that file and use a‬
B
‭backup of it.‬
‭Authorization‬‭: Controlling what actions users can‬‭perform‬

‭Database Privacy‬
‭ rivacy focuses on protecting sensitive personal information. This includes‬
P
‭implementing:‬
‭1.‬ ‭Data anonymization: Removing personally identifiable information‬
‭2.‬ ‭Authentication: Verifying the identity of users‬
‭3.‬ ‭Access controls: Limiting who can see sensitive data‬
‭4.‬ ‭Compliance with regulations.‬
‭A.2.4 Define the term schema‬
‭ chema:‬‭The organisation of data as a blueprint of‬‭how the database is‬
S
‭constructed.‬

I‭ t includes Data types permitted within the database, Relationships between‬


‭different data types (e.g., primary and foreign keys), Constraints or rules governing‬
‭data integrity.It typically comprises tables representing entities (e.g., customers,‬
‭orders) with fields or attributes (e.g., customer name, order date).Relationships‬
‭between tables are defined (e.g., each order links to a specific customer and‬
‭product).Ensures data is organised to meet business objectives and requirements,‬
‭providing a structured data framework.‬

‭ OTE:‬‭Don't confuse schema with the actual data. The‬‭schema is the structure,‬
N
‭while the data is what fills that structure.‬

‭ .2.5 Identify the characteristics of the three levels of the schema: conceptual,‬
A
‭logical, physical‬
‭Physical‬
‭- Physical storage structure of the database‬
‭- Low level data structures in detail‬

‭ hysical schema‬‭: Lowest schema level, detailing actual‬‭data storage and‬


P
‭organization.‬
‭Specifies:‬
‭●‬ ‭Storage structures‬‭used for data storage.‬
‭●‬ ‭Access methods‬‭for data retrieval.‬
‭●‬ ‭Indexes‬‭to improve data retrieval efficiency.‬
‭●‬ ‭Backup and recovery strategies‬‭to ensure data protection.‬
‭ ocuses on technical aspects such as‬‭disk storage‬‭,‬‭memory allocation‬‭, and‬‭I/O‬
F
‭performance‬‭.‬
‭ ptimised for efficient‬‭data access‬‭and‬‭processing‬‭,‬‭supporting the higher-level‬
O
‭logical and conceptual schemas.‬
‭ nsures‬‭performance optimization‬‭and‬‭data integrity‬‭through technical‬
E
‭management of database details.‬

‭Logical:‬
‭ ogical schema: Higher-level abstraction, defining data relationships and‬
L
‭constraints.‬
‭Outlines:‬
‭●‬ ‭Entities, attributes, and relationships.‬
‭●‬ C
‭ onstraints ensuring data integrity and accuracy (e.g., referential integrity‬
‭constraints).‬
‭Acts as an interface between business requirements and physical implementation.‬
‭ aintains consistent data structure even as physical implementation evolves,‬
M
‭aiding in data access and query performance.‬
‭ nsures data consistency and supports decision-making by providing a coherent‬
E
‭view of data for business and technical stakeholders.‬

‭Conceptual:‬
‭High-level representation of database structure and organization.‬
‭ rovides a‬‭unified view‬‭of organizational data, abstracting‬‭from physical storage‬
P
‭and processing.‬
‭Defines:‬
‭●‬ ‭Entities‬‭and their‬‭attributes‬‭.‬
‭●‬ ‭Relationships‬‭between entities (semantic model of‬‭data).‬
‭ erves as a bridge between‬‭business requirements‬‭and the‬‭physical database‬
S
‭implementation‬‭.‬
‭ oundation for‬‭logical schema‬‭(detailed data relationships‬‭and constraints) and‬
F
‭physical schema‬‭(data storage).‬
‭ nables consistent, organized data views that adapt as the database evolves.It‬
E
‭describes the part of the database that the user is interested in and hides the‬
‭remaining database from the user‬

‭Data Warehousing and Olap‬


‭ s businesses grow, they often need to analyze vast amounts of historical data.‬
A
‭This is where data warehousing comes in.‬
‭ data warehouse is a large, centralized repository of data from various sources,‬
A
‭optimized for analysis rather than day-to-day operations. It supports Online‬
‭Analytical Processing (OLAP), which allows complex analytical queries across‬
‭large datasets.‬

‭Key concepts in data warehousing include:‬


‭1.‬ ‭ETL (Extract, Transform, Load): The process of getting data into the‬
‭warehouse‬
‭2.‬ ‭Dimensional modeling: Organizing data into fact and dimension tables‬
‭3.‬ ‭Star and snowflake schemas: Common data warehouse schema designs‬

‭Data Mining‬
‭ ata mining is the process of discovering patterns and knowledge from large‬
D
‭amounts of data.‬
‭Common ways for data Mining:‬
‭1.‬ ‭Classification: Predicting which category something belongs to‬
‭a.‬ ‭Ex-‬‭Classify customers into segments based on purchasing behaviour‬
‭2.‬ ‭Clustering: Grouping similar items together‬
‭a.‬ ‭Ex -‬‭Cluster products that are often bought together‬
‭3.‬ ‭Association rule mining: Finding relationships between variables‬
‭4.‬ ‭Anomaly detection: Identifying unusual patterns‬
‭a.‬ ‭Ex-‬‭Detect fraudulent transactions‬
‭A.2.6 Outline the nature of a Data Dictionary‬

‭ data dictionary (also known as a metadata repository or data catalogue) is a‬


A
‭collection of metadata that provides information about the data (‬‭ata elements,‬
‭tables and relationships, business rules and constraints, data access permissions,‬
‭and other technical details related to DBMS‬‭) in a‬‭database. The data dictionary‬
‭serves as a reference source for database administrators, developers, and users, and‬
‭it provides a standardised way to document the structure and contents of a‬
‭database.By providing a centralised source of information about the database, the‬
‭data dictionary helps to ensure that data is managed effectively and used‬
‭appropriately by authorised users.‬

‭Explanation:‬
‭ data dictionary tool is an inventory that holds all information about the fields of‬
A
‭a RDBMS such as the type of data that should be inputted into it, a limit on the‬
‭number of characters or numbers, description, and any other information that could‬
‭be of use.‬

‭ ata Element Descriptions:‬‭A data dictionary typically‬‭includes a description of‬


D
‭each data element or attribute used in the database, along with information such as‬
‭the data type, length, and format of the element.‬
‭ able and Relationship Descriptions:‬‭A data dictionary‬‭may include descriptions‬
T
‭of the tables in the database, as well as the relationships between the tables. This‬
i‭nformation can help users understand the structure of the database and the way‬
‭data is organised within it.‬
‭ usiness Rules and Constraints:‬‭A data dictionary‬‭may also include information‬
B
‭about the business rules and constraints that apply to the data in the database. This‬
‭can include information such as data validation rules, default values, and other‬
‭constraints.‬
‭ ata Access Permissions:‬‭A data dictionary may also‬‭include information about‬
D
‭the access permissions that are required to view or modify data in the database.‬
‭This can help to ensure that data is accessed and used appropriately by authorized‬
‭users.‬
‭ atabase Management Information:‬‭A data dictionary‬‭may also include‬
D
‭information about the database management system itself, such as the version of‬
‭the software being used, the server configuration, and other technical details.‬

‭ .2.7 Explain the importance of a Data Definition Language (DDL) in‬


A
‭implementing a data model‬
‭ DL is a programming language used to define and modify a database. DDL’s can‬
D
‭be used to create the database, insert the data into it then update its contents. It is‬
‭important as it is one of the only methods for a programmer to communicate with a‬
‭database to update and store data permanently.‬

‭A.2.8 Explain the importance of data modelling in the design of a database‬


‭ database model is a type of data modelling that defines the logical structure of a‬
A
‭database. It determines the relationships between data and the constraints in order‬
‭to gain a better idea on how to store, update and retrieve the data.‬
‭Data modelling is important as it results in:‬
‭- Reduced costs‬
‭- Higher quality‬
‭- Clearer scope‬
‭- Fewer errors‬
‭- Managed risk‬

‭ .2.9 Define the following database terms: table, record, field, primary key,‬
A
‭secondary key, foreign key, candidate key, composite primary key, join‬
‭Table:‬‭A relation or a file‬
‭Record:‬‭A tuple or row‬
‭Field:‬‭An attribute or column.‬
‭ rimary key:‬‭A primary key is a keyword of a certain‬‭type that is unique to each‬
P
‭record used to identify that record from the rest. Typically, the primary key makes‬
‭up a column and is and ID.‬
‭ econdary key / Candidate key:‬‭It is a column that‬‭is eligible to be a primary key‬
S
‭but has not been chosen, so is called a secondary key or a candidate key.‬
‭ oreign key:‬‭A foreign key is a column in a relational‬‭database that that provide a‬
F
‭link between two tables by referencing a primary key in another table.‬
‭ omposite primary key:‬‭A combination of fields that‬‭when both used together‬
C
‭can identify each record uniquely. Commonly used when a singular column cannot‬
‭identify each record uniquely, but a combination of them can.‬
J‭ oin:‬‭An SQL operation used to create a link between‬‭two tables based on‬
‭matching columns. Used a foreign and primary key.‬
I‭ nner join:‬‭a relational database operation that merges‬‭rows from two tables based‬
‭on a shared attribute, usually a‬‭primary key and foreign‬‭key relationship‬‭. It‬
‭retrieves only those tuples (rows) that have matching values in both tables, thus‬
‭enforcing‬‭referential integrity‬‭by excluding non-matching‬‭records. This operation‬
‭is essential in structured query management, enabling efficient data retrieval and‬
‭relational data analysis in SQL databases.‬
‭ .2.10 Identify the different types of relationships within a database:‬
A
‭one-to-one, one-to-many, many-to-many‬
‭ ne-to-One:‬‭Each record in a table is associated with‬‭one and only record in‬
O
‭another table.‬
‭ ne-to-Many:‬‭Each record in one table can be associated‬‭to many records in‬
O
‭another table.‬
‭ any-to-Many:‬‭Multiple records in a table are associated‬‭with multiple records in‬
M
‭another table. In this case, a join table is used where foreign keys are implemented‬
‭from each table.‬

‭A.2.11 Outline the issues cause by redundant data‬


‭- Data integrity‬
‭- Data reliability‬
‭- Space‬
‭- Time‬

‭ .2.12 Outline the importance of referential integrity in a normalized‬


A
‭database‬
‭What is referential integrity?‬
I‭ t is the relationship between tables. The primary key of a table can appear in‬
‭another tables as a foreign key.‬
‭What is the importance of referential integrity?‬
‭- Prevents the entry of duplicate data‬
‭- Prevents one table to point to a nonexistent field in another table‬
‭- Guarantees consistency between the tables‬
‭- Prevents the deletion of a record referred to by a foreign key‬
-‭ Prevents the creation of a record in a table that has a foreign key unless there is a‬
‭primary key‬
‭ .2.13 Describe the differences between 1‬‭st‬ ‭Normal‬‭Form (1NF), 2‬‭nd‬ ‭Normal‬
A
‭Form (2NF) and 3‬‭rd‬ ‭Normal Form (3NF)‬

‭ ormalization - It's a process of organising data to minimise redundancy and‬


N
‭dependency to make the database more efficient and reduce data anomalies‬

‭●‬ ‭1NF- “Unique and atomic values”‬


‭○‬ E
‭ ach row in the database must be unique, typically achieved through a‬
‭primary key.‬
‭○‬ A
‭ ll cells must contain only one piece of data (no arrays or lists in a‬
‭cell).‬
‭○‬ E
‭ ach column should hold values of the same data type, with no‬
‭repeating groups (e.g., avoid multiple columns for similar data).‬

‭●‬ ‭2NF - “No Partial Dependencies / Complete Key Dependency”‬


‭○‬ A
‭ pplicable only if the table has a composite key and is already in First‬
‭Normal Form (1NF).‬
‭○‬ A
‭ ll columns (non-key attributes) within the table must depend on the‬
‭whole composite key, avoiding partial dependencies and reducing‬
‭redundancy.‬

‭●‬ ‭3NF-“No Transitive Dependencies”‬


‭○‬ ‭The database must already be in Second Normal Form (2NF).‬
‭○‬ A
‭ ll non-key attributes should be directly dependent and determined‬
‭by the primary key only, with no dependency on other non-key‬
‭attributes.‬
‭○‬ T
‭ his eliminates transitive dependencies and further reduces‬
‭redundancy.‬

‭Short Summary:‬
‭•‬ ‭1NF has no repeating rows or columns.‬
‭•‬ ‭2NF is based on full functional dependency.‬
‭•‬ ‭3NF involves the removal of transitive dependencies.‬

‭ OTE: 2NF‬‭follows requirements of 1NF, and‬‭3NF‬‭follows‬‭the requirements of‬


N
‭2NF‬

‭A.2.14 Describe the characteristics of a normalized database‬


‭●‬ ‭Makes accessing and storing data easier and more efficient‬
‭●‬ ‭Makes maintaining the database contents quicker and easier‬
‭●‬ ‭Reduces the chances of data errors or duplication.‬

‭A.2.15 Evaluate the appropriateness of the different data types.‬


‭-‬ ‭Char:‬‭Only used when need to store a certain letter‬
‭-‬ ‭Int:‬‭Used to store numbers that are below 9 digits‬‭of precision‬
‭-‬ ‭Long:‬‭Used to store numbers greater than 9 digits‬‭of precision‬
‭-‬ ‭Double:‬‭Used to store decimal digits‬
‭A.2.16 Construct an entity-relationship diagram (ERD) for a given scenario.‬

You might also like