Introduction to Database Management System - Formula Sheet
Database Structural and Syntax Formulas
While relational database management is heavily conceptual, several syntax templates and mathematical relationships govern database interactions, key properties, and data integrity.
1. Relational Model Cardinality Formula
The relation mappings (M to N) between entity sets are mathematically defined as:
- One-to-One (1:1): 0 or 1 instance of Entity A is associated with 0 or 1 instance of Entity B, and vice versa.
- One-to-Many (1:N): For 1 instance of Entity A, there exist 0, 1, or many instances of Entity B, but for 1 instance of B, there exists at most 1 instance of A.
- Many-to-Many (M:N): Multiple instances of Entity A map to multiple instances of Entity B, and vice versa.
2. SQL Command Templates (Syntax Formulas)
These structured query templates act as mathematical functions to define and manipulate data sets:
- Database Creation Function:
CREATE DATABASE database_name;
Wheredatabase_namerepresents the unique identifier of the target database space. - Record Insertion Function:
INSERT INTO table_name (col_1, col_2) VALUES (val_1, val_2);
Wheretable_nameis the relation,colrepresents attributes, andvalrepresents attribute values. - Aggregate Grouping Formula:
SELECT grouping_column, SUM(aggregate_column) FROM table_name GROUP BY grouping_column;
WhereSUMis the aggregate addition function over the grouped attribute elements.
3. Credit Card Number Structure Parity Formula
The 16-digit structure printed on payment cards follows a strict partitioning formula for validation:
- Digit 1: Major Industry Identifier (MII) code.
- Digits 1 to 6: Issuer Identification Number (IIN) / Bank Identification Number (BIN).
- Digits 7 to 15: Individual customer account number.
- Digit 16: Check digit (calculated via Luhn's modulo 10 algorithm for error detection).
More for this chapter
Book Back Questions10 textbook MCQs · solved
Additional MCQs15 extra MCQs · solved
Practice TestInteractive · instant score
Book Back TestTest yourself on the textbook set
Additional MCQ TestTest yourself on the extra set
Study NotesConcepts & methods
More chapters in Computer Applications
View all
1 Multimedia
2 An Introduction to Adobe PageMaker
4 PHP: Hypertext Preprocessor
5 Functions and Arrays in PHP
6 Conditional Statements in PHP
7 Loops in PHP
8 Forms and Files
9 Connecting PHP and MYSQL
10 Introduction to Computer Networks
11 Network Examples and Protocols
12 Domain Name System (DNS)
13 Network Cabling
14 Open Source Concepts
15 E-Commerce
16 Electronic Payment Systems
17 E-Commerce Security Systems
18 Electronic Data Interchange- EDI