TaleemBay
Study
UniversitiesScholarshipsFeesDates
TaleemBay

Empowering students with Next-Gen tools for a brighter future. Your one-stop destination for education in Pakistan.

Quick Links

  • Universities
  • Study Center
  • Past Papers
  • Date Sheets
  • Results

Support

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service
  • Advertise

Contact Us

  • Arfa Software Technology Park,
    Ferozepur Road, Lahore
  • +92 300 1234567
  • hello@taleembay.com

© 2026 TaleemBay. All rights reserved.

Designed with ❤️ for Pakistan

Home
Unis
Study

Study Center

Overview
9th Class10th Class11th Class12th Class

Resources

Past PapersDate Sheets

Need Notes?

AI-powered search for instant answers.

Chapter 2
computer-science • intermediate 12th

Chapter 2: Basic Concepts and Terminologies of Databases

Comprehensive notes for Chapter 2 Basic Concepts and Terminologies of Databases. Covers Data Elements, Relations, Keys (Primary, Foreign, etc.), Users, and Views.

Data Elements

Field: A unit of data consisting of one or more characters (e.g., Name).
Record: Collection of related fields (e.g., Student Record).
File: Collection of related records (e.g., Student File).

Field Types:

  • Fixed Length: Predefined number of bytes. Data cannot exceed length. Wastes space if data is short.
  • Variable Length: Occupies space according to data entered. No extra blank spaces.

Relations (Tables)

Definition: A two-dimensional array containing data about an entity. Rows (Tuples) represent records, Columns (Attributes) represent fields.

Properties:

  • No Duplicate Rows: Every row must be unique (ensured by Primary Key).
  • Order Insignificant: Row and Column order does not matter.
  • Atomic Values: Intersection of Row/Column must contain atomic (indivisible) value.

Keys

Key: An attribute or set of attributes that uniquely identifies a tuple.

  • Primary Key: Unique identifier for a row. Cannot be NULL. (e.g., RegNo).
  • Composite Key: Primary key consisting of two or more attributes (e.g., RollNo + Subject).
  • Candidate Key: Any attribute that can be selected as Primary Key (e.g., RegNo, RollNo).
  • Alternate Key: Candidate keys not selected as Primary Key.
  • Foreign Key: Attribute in a child table that matches Primary Key in parent table. Enforces referential integrity.
  • Secondary Key: Attribute used for retrieval (non-unique, e.g., City).
  • Sort/Control Key: Attribute used to physically sequence stored data.

Database Views

Definition: A virtual table derived from one or more base tables. It does not exist physically but is created dynamically.

Purpose:

  • Security: Restrict access to specific data (e.g., hiding Salary).
  • Simplicity: Simplify complex queries for End Users.
  • Independence: Isolate application from changes in base table structure.

CREATE VIEW Student_View AS
SELECT StudNo, StudName
FROM Student
WHERE StudGender = 'M';

Database Users

End User: Person who interacts with the database application. Does not need technical knowledge.

Data Administrator (DA): Responsible for defining data standards, policies, and procedures. Manages data definitions and dictionary.

Database Administrator (DBA): Responsible for technical implementation, performance, security, backup, and recovery of the database system. Tasks include:

  • Software Installation
  • Monitoring Performance
  • Assigning Permissions
  • Executing Backup/Recovery

Download PDFPDF