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

Database

Database systems organize large volumes of data into logically related tables to facilitate efficient data storage, retrieval, and analysis. Key aspects include metadata that describes the data structure and relationships, normalization to reduce redundancy and inconsistencies, and SQL queries to manipulate and join data across multiple tables. Databases are critical applications used across many domains to power systems like student records, inventory management, and financial transactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Database

Database systems organize large volumes of data into logically related tables to facilitate efficient data storage, retrieval, and analysis. Key aspects include metadata that describes the data structure and relationships, normalization to reduce redundancy and inconsistencies, and SQL queries to manipulate and join data across multiple tables. Databases are critical applications used across many domains to power systems like student records, inventory management, and financial transactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

Database Systems

Database Systems Slide 1


Data
• Data refers to the raw facts & figures concerning:
 PEOPLE
 EVENT
 ORGANISATION
 OBJECT
• The amount of available data in the modern computer world is
literally exploding (3 Vs: Volume, Velocity, Variety)
• The modern data sources/types include multimedia data, sensor’s
data, data on web and so on.

Database Systems Slide 2


Data
• Large volume of facts, difficult to interpret or make decisions based on

Database Systems Slide 3


Data vs Information
• Information is derived from data OR Information is the processed data
• Information may be presented either Textually or Graphically or both

• The representation and amount of information depends upon the


requirements of a user.
• When data is processed and organized into a form needed for its application,
it is called an Information Product (IP).

Database Systems Slide 4


Database
• Database is a shared collection of logically related data,
and a description of this data (metadata), about entities
and the relationships among these entities.
• Metadata: Data that describes properties or
characteristics of other data OR it is “data about data”.
• The description of data is also known as system catalog
or data dictionary.

Database Systems Slide 5


Metadata Example

Data Item Value


Name Type Length Min Max Description

Course Alphanumeric 30 Course ID & Name

Section Integer 1 1 9 Section Number


Semester Alphanumeric 10 1 8 Semester & Year
Name Alphanumeric 30 Student name
ID Integer 9 Student ID
Major Alphanumeric 4 Student Major
GPA Decimal 3 0.0 4.0 Student GPA

Database Systems Slide 6


Cont..

• Relational DBMS
• Represent data as two-dimensional tables called relations or files
• Each table contains data on entity
• Table: grid of columns and rows
• Rows (tuples): Records for different entities
• Fields (columns): Represents attribute for entity
• Key field: Field used to uniquely identify each record
• Primary key: Field in table used for key fields
• Foreign key: Primary key used in second table as look-up field to
identify records from original table

Database Systems Slide 7


Relational Database Tables

A relational database organizes data in the form of two-dimensional tables. Illustrated here are tables for
the entities SUPPLIER and PART showing how they represent each entity and its attributes.
Supplier_Number is a primary key for the SUPPLIER table and a foreign key for the PART table.

Figure 6-4A
Database Systems Slide 8
Relational Database Tables (cont.)

Figure 6-4B
Database Systems Slide 9
Database Operations
• The user of a database system can perform the following
operations using SQL (Structured Query Language):
- Defining structure and types of data (Data Definition
Language: DDL)
- Data manipulation (Insert, Delete, Update, Query etc.)
Data Manipulation Language (DML)

Database Systems Slide 10


Examples of Database Applications
 Databases play a critical role in almost all areas where
computers are used.
 Databases are everywhere …
• Student / Employee’s Information System
• Library System
• Hotel / Airline Reservation System
• Billing System
• Stock / Inventory System
• Payroll System
• Geographical Information Systems (GISs)
• Data Warehouses

Database Systems Slide 11


Record Keeping Techniques
1. Manual Record Keeping.
2. Computerized Record Keeping
a) File Processing System.
b) Database System

Database Systems Slide 12


Manual System - Drawbacks
• High data volume
• Not reliable
• Inefficient
• Duplication of data
• Inconsistency
• A lot of data movement is required

Database Systems Slide 13


File Processing System
• File-based systems were an early attempt to computerize
the manual filing system.
• The manual files were replaced by computer files.
• A person responsible for developing and managing
computerized file processing system was called Data
Processing (DP) specialist.
• In the traditional file processing system, the existing
manual system is automated by focusing on the data
processing needs of the individual departments instead of
treating the organization as whole.
• Each department will have its own set of Private Files
designed to meet the needs of a particular department.

Database Systems Slide 14


Drawbacks of File System
1. Redundancy of Data
2. Inconsistent Data
3. Lack of provision for security
4. Limited recovery from failure

Database Systems Slide 15


Advantages of Database Approach
1. Reduced or Controlled Data Redundancy
2. Improved Data Consistency
3. Data Sharing
4. Data Integrity (Improved Data Quality)
5. Improved Accessibility & Responsiveness
6. Improved Decision Making
7. Data Independence

Database Systems Slide 16


• Normalization
• Streamlining complex groupings of data to minimize redundant
data elements and awkward many-to-many relationships

Database Systems Slide 17


An Unnormalized Relation for Order

An unnormalized relation contains repeating groups. For example, there can be many parts and suppliers
for each order. There is only a one-to-one correspondence between Order_Number and Order_Date.

Figure 6-9
Database Systems Slide 18
Normalized Tables Created from Order

After normalization, the original relation ORDER has been broken down into four smaller relations. The
relation ORDER is left with only two attributes and the relation LINE_ITEM has a combined, or
concatenated, key consisting of Order_Number and Part_Number.

Figure 6-10
Database Systems Slide 19
SQL JOIN
• A JOIN clause is used to combine rows from two or more tables
based on related column between them

Types of joins are stated below

 Inner Join
 Left Join
 Right Join
 Full Outer Join
 Self Join
 Natural Join
 Theta Join

Database Systems Slide 20


INNER JOIN
• The INNER JOIN selects records that have matching values in both
tables

Note: You may use JOIN instead of INNER JOIN.

Database Systems Slide 21


LEFT JOIN in SQL
• The LEFT JOIN returns all records from the left table (table1) and the
matched records from the right table (table2)

Database Systems Slide 22


RIGHT JOIN in SQL
• The RIGHT JOIN returns all records from the right table (table2) and
the matched records from the left table (table1)

Database Systems Slide 23


FULL OUTER JOIN in SQL
• The FULL OUTER JOIN return all records when there is a match in
left (table1) or right (table2)

Database Systems Slide 24

You might also like