Database Normalization: Functional Dependencies and Normal Forms
1. Trivial vs Non-Trivial Dependency
These types describe the basic mathematical relationship between the sets of attributes.
- Trivial Functional Dependency: Occurs when the dependent (RHS) is a subset of the determinant (LHS). It is “trivial” because it doesn’t provide new information.
- Logic: X → Y is trivial if Y ⊆ X.
- Example: {Student_ID, Name} → {Name}.
- Non-Trivial Functional Dependency: Occurs when the dependent is not a subset of the determinant.
- Logic: X → Y is non-trivial if Y ⊄ X.
- Example:
C Programming: Arrays, Functions, and String Handling
One-Dimensional Arrays
A one-dimensional array is a linear collection of elements of the same data type, stored in contiguous memory locations.
1. Declaration
Declaring an array tells the compiler its name, data type, and size.
data_type array_name[size];- Example:
int scores[5];// Declares an array named scores that can hold 5 integers.
2. Initialization
You can initialize an array at the time of declaration or assign values later.
| Method | Example | Description |
|---|---|---|
| Declaration with Size | int marks[3] = {90, 85, 95} |
Java Programming: Exceptions, Threads, and Networking
Java Exceptions: Checked vs Unchecked
Differentiating Exception Types in Java
Exceptions in Java are runtime errors that disrupt the normal flow of a program. They are classified into checked and unchecked exceptions.
Checked Exceptions are verified at compile time. The programmer must either handle them using try-catch blocks or declare them using the throws keyword. These exceptions usually occur due to external factors such as file handling, database access, or network issues. Examples include IOException,
PL/SQL Quiz Answers and Corrections
Module 3 Quiz Answers
Below are the corrected answers and statements from the quiz:
- Structured Query Language (SQL) is considered a procedural language. False
- PL/SQL fully supports SQL data types. True
- The term anonymous blocks refers to blocks of code that are not stored for reuse and do not exist after being executed. True
- The
BEGINsection of a PL/SQL block contains code that creates variables, cursors, and types. False (This belongs in theDECLAREsection.) - Assignment statements are used to put or
Python File I/O, Strings, Control Flow and Data Structures
Python File I/O, Strings, Control Flow and Data Structures
File Input Examples
infile.read(1)
'T'
>>>>
infile.read(5)
'he 3 '
>>>>
infile.readline()
'lines in this file end with the new line
character.\n'
>>>>
infile.read()
'\nThere is a blank line above this line.\n'
>>>>
infile.close()File Output Examples
outfile = open('test.txt', 'w')
>>>>
outfile.write('T')
1
>>>>
outfile.write('his is the first line.')
22
>>>> Read More
React useEffect Patterns for Reliable Side Effects
🧠 useEffect Cheat Sheet (Beginner → Confident)
1️⃣ What is useEffect? (Plain English)
useEffect lets you run side effects in a React component.
👉 Side effects = things that are not UI rendering.
- Fetching data
- Calling APIs
- Using
localStorage - Timers (
setTimeout,setInterval) - Event listeners
- Updating the document title
Rule of thumb:
If it touches the outside world, it belongs inuseEffect.
2️⃣ Basic Syntax (Memorize This)
useEffect(() => {
// side effect code
}, [dependencies]);
📌 Two parts:
Read More