├── Answering Strategies └── Chapter 5 │ └── readme.md ├── Exercise ├── Chapter 1 │ └── readme.md ├── Chapter 2 │ └── readme.md ├── Chapter 3 │ └── readme.md ├── Chapter 4 │ └── readme.md ├── Chapter 5 │ └── readme.md ├── Chapter 6 │ └── readme.md └── Chapter 7 │ └── readme.md ├── Important Notes ├── Chapter 1 │ └── ApplicationAreasOfDatabaseSystem.md ├── Chapter 2 │ └── Data-Information-Knowledge.md ├── Chapter 3 │ ├── DatabaseDesignLanguage.md │ ├── EntityRelationshipDiagram.md │ └── HowToIdentifyForeignKey.md ├── Chapter 4 │ ├── AggregateFunctions.md │ └── StructuredQueryLanguage.md ├── Chapter 5 │ ├── Data Anomalies.md │ ├── HowToIdentifyRepeatingGroupIn1NF.md │ └── Normalisation.md ├── Chapter 6 │ └── setOperator.md └── Chapter 7 │ └── readme.md ├── README.md └── src └── banner.svg /Answering Strategies/Chapter 5/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Answering Strategies/Chapter 5/readme.md -------------------------------------------------------------------------------- /Exercise/Chapter 1/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Exercise/Chapter 1/readme.md -------------------------------------------------------------------------------- /Exercise/Chapter 2/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Exercise/Chapter 2/readme.md -------------------------------------------------------------------------------- /Exercise/Chapter 3/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Exercise/Chapter 3/readme.md -------------------------------------------------------------------------------- /Exercise/Chapter 4/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Exercise/Chapter 4/readme.md -------------------------------------------------------------------------------- /Exercise/Chapter 5/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Exercise/Chapter 5/readme.md -------------------------------------------------------------------------------- /Exercise/Chapter 6/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Exercise/Chapter 6/readme.md -------------------------------------------------------------------------------- /Exercise/Chapter 7/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Exercise/Chapter 7/readme.md -------------------------------------------------------------------------------- /Important Notes/Chapter 1/ApplicationAreasOfDatabaseSystem.md: -------------------------------------------------------------------------------- 1 | # Application Areas of Database System 2 | 3 | >[!TIP] 4 | >You Need To Know At Least THREE (3) Application Areas 5 | 6 | ## 1. ✈️ Airlines and railways 7 | Databases are used for: 8 |
  9 |     1. Booking tickets for flights and trains.
 10 |     2. Displaying real-time schedules and delays.
 11 |     3. Managing passenger details and seat availability.
 12 |     4. Tracking luggage and cargo.
13 | 14 | System Example: 15 |
 16 |     1. Reservation Management System: Manages ticket booking and seat allocation.
 17 |     2. Schedule Management System: Tracks and updates train or flight schedules.
 18 |     3. Cargo Management System: Handles tracking and logistics for luggage and cargo.
19 | 20 | ## 2. 🏦 Banking 21 | Databases help with: 22 |
 23 |    1. Viewing account balances and recent transactions.
 24 |    2. Processing loan applications and approvals.
 25 |    3. Tracking mortgage payments.
 26 |    4. Managing credit/debit card information.
27 | 28 | System Example: 29 |
 30 |     1. Core Banking System: Manages customer accounts and transactions.
 31 |     2. Loan Management System: Tracks loan applications and repayments.
 32 |     3. Payment Processing System: Processes electronic fund transfers and transactions.
33 | 34 | ## 3. 🏫 Education 35 | Schools and colleges use databases for: 36 |
 37 |     1. Registering students for courses and classes.
 38 |     2. Storing exam results and report cards.
 39 |     3. Managing library book inventories.
 40 |     4. Scheduling classes and tracking attendance.
41 | System Example: 42 |
 43 |     1. Student Information System (SIS): Manages student records and registrations.
 44 |     2. Learning Management System (LMS): Facilitates course delivery and grading.
 45 |     3. Library Management System: Tracks book lending and availability.
46 | ## 4. 🔭 Telecommunications 47 | Databases store: 48 |
 49 |     1. User subscription plans and payment details.
 50 |     2. Call records for customer billing.
 51 |     3. Details of network towers and their coverage.
 52 |     4. Tracking mobile data usage and bandwidth allocation.
53 | System Example: 54 |
 55 |     1. Subscriber Management System: Tracks user subscription plans and details.
 56 |     2. Billing Management System: Generates customer bills based on usage.
 57 |     3. Call Data Management System: Logs call records for billing and analysis.
58 | ## 5. 💳 Credit Card Transactions 59 | Databases track: 60 |
 61 |     1. Online and in-store purchases.
 62 |     2. Identifying fraudulent transactions.
 63 |     3. Tracking rewards points or cashback benefits.
 64 |     4. Managing credit limits and overdue payments.
65 | System Example: 66 |
 67 |     1. Transaction Management System: Tracks purchases and payments.
 68 |     2. Fraud Detection System: Identifies and flags suspicious activities.
 69 |     3. Statement Generation System: Prepares and distributes monthly credit card statements.
70 | ## 6. 💻 E-commerce 71 | Databases integrate different sources for: 72 |
 73 |     1. Displaying product catalogs with prices and stock levels.
 74 |     2. Managing user reviews and ratings.
 75 |     3. Processing orders and tracking delivery statuses.
 76 |     4. Suggesting products based on user preferences.
77 | System Example: 78 |
 79 |     1. Product Catalog Management System: Stores product details and inventory.
 80 |     2. Order Management System: Tracks customer orders and shipping.
 81 |     3. Customer Review System: Manages product reviews and feedback.
82 | ## 7. 👨‍⚕️ Health Care 83 | Databases manage: 84 |
 85 |     1. Electronic Medical Records (EMR) for patient history.
 86 |     2. Appointment scheduling with doctors or specialists.
 87 |     3. Storing test results and diagnostic images.
 88 |     4. Managing prescriptions and pharmacy inventories.
89 | System Example: 90 |
 91 |     1. Electronic Medical Record (EMR) System: Stores patient medical histories.
 92 |     2. Appointment Scheduling System: Manages doctor-patient appointment bookings.
 93 |     3. Pharmacy Management System: Tracks prescriptions and drug inventory.
94 | ## 8. 📖 Digital Libraries and Publishing 95 | Databases help in: 96 |
 97 |     1. Organizing e-books, research papers, and articles.
 98 |     2. Searching for specific topics or authors.
 99 |     3. Managing user memberships and borrowing history.
100 |     4. Delivering multimedia content like videos and audio books.
101 | System Example: 102 |
103 |     1. Repository Management System: Stores and organizes research and archives.
104 |     2. Content Management System (CMS): Manages and delivers multimedia content.
105 |     3. Membership Management System: Tracks user memberships and borrowing history.
106 | 107 | ## 9. 💰 Finance 108 | Databases are used to store: 109 |
110 |     1. Stock market data, such as prices and trends.
111 |     2. Records of sales and purchases for trading platforms.
112 |     3. Generating tax reports and financial statements.
113 |     4. Analyzing risks and forecasting financial growth.
114 | System Example: 115 |
116 |     1. Portfolio Management System: Tracks stock, bond, and asset data.
117 |     2. Accounting System: Records financial transactions and generates reports.
118 |     3. Risk Analysis System: Evaluates financial risks and forecasts trends.
119 | 120 | ## 10. 💁 Sales 121 | Databases keep details of: 122 |
123 |     1. Product catalogs, including specifications and images.
124 |     2. Customer purchase histories for loyalty programs.
125 |     3. Tracking sales performance and revenue reports.
126 |     4. Managing supply chain data and inventory restocking.
127 | System Example: 128 |
129 |     1. Customer Relationship Management (CRM) System: Manages customer interactions and sales data.
130 |     2. Inventory Management System: Tracks product stock and restocking.
131 |     3. Point-of-Sale (POS) System: Processes customer purchases and receipts.
132 | ## 11. 👨‍💼 Human Resources 133 | Organizations use databases for: 134 |
135 |     1. Maintaining employee records, such as job titles and performance reviews.
136 |     2. Tracking training and certifications for employees.
137 |     3. Managing payroll, including salary deductions and bonuses.
138 |     4. Handling recruitment, including job applications and interview schedules.
139 | System Example: 140 |
141 |     1. Employee Management System: Stores employee data and performance reviews.
142 |     2. Payroll System: Manages salary, benefits, and tax calculations.
143 |     3. Recruitment Management System: Tracks job applications and hiring processes.
144 | 145 | 146 | -------------------------------------------------------------------------------- /Important Notes/Chapter 2/Data-Information-Knowledge.md: -------------------------------------------------------------------------------- 1 | # Differentiate Data, Information and Knowledge 2 | 3 | >[!IMPORTANT] 4 | >You Are Required To Understand Data, Information and Knowledge 5 | 6 | ## Definition 7 | 8 |
9 | Data 10 |
11 | 1. Raw facts about things and events. 12 |

13 | 2. Raw data the not yet been processed to reveal the meaning. 14 |

15 | 3. Data refers to raw, unprocessed facts, figures, or symbols that have no meaning on their own. 16 |
17 |
18 |
19 | Information 20 |
21 | 1. Transformed data that has value for decision making

22 | 2. Information is data that has been processed, organized, or structured in a way that it becomes meaningful and useful for a specific purpose. 23 |
24 |
25 |
26 | Knowledge 27 |
28 | 1. Raw facts about things and events

29 | 2. Knowledge is about taking actions or making decisions informed by analyzing data and information. 30 |
31 |
32 | 33 | ## Example 34 | 35 | ### 1. ✈️ Airlines and railways 36 |
 37 |   
  • Data: Passenger ticket bookings and seat availability.
  • 38 |
  • Information: Percentage of seats booked for a specific route over the past month.
  • 39 |
  • Knowledge: Add more flights on high-demand routes or offer discounts on less-booked routes.
  • 40 |
    41 | 42 | 43 | ### 2. 🏦 Banking 44 |
     45 |   
  • Data: Daily transactions, deposits, and withdrawals.
  • 46 |
  • Information: A customer's average monthly savings over the past year.
  • 47 |
  • Knowledge: Offer tailored savings plans or investment opportunities to encourage consistent saving.
  • 48 |
    49 | 50 | ### 3. 🏫 Education 51 |
     52 |   
  • Data: Students' attendance records and grades.
  • 53 |
  • Information: A student's academic performance trends over the semester.
  • 54 |
  • Knowledge: Provide additional tutoring for students with declining grades or reward high-performing students.
  • 55 |
    56 | 57 | ### 4. 🔭 Telecommunications 58 |
     59 |   
  • Data: Call duration, data usage, and service complaints.
  • 60 |
  • Information: The number of dropped calls experienced by users in a specific area last month.
  • 61 |
  • Knowledge: Upgrade network infrastructure in areas with frequent dropped calls to improve service.
  • 62 |
    63 | 64 | ### 5. 💳 Credit Card Transactions 65 |
     66 |   
  • Data: Purchase amounts, merchant details, and transaction dates.
  • 67 |
  • Information: A customer's spending pattern over the last three months.
  • 68 |
  • Knowledge: Offer personalized credit limits or cashback rewards based on spending behavior.
  • 69 |
    70 | 71 | ### 6. 💻 E-commerce 72 |
     73 |   
  • Data: Product views, purchases, and customer ratings.
  • 74 |
  • Information: The top 10 most-viewed items during a holiday sale.
  • 75 |
  • Knowledge: Increase stock for popular items and run targeted promotions for similar products.
  • 76 |
    77 | 78 | ### 7. 👨‍⚕️ Health Care 79 |
     80 |   
  • Data: Patient's medical test results and prescription history.
  • 81 |
  • Information: A patient's cholesterol level trend over six months.
  • 82 |
  • Knowledge: Adjust dietary recommendations or prescribe new medication based on rising cholesterol levels.
  • 83 |
    84 | 85 | ### 8. 📖 Digital Libraries and Publishing 86 |
     87 |   
  • Data: User downloads, book titles, and reading durations.
  • 88 |
  • Information: The most-read genre by library members over the past year.
  • 89 |
  • Knowledge: Purchase or promote more books in popular genres to increase library usage.
  • 90 |
    91 | 92 | ### 9. 💰 Finance 93 |
     94 |   
  • Data: Stock prices, trade volumes, and financial reports.
  • 95 |
  • Information: Stock ABC's price volatility over the past month.
  • 96 |
  • Knowledge: Advise clients to buy, hold, or sell stocks based on market trends and risk tolerance.
  • 97 |
    98 | 99 | ### 10. 💁 Sales 100 |
    101 |   
  • Data: Daily sales transactions and customer demographics.
  • 102 |
  • Information: The top-selling product category by region for the quarter.
  • 103 |
  • Knowledge: Focus marketing efforts on the best-selling product categories in each region.
  • 104 |
    105 | 106 | ### 11. 👨‍💼 Human Resources 107 |
    108 |   
  • Data: Employee attendance, performance scores, and salaries.
  • 109 |
  • Information: An employee’s declining performance over the last six months.
  • 110 |
  • Knowledge: Provide additional training or counseling to improve performance or reassess role suitability.
  • 111 |
    112 | 113 | -------------------------------------------------------------------------------- /Important Notes/Chapter 3/DatabaseDesignLanguage.md: -------------------------------------------------------------------------------- 1 | # Database Design Language (DBDL) 2 | 3 | >[!IMPORTANT] 4 | >You need to remember **THREE (3)** way to differentiate the keys in DBDL. 5 | 6 |
    7 | Primary Key 8 |
    9 | Use underline to present it in DBDL. 10 |

    11 | Example: 12 |
    13 | variable_name 14 |
    15 | 16 |
    17 | Foreign Key 18 |
    19 | Use asterisk (*) to present it in DBDL. 20 |

    21 | Example: 22 |
    23 | variable_name* 24 |
    25 | 26 |
    27 | Composite Key 28 |
    29 | Use asterisk and underline to present it in DBDL. 30 |

    31 | Example: 32 |
    33 | variable_name* 34 |
    35 | 36 | ## Syntax of Database Design Language (DBDL) 37 | table_name(column_name1, column_name2, column_name3, ....) 38 | 39 | ### Example 40 | Customer(cust_id, cust_name, cust_email, cust_address, cust_phoneNumber) 41 |
    42 | Order(order_id, order_desc, order_qty, total_amount, cust_id*) 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Important Notes/Chapter 3/EntityRelationshipDiagram.md: -------------------------------------------------------------------------------- 1 | # Entity Relationship Diagram 2 | 3 | ## Crow foot Notation 4 | >[!IMPORTANT] 5 | >We only have **FOUR(4)** types of relationships 6 | 7 | image 8 | 9 | 10 | -------------------------------------------------------------------------------- /Important Notes/Chapter 3/HowToIdentifyForeignKey.md: -------------------------------------------------------------------------------- 1 | # Keys in database design 🔑 2 |
    3 | Primary Key 4 |
    5 | 1. Unique identifier for the table. 6 |

    7 | 2. Data cannot be duplicate. 8 |
    9 | 10 |
    11 | Foreign Key 12 |
    13 | 1. Referential key from another table. 14 |

    15 | 2. Data can be duplicate. 16 |
    17 | 18 |
    19 | Composite Key 20 |
    21 | 1. Combination of primary key and foreign key. 22 |

    23 | 2. Either one column of the data can be repeat. However, same combination cannot be duplicate. 24 |
    25 | 26 | # How to Identify Foreign Key❓ 27 | 28 | >[!IMPORTANT] 29 | >Always remember **FOREIGN KEY** place at **MANY SITE** 30 | 31 | # Why Foreign Key must be located at many site❓ 32 | 33 | ### Example ❌ 34 | image 35 | 36 | ### Scenario 37 | You are the customer 'CUS001' for company A and you willing to buy a product from the company. The orders data will be recorded in the database as shown 38 | 39 | image 40 | 41 | On the next day, you decide to buy another product from the same company. The orders data will be recorded in the database as shown 42 | 43 | image 44 | 45 | You may found that you against the rule for the primary key where all the value of primary key in a table should be **UNIQUE** and **CANNOT DUPLICATE** ‼️ 46 | 47 | Therefore, it you placed your foreign key at **ONE** site, each of your customers will be only allow to make an order for their whole life. 48 | 49 | ## Correct Example ✅ 50 | As foreign key's data can be duplicate, therefore if you willing to show the customer is allowed to buy more than one products, always remember put your foreign key at **MANY** site. 51 | image 52 | 53 | ### Sample Data 54 | image 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Important Notes/Chapter 4/AggregateFunctions.md: -------------------------------------------------------------------------------- 1 | # Aggregate Functions in SQL 2 | 3 | Aggregate functions in SQL perform calculations on multiple rows of a table and return a single value. These functions are commonly used with the **GROUP BY** clause to group data into subsets for calculation. 4 | 5 | ## 1. MIN() 6 | - Returns the smallest value in a column. 7 | - **Example:** 8 | ```sql 9 | SELECT MIN(salary) AS MinimumSalary 10 | FROM employees; 11 | ``` 12 | 13 | ## 2. MAX() 14 | - Returns the largest value in a column. 15 | - **Example:** 16 | ```sql 17 | SELECT MAX(salary) AS MaximumSalary 18 | FROM employees; 19 | ``` 20 | 21 | ## 3. COUNT() 22 | - Returns the number of rows in a column (excluding `NULL` values). 23 | - Use `COUNT(*)` to include `NULL` values. 24 | - **Example:** 25 | ```sql 26 | SELECT COUNT(employee_id) AS TotalEmployees 27 | FROM employees; 28 | ``` 29 | 30 | ## 4. SUM() 31 | - Returns the total sum of numeric values in a column. 32 | - **Example:** 33 | ```sql 34 | SELECT SUM(salary) AS TotalSalaries 35 | FROM employees; 36 | ``` 37 | 38 | ## 5. AVG() 39 | - Returns the average (mean) value of a numeric column. 40 | - **Example:** 41 | ```sql 42 | SELECT AVG(salary) AS AverageSalary 43 | FROM employees; 44 | ``` 45 | 46 | ## 6. STDDEV() 47 | - Returns the standard deviation of numeric values in a column. 48 | - Measures how much data deviates from the mean. 49 | - **Example:** 50 | ```sql 51 | SELECT STDDEV(salary) AS SalaryStandardDeviation 52 | FROM employees; 53 | ``` 54 | 55 | ## 7. VARIANCE() 56 | - Returns the variance of numeric values in a column. 57 | - Measures the spread of data values. 58 | - **Example:** 59 | ```sql 60 | SELECT VARIANCE(salary) AS SalaryVariance 61 | FROM employees; 62 | ``` 63 | 64 | --- 65 | 66 | ## Notes 67 | - Aggregate functions ignore `NULL` values by default (except `COUNT(*)`). 68 | - To calculate these values for subsets of data, combine with the `GROUP BY` clause: 69 | ```sql 70 | SELECT department_id, AVG(salary) AS AverageSalary 71 | FROM employees 72 | GROUP BY department_id; 73 | 74 | -------------------------------------------------------------------------------- /Important Notes/Chapter 4/StructuredQueryLanguage.md: -------------------------------------------------------------------------------- 1 | # Chapter 4 - Structured Query Language 2 | 3 | ## 1. SELECT Statement 4 | Retrieves data from one or more tables. 5 | 6 | **Syntax**: 7 | ```sql 8 | SELECT column1, column2 9 | FROM table_name 10 | WHERE condition; 11 | ``` 12 | 13 | **Example**: 14 | ```sql 15 | SELECT first_name, last_name 16 | FROM employees 17 | WHERE department_id = 10; 18 | ``` 19 | 20 | To select all column in a table. 21 | 22 | **Syntax**: 23 | ```sql 24 | SELECT * 25 | FROM table_name 26 | WHERE condition; 27 | ``` 28 | 29 | **Example**: 30 | ```sql 31 | SELECT * 32 | FROM employeee; 33 | ``` 34 | 35 | ## 2. INSERT Statement 36 | Adds new rows to a table. 37 | 38 | **Syntax**: 39 | ```sql 40 | INSERT INTO table_name (column1, column2) 41 | VALUES (value1, value2); 42 | ``` 43 | **Example**: 44 | ```sql 45 | INSERT INTO employees (first_name, last_name) 46 | VALUES ('John', 'Doe'); 47 | ``` 48 | 49 | ## 3. UPDATE Statement 50 | 51 | Modifies existing data within a table. 52 | 53 | **Syntax**: 54 | ```sql 55 | UPDATE table_name 56 | SET column1 = value1 57 | WHERE condition; 58 | ``` 59 | 60 | **Example**: 61 | ```sql 62 | UPDATE employees 63 | SET salary = 5000 64 | WHERE employee_id = 1; 65 | ``` 66 | 67 | ## 4. DELETE Statement 68 | 69 | Removes rows from a table. 70 | 71 | **Syntax**: 72 | ```sql 73 | DELETE FROM table_name 74 | WHERE condition; 75 | ``` 76 | 77 | **Example**: 78 | ```sql 79 | DELETE FROM employees 80 | WHERE employee_id = 1; 81 | ``` 82 | 83 | ## 5. JOIN Clauses 84 | 85 | Combines rows from two or more tables based on related columns. 86 | 87 | **Example**: 88 | ```sql 89 | SELECT e.first_name, d.department_name 90 | FROM employees e JOIN departments d 91 | ON e.department_id = d.department_id; 92 | ``` 93 | 94 | ## 6. GROUP BY Clause 95 | 96 | Groups rows that have the same values in specified columns into summary rows. 97 | 98 | **Syntax**: 99 | ```sql 100 | SELECT column1, aggregate_function(column2) 101 | FROM table_name 102 | GROUP BY column1; 103 | ``` 104 | 105 | **Example**: 106 | ```sql 107 | SELECT department_id, COUNT(employee_id) 108 | FROM employees 109 | GROUP BY department_id; 110 | ``` 111 | 112 | ## 7. HAVING Clause 113 | 114 | Used with the GROUP BY clause to filter groups based on a condition (aggregate function). 115 | 116 | **Syntax**: 117 | ```sql 118 | SELECT column1, aggregate_function(column2) 119 | FROM table_name 120 | GROUP BY column1 121 | HAVING condition; 122 | ``` 123 | 124 | **Example**: 125 | ```sql 126 | SELECT department_id, COUNT(employee_id) 127 | FROM employees 128 | GROUP BY department_id 129 | HAVING COUNT(employee_id) > 5; 130 | ``` 131 | 132 | ## 8. ORDER BY Clause 133 | 134 | Sorts the result set in ascending or descending order. 135 | 136 | **Syntax**: 137 | ```sql 138 | SELECT column1, column2 139 | FROM table_name 140 | ORDER BY column1 ASC|DESC; 141 | ``` 142 | 143 | **Example**: 144 | ```sql 145 | SELECT first_name, last_name 146 | FROM employees 147 | ORDER BY first_name ASC; 148 | ``` 149 | 150 | -------------------------------------------------------------------------------- /Important Notes/Chapter 5/Data Anomalies.md: -------------------------------------------------------------------------------- 1 | ## Data Anomalies 2 | - Unable to perform certain data maintenance due to errors in database design 3 | ## Tip to Answer Anomalies 4 | ### Insertion anomaly 5 | - Occurs when insert a new data 6 | - Mention any data except PK 7 | 8 | ### Modification anomaly 9 | - Occurs when modify the data 10 | - Find the Duplicate Data 11 | 12 | ### Deletion anomaly 13 | - Occurs when delete the data 14 | - Find the row that only appear one time 15 | 16 | ## Way to Answer Anomalies 17 | Insertion Anomaly 18 | - Unable to add new …… record unless …… 19 | 20 | Modification Anomaly 21 | - If the ……. is changed to ……, multiple row changes must be done on this value to ensure uniformity. Otherwise, it will cause data inconsistency. 22 | 23 | Deletion Anomaly 24 | - If …. ….. from ……., the record should be removed from the table. As a result, the data about …… will be lost. 25 | -------------------------------------------------------------------------------- /Important Notes/Chapter 5/HowToIdentifyRepeatingGroupIn1NF.md: -------------------------------------------------------------------------------- 1 | # How To Identify Repeating Group in 1NF for normalisation ❓ 2 | > [!IMPORTANT] 3 | > 💥We can actually observe the repeating group from the structure of the table💥 4 | 5 | ## 1st type of Table Structure 6 | ![image](https://github.com/user-attachments/assets/f72d0df9-bf31-4120-b283-7f3d2fcf6b42) 7 | > [!NOTE] 8 | > When looking at rows of data from left to right, if a main row has smaller rows nested within it, we treat the starting column of those nested rows as a repeating group. This repeating group's first column acts as a second identifier (or second primary key) in 1NF. 9 | 10 | ### Example 11 | ![image](https://github.com/user-attachments/assets/3a514099-5e5c-417c-a442-8da5fc4b21d5) 12 | 13 | 14 | 15 | ## 2nd type of Table Structure 16 | ![image](https://github.com/user-attachments/assets/1fd7a057-a25f-4164-b4dc-fd80d4f9c094) 17 | > [!NOTE] 18 | > Reading data from left to right, within the same main identifier, any change in column data consider a repeating group. This repeating group's first column acts as a second identifier (or second primary key) in 1NF. 19 | 20 | ### Example 21 | ![image](https://github.com/user-attachments/assets/41042019-ed74-419a-be77-288f7842d3b2) 22 | -------------------------------------------------------------------------------- /Important Notes/Chapter 5/Normalisation.md: -------------------------------------------------------------------------------- 1 | ## Normalisation 2 | 3 | ### 1NF 4 | - Identify repeating Group 5 | - One table with 2 primary keys 6 | - Special case happens if we have date in the table then 3 primary keys in 1NF 7 | 8 | ### 2NF 9 | > [!IMPORTANT] 10 | > ❗ ❗ MUST have an associative entity❗❗ 11 | - One table with one primary key 12 | - One table with one primary key 13 | - One table with a composite key (associative entity) (PK and FK together) – Special case happens if there is any date in the associative entity we need to assign as the primary key. 14 | 15 | ### 3NF 16 | - Further separate the table from 2NF 17 | - Check for any table that contains an ID which is not the primary key, which means you need to move it to another table. 18 | - Remember to assign the FK to the existing table (from where you remove the column) 19 | -------------------------------------------------------------------------------- /Important Notes/Chapter 6/setOperator.md: -------------------------------------------------------------------------------- 1 | # Set Operator 2 | ![image](https://github.com/user-attachments/assets/b7875c92-8db6-4c55-b70a-d0b29d5ac5b5) 3 | 4 | ## Set Operator Question Example 5 | ![image](https://github.com/user-attachments/assets/8f567b52-0931-435d-8588-9a796035695b) 6 | 7 | ![image](https://github.com/user-attachments/assets/333dcca3-2a7d-4121-a08b-87a0e6eb3e17) 8 | 9 | ``` 10 | SELECT * FROM SetLunchA 11 | INTERSECT 12 | SELECT * FROM SetLunchB; 13 | ``` 14 | ![image](https://github.com/user-attachments/assets/005abdd8-d1f1-45ef-a599-c3b8a918c58b) 15 | 16 | ``` 17 | SELECT * FROM SetLunchA 18 | UNION 19 | SELECT * FROM SetLunchB; 20 | ``` 21 | 22 | ![image](https://github.com/user-attachments/assets/0981eebd-9fe6-466c-bf3b-855bd64e8b05) 23 | 24 | ``` 25 | SELECT * FROM SetLunchB 26 | MINUS 27 | SELECT * FROM SetLunchA; 28 | ``` 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Important Notes/Chapter 7/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joan0018/AACS3013-202409/80b20b196e2d8729e67006d75dad702dfd8eda2d/Important Notes/Chapter 7/readme.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
    2 | 3 | logo 4 |

    🔥 Database Development and Applications 🔥

    5 | 6 |

    7 | Welcome to the GitHub Repo for AACS3013 Database Development and Applications. 💯 8 |

    9 | 10 |

    This repository is designed to help students focus on important topics, spot key questions for midterm and final exams, and enhance their skills in answering questions effectively. Whether you're revising or just starting your preparation, this guide is your companion to succeed! 11 |

    12 | 13 | ## 📖 What’s Included 14 |

    15 | Important Notes 16 | · 17 | Exercise 18 | · 19 | Answering Strategies 20 |

    21 |
    22 | 23 |
    24 | --------------------------------------------------------------------------------