An introduction to database architecture, design and development, its relation to Object Oriented Analysis & Design in software, Illustration with examples to database normalization and finally, a basic SQL guide and best practices
This document provides an overview of database basics and concepts for business analysts. It covers topics such as the need for databases, different types of database management systems (DBMS), data storage in tables, common database terminology, database normalization, SQL queries including joins and aggregations, and database design concepts.
These slides cover the following concepts:
~ RDBMS vs DBMS
~ RDBMS structure
~ RDBMS basics for beginners
~ RELATIONAL DATABASE MANAGEMENT SYSTEM
~ DATA, SCHEMA, AND DATABASE
~ WHAT IS RDBMS?
~ FEATURES OF RDBMS
~ RELATIONSHIPS IN DATABASE
~ RULES OF RDBMS
~ ELEMENTS OF RDBMS
~ SQL COMMANDS
~ SQL CONSTRAINTS
~ COMMON SQL CONSTRAINTS
~ DATA DEFINITION LANGUAGE SCRIPT (DDL)
~ DATA MANIPULATION LANGUAGE SCRIPT (DML)
~ DATA CONTROL LANGUAGE SCRIPT (DCL)
~ PRIMARY KEY, FOREIGN KEY
~ EXAMPLE OF PRIMARY AND FOREIGN KEY
~ DBMS VS RDBMS
~ RDBMS NORMALIZATION
~ BENEFITS OF NORMALIZING
~ SQL JOINS
~ INNER JOIN
~ LEFT OUTER JOIN
~ RIGHT OUTER JOIN
~ FULL OUTER JOIN
~ CROSS JOIN
~ SELF JOIN
This document discusses SQL commands for creating tables, adding data, and enforcing integrity constraints. It covers the core SQL commands: DDL for defining schema, DML for manipulating data, DCL for controlling access, DQL for querying data, and TCL for transactions. Specific topics summarized include data types, primary keys, foreign keys, indexes, views, stored procedures, functions and triggers. Integrity constraints like NOT NULL, UNIQUE, CHECK, DEFAULT are explained. The document also covers SQL queries with filtering, sorting, patterns and ranges. Authorization using GRANT and REVOKE commands is briefly covered.
This document provides an overview of relational database management systems (RDBMS). It defines key terms like database, database management system, and data models. It describes the characteristics of a modern DBMS like using real-world entities, normalization to reduce redundancy, and query languages. The document also outlines the components of a database system including users, applications, the DBMS software, and the database itself. It explains common database architectures like single-tier, two-tier, and three-tier designs. Finally, it introduces some historical data models used in database design like the entity-relationship model, relational model, hierarchical model, and network model.
This document discusses the key components of a database system including applications, file systems, data views, query processors, users and administrators, data languages, transaction management, and storage managers. It provides examples of common database applications and describes how data is abstracted at the physical, logical, and view levels. It also explains the roles of DDL, DML, transactions, and storage managers in database design and management.
Distribution transparency and Distributed transactionshraddha mane
Distribution transparency and Distributed transaction.deadlock detection .Distributed transaction and their types and threads and processes and their difference.
Oracle Database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. Oracle Database was started in 1977 as Software Development Laboratories by Larry Ellison and others. Over time, Oracle released several major versions that added new functionality, such as Oracle 12c which was designed for cloud computing. A database server is the key to solving problems of information management by allowing storage, retrieval, and manipulation of data.
This document provides an overview of database management systems and related concepts. It discusses data hierarchy, traditional file processing, the database approach to data management, features and capabilities of database management systems, database schemas, components of database management systems, common data models including hierarchical, network, and relational models, and the process of data normalization.
The document discusses MySQL and SQL concepts including relational databases, database management systems, and the SQL language. It introduces common SQL statements like SELECT, INSERT, UPDATE, and DELETE and how they are used to query and manipulate data. It also covers topics like database design with tables, keys, and relationships between tables.
The document provides an overview of databases and their advantages over traditional file systems. It discusses key database concepts like data hierarchy, entities and attributes, database models, and components. The main points are:
- Databases organize related data centrally for efficient data sharing and management, avoiding data duplication found in file systems.
- Key concepts include data hierarchy, database components, architecture with three logical levels, and entity-attribute modeling.
- Popular database models include hierarchical, network, and relational models, with relational being most common today.
- Database languages like DDL and DML manipulate and query the database, while the data dictionary documents the stored data.
This presentation discusses the following topics:
Object Oriented Databases
Object Oriented Data Model(OODM)
Characteristics of Object oriented database
Object, Attributes and Identity
Object oriented methodologies
Benefit of object orientation in programming language
Object oriented model vs Entity Relationship model
Advantages of OODB over RDBMS
The document discusses database management systems and their advantages over traditional file systems. It covers key concepts such as:
1) Databases organize data into tables with rows and columns to allow for easier querying and manipulation of data compared to file systems which store data in unstructured files.
2) Database management systems employ concepts like normalization, transactions, concurrency and security to maintain data integrity and consistency when multiple users are accessing the data simultaneously.
3) The logical design of a database is represented by its schema, while a database instance refers to the current state of the data stored in the database tables at a given time.
Elastic Block Storage (EBS) is a storage service from AWS that provides persistent block storage volumes for use with EC2 instances. EBS volumes behave like physical hard drives attached to instances and can be mounted, formatted, etc. EBS volumes are available in different types (SSD, magnetic) with varying performance characteristics and pricing. EBS snapshots provide point-in-time copies of volumes stored in S3 for backup/disaster recovery. An upcoming related service is Elastic File System (EFS) which provides a common file system accessible to multiple EC2 instances.
This document provides an overview of database management systems (DBMS). It defines a DBMS as computer software designed to manage databases based on various data models. It describes the key components and functions of a typical DBMS, including data modeling languages, data structures, query languages, transaction management, security, and maintenance of data integrity. The document also outlines the benefits of using a DBMS, such as improved data management, reduced redundancy, enhanced security, and easier modification of information systems. Examples of popular DBMS software are also listed.
This document discusses key concepts related to databases and information systems. It defines data, information, and databases. It explains that a database management system (DBMS) stores data in a structured way to facilitate retrieval and use. An information system combines a DBMS with tools for querying, analyzing, and presenting the data. The document outlines advantages of database systems like concurrent access, structured storage, separation of data and applications, and data integrity and persistence. Examples of database applications discussed include banking transactions, timetables, and library catalogs.
The document discusses physical database design, including:
- Designing fields by choosing data types, coding techniques, and controlling data integrity.
- Denormalizing relations through joining tables or data replication to improve processing speed at the cost of storage space and integrity.
- Organizing physical files through sequential, indexed, or hashed arrangements and using indexes to efficiently locate records.
- Database architectures including legacy systems, current technologies, and data warehouses.
This document discusses XML databases and effective search engines. It describes how XML is a self-describing format that can store data in a portable way. While XML lacks features of traditional databases like efficient storage and indexing, XML databases address these issues. The document outlines how XML databases can store, search, retrieve and display XML documents and compares them to relational databases. It also provides examples of technologies and modules that can be used to parse, insert, query and synchronize XML documents with databases.
MongoDB is a cross-platform document-oriented database system that is classified as a NoSQL database. It avoids the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas. MongoDB was first developed in 2007 and is now the most popular NoSQL database system. It uses collections rather than tables and documents rather than rows. Documents can contain nested objects and arrays. MongoDB supports querying, indexing, and more. Queries use JSON-like documents and operators to specify search conditions. Documents can be inserted, updated, and deleted using various update operators.
This document discusses Relational Database Management Systems (RDBMS). It provides an overview of early database systems like hierarchical and network models. It then describes the key concepts of RDBMS including relations, attributes, and using tables, rows, and columns. RDBMS uses Structured Query Language (SQL) and has advantages over early systems by allowing data to be spread across multiple tables and accessed simultaneously by users.
This document introduces key concepts related to database systems including:
1. Data is raw facts that are organized into meaningful information by computers. Data integrity ensures data is correct to create accurate information.
2. A database contains files with records made of fields that store characters of data. Common data types include text, numbers, dates. Validation checks help ensure data integrity.
3. A database management system (DBMS) allows users to add, retrieve, and manage shared data across programs more easily compared to file systems. It addresses issues like data redundancy, inconsistent data, and concurrent access.
The document discusses topics related to database management systems including database users, architecture, data definition language, data manipulation language, entity relationship modeling, and SQL commands. It provides examples of using SQL commands like CREATE TABLE, INSERT, UPDATE, DELETE, SELECT, ALTER TABLE, DROP TABLE, RENAME, COMMIT, ROLLBACK, GRANT and REVOKE. It also explains concepts of entity sets, relationship sets, attributes, and ER diagram notations and provides examples of ER diagrams.
A distributed database is a collection of logically interrelated databases distributed over a computer network. A distributed database management system (DDBMS) manages the distributed database and makes the distribution transparent to users. There are two main types of DDBMS - homogeneous and heterogeneous. Key characteristics of distributed databases include replication of fragments, shared logically related data across sites, and each site being controlled by a DBMS. Challenges include complex management, security, and increased storage requirements due to data replication.
This document provides an overview of the SKILLWISE-CICS Application Programming course. It includes pre-requisites for the course, references and books used, the course schedule, and concepts about CICS including components, control programs and tables, transactions, start-up, sign on/off processes, program structure and execution, basic CICS commands, exception handling, and sample programs. It also describes how to define resources in CICS control tables using CEDA and CEMT commands.
This document provides an introduction to big data and NoSQL databases. It begins with an introduction of the presenter. It then discusses how the era of big data came to be due to limitations of traditional relational databases and scaling approaches. The document introduces different NoSQL data models including document, key-value, graph and column-oriented databases. It provides examples of NoSQL databases that use each data model. The document discusses how NoSQL databases are better suited than relational databases for big data problems and provides a real-world example of Twitter's use of FlockDB. It concludes by discussing approaches for working with big data using MapReduce and provides examples of using MongoDB and Azure for big data.
This document discusses thrashing and allocation of frames in an operating system. It defines thrashing as when a processor spends most of its time swapping pieces of processes in and out rather than executing user instructions. This leads to low CPU utilization. It also discusses how to allocate a minimum number of frames to each process to prevent thrashing and ensure efficient paging.
Data Warehouse : Dimensional Model: Snowflake Schema In the snowflake schema, dimension are present in a normalized from in multiple related tables.
The snowflake structure materialized when the dimensions of a star schema are detailed and highly structured, having several levels of relationship, and the child tables have multiple parent table.
- Physical storage media can be classified by access speed, cost per unit of data, and reliability. This includes cache, main memory, flash memory, magnetic disks, optical disks, and magnetic tapes.
- Faster but more expensive media like cache and main memory are primary storage, while magnetic disks represent secondary storage. Tapes and optical disks provide tertiary, offline storage.
- Volatility also differs, with volatile storage like main memory losing data on power loss, while nonvolatile media like disks and flash retain data. The database typically resides on nonvolatile secondary storage for long-term access.
This document provides an overview of SQL programming. It covers the history of SQL and SQL Server, SQL fundamentals including database design principles like normalization, and key SQL statements like SELECT, JOIN, UNION and stored procedures. It also discusses database objects, transactions, and SQL Server architecture concepts like connections. The document is intended as a training guide, walking through concepts and providing examples to explain SQL programming techniques.
The document provides explanations of various SQL concepts including cross join, order by, distinct, union and union all, truncate and delete, compute clause, data warehousing, data marts, fact and dimension tables, snowflake schema, ETL processing, BCP, DTS, multidimensional analysis, and bulk insert. It also discusses the three primary ways of storing information in OLAP: MOLAP, ROLAP, and HOLAP.
The document discusses MySQL and SQL concepts including relational databases, database management systems, and the SQL language. It introduces common SQL statements like SELECT, INSERT, UPDATE, and DELETE and how they are used to query and manipulate data. It also covers topics like database design with tables, keys, and relationships between tables.
The document provides an overview of databases and their advantages over traditional file systems. It discusses key database concepts like data hierarchy, entities and attributes, database models, and components. The main points are:
- Databases organize related data centrally for efficient data sharing and management, avoiding data duplication found in file systems.
- Key concepts include data hierarchy, database components, architecture with three logical levels, and entity-attribute modeling.
- Popular database models include hierarchical, network, and relational models, with relational being most common today.
- Database languages like DDL and DML manipulate and query the database, while the data dictionary documents the stored data.
This presentation discusses the following topics:
Object Oriented Databases
Object Oriented Data Model(OODM)
Characteristics of Object oriented database
Object, Attributes and Identity
Object oriented methodologies
Benefit of object orientation in programming language
Object oriented model vs Entity Relationship model
Advantages of OODB over RDBMS
The document discusses database management systems and their advantages over traditional file systems. It covers key concepts such as:
1) Databases organize data into tables with rows and columns to allow for easier querying and manipulation of data compared to file systems which store data in unstructured files.
2) Database management systems employ concepts like normalization, transactions, concurrency and security to maintain data integrity and consistency when multiple users are accessing the data simultaneously.
3) The logical design of a database is represented by its schema, while a database instance refers to the current state of the data stored in the database tables at a given time.
Elastic Block Storage (EBS) is a storage service from AWS that provides persistent block storage volumes for use with EC2 instances. EBS volumes behave like physical hard drives attached to instances and can be mounted, formatted, etc. EBS volumes are available in different types (SSD, magnetic) with varying performance characteristics and pricing. EBS snapshots provide point-in-time copies of volumes stored in S3 for backup/disaster recovery. An upcoming related service is Elastic File System (EFS) which provides a common file system accessible to multiple EC2 instances.
This document provides an overview of database management systems (DBMS). It defines a DBMS as computer software designed to manage databases based on various data models. It describes the key components and functions of a typical DBMS, including data modeling languages, data structures, query languages, transaction management, security, and maintenance of data integrity. The document also outlines the benefits of using a DBMS, such as improved data management, reduced redundancy, enhanced security, and easier modification of information systems. Examples of popular DBMS software are also listed.
This document discusses key concepts related to databases and information systems. It defines data, information, and databases. It explains that a database management system (DBMS) stores data in a structured way to facilitate retrieval and use. An information system combines a DBMS with tools for querying, analyzing, and presenting the data. The document outlines advantages of database systems like concurrent access, structured storage, separation of data and applications, and data integrity and persistence. Examples of database applications discussed include banking transactions, timetables, and library catalogs.
The document discusses physical database design, including:
- Designing fields by choosing data types, coding techniques, and controlling data integrity.
- Denormalizing relations through joining tables or data replication to improve processing speed at the cost of storage space and integrity.
- Organizing physical files through sequential, indexed, or hashed arrangements and using indexes to efficiently locate records.
- Database architectures including legacy systems, current technologies, and data warehouses.
This document discusses XML databases and effective search engines. It describes how XML is a self-describing format that can store data in a portable way. While XML lacks features of traditional databases like efficient storage and indexing, XML databases address these issues. The document outlines how XML databases can store, search, retrieve and display XML documents and compares them to relational databases. It also provides examples of technologies and modules that can be used to parse, insert, query and synchronize XML documents with databases.
MongoDB is a cross-platform document-oriented database system that is classified as a NoSQL database. It avoids the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas. MongoDB was first developed in 2007 and is now the most popular NoSQL database system. It uses collections rather than tables and documents rather than rows. Documents can contain nested objects and arrays. MongoDB supports querying, indexing, and more. Queries use JSON-like documents and operators to specify search conditions. Documents can be inserted, updated, and deleted using various update operators.
This document discusses Relational Database Management Systems (RDBMS). It provides an overview of early database systems like hierarchical and network models. It then describes the key concepts of RDBMS including relations, attributes, and using tables, rows, and columns. RDBMS uses Structured Query Language (SQL) and has advantages over early systems by allowing data to be spread across multiple tables and accessed simultaneously by users.
This document introduces key concepts related to database systems including:
1. Data is raw facts that are organized into meaningful information by computers. Data integrity ensures data is correct to create accurate information.
2. A database contains files with records made of fields that store characters of data. Common data types include text, numbers, dates. Validation checks help ensure data integrity.
3. A database management system (DBMS) allows users to add, retrieve, and manage shared data across programs more easily compared to file systems. It addresses issues like data redundancy, inconsistent data, and concurrent access.
The document discusses topics related to database management systems including database users, architecture, data definition language, data manipulation language, entity relationship modeling, and SQL commands. It provides examples of using SQL commands like CREATE TABLE, INSERT, UPDATE, DELETE, SELECT, ALTER TABLE, DROP TABLE, RENAME, COMMIT, ROLLBACK, GRANT and REVOKE. It also explains concepts of entity sets, relationship sets, attributes, and ER diagram notations and provides examples of ER diagrams.
A distributed database is a collection of logically interrelated databases distributed over a computer network. A distributed database management system (DDBMS) manages the distributed database and makes the distribution transparent to users. There are two main types of DDBMS - homogeneous and heterogeneous. Key characteristics of distributed databases include replication of fragments, shared logically related data across sites, and each site being controlled by a DBMS. Challenges include complex management, security, and increased storage requirements due to data replication.
This document provides an overview of the SKILLWISE-CICS Application Programming course. It includes pre-requisites for the course, references and books used, the course schedule, and concepts about CICS including components, control programs and tables, transactions, start-up, sign on/off processes, program structure and execution, basic CICS commands, exception handling, and sample programs. It also describes how to define resources in CICS control tables using CEDA and CEMT commands.
This document provides an introduction to big data and NoSQL databases. It begins with an introduction of the presenter. It then discusses how the era of big data came to be due to limitations of traditional relational databases and scaling approaches. The document introduces different NoSQL data models including document, key-value, graph and column-oriented databases. It provides examples of NoSQL databases that use each data model. The document discusses how NoSQL databases are better suited than relational databases for big data problems and provides a real-world example of Twitter's use of FlockDB. It concludes by discussing approaches for working with big data using MapReduce and provides examples of using MongoDB and Azure for big data.
This document discusses thrashing and allocation of frames in an operating system. It defines thrashing as when a processor spends most of its time swapping pieces of processes in and out rather than executing user instructions. This leads to low CPU utilization. It also discusses how to allocate a minimum number of frames to each process to prevent thrashing and ensure efficient paging.
Data Warehouse : Dimensional Model: Snowflake Schema In the snowflake schema, dimension are present in a normalized from in multiple related tables.
The snowflake structure materialized when the dimensions of a star schema are detailed and highly structured, having several levels of relationship, and the child tables have multiple parent table.
- Physical storage media can be classified by access speed, cost per unit of data, and reliability. This includes cache, main memory, flash memory, magnetic disks, optical disks, and magnetic tapes.
- Faster but more expensive media like cache and main memory are primary storage, while magnetic disks represent secondary storage. Tapes and optical disks provide tertiary, offline storage.
- Volatility also differs, with volatile storage like main memory losing data on power loss, while nonvolatile media like disks and flash retain data. The database typically resides on nonvolatile secondary storage for long-term access.
This document provides an overview of SQL programming. It covers the history of SQL and SQL Server, SQL fundamentals including database design principles like normalization, and key SQL statements like SELECT, JOIN, UNION and stored procedures. It also discusses database objects, transactions, and SQL Server architecture concepts like connections. The document is intended as a training guide, walking through concepts and providing examples to explain SQL programming techniques.
The document provides explanations of various SQL concepts including cross join, order by, distinct, union and union all, truncate and delete, compute clause, data warehousing, data marts, fact and dimension tables, snowflake schema, ETL processing, BCP, DTS, multidimensional analysis, and bulk insert. It also discusses the three primary ways of storing information in OLAP: MOLAP, ROLAP, and HOLAP.
It 302 computerized accounting (week 2) - sharifahalish sha
Here are some potential ways to represent relational databases other than using tables and relationships:
- Graph databases: Represent data as nodes, edges, and properties. Nodes represent entities, edges represent relationships between entities. Good for highly connected data.
- Document databases: Store data in flexible, JSON-like documents rather than rigid tables. Good for semi-structured or unstructured data.
- Multidimensional databases (OLAP cubes): Represent data in cubes with dimensions and measures. Good for analytical queries involving aggregation and slicing/dicing of data.
- Network/graph databases: Similar to graph databases but focus more on network properties like paths, connectivity etc. Good for social networks, recommendation systems.
-
The physical data model includes tables, columns, relationships, and database properties to implement the logical data model in a database. It considers performance, indexing, storage, and denormalization. The transformation from logical to physical model imposes database rules, referential integrity, and other aspects. DDL scripts are used to create the required database objects like tables, columns, constraints, indexes, sequences, and triggers.
The physical data model includes tables, columns, relationships, and database properties to implement the logical data model in a database. It considers performance, indexing, storage, and denormalization. The transformation from logical to physical model imposes database rules, referential integrity, and other aspects. DDL scripts are used to create the required database objects like tables, constraints, indexes, sequences, and triggers.
Data Warehouse Physical Design,Physical Data Model, Tablespaces, Integrity Constraints, ETL (Extract-Transform-Load) ,OLAP Server Architectures, MOLAP vs. ROLAP, Distributed Data Warehouse ,
- Normalization is the process of structuring a database to minimize duplication and define relationships clearly. There are five normal forms that provide guidelines for optimal database design.
- Normalization specifies design criteria to guide the database structure and identify problems. It provides rules to reorganize data in a consistent, clean fashion.
- Denormalization intentionally introduces some data duplication to improve performance of complex queries by reducing the number of table joins required. It is typically done on read-only systems like data warehouses.
RDBMS are database management systems that store data in tables and define relationships between tables. Normalization is the process of organizing data to minimize redundancy by isolating data into tables and defining relationships between tables. Different normalization forms like 1NF, 2NF, 3NF, BCNF etc. are used to organize data with increasing levels of normalization. Stored procedures, triggers, views, indexes, cursors and other objects are used to manage, secure and optimize data and queries in a relational database.
RDBMS are database management systems that store data in tables and define relationships between tables. Normalization is the process of organizing data to minimize redundancy by isolating data into tables and defining relationships between tables. Different normalization forms like 1NF, 2NF, 3NF, BCNF etc. are used to organize data with increasing levels of normalization. Stored procedures, triggers, views, indexes, cursors and other objects are used to manage, query and maintain the database.
RDBMS are database management systems that store data in tables and define relationships between tables. Normalization is the process of organizing data to minimize redundancy by isolating data into tables and defining relationships between tables. Different normalization forms like 1NF, 2NF, 3NF, BCNF etc. are used to organize data with increasing levels of normalization. Stored procedures, triggers, views, indexes, cursors and other database objects are used to manage, secure and optimize data and queries in a database.
RDBMS are database management systems that store data in tables and define relationships between tables. Normalization is the process of organizing data to minimize redundancy by isolating data into tables and defining relationships between tables. Different normalization forms like 1NF, 2NF, 3NF, BCNF etc. are used to organize data with increasing isolation of data anomalies. Stored procedures, triggers, views, indexes, cursors and other objects are used to manage, secure and optimize data and queries in a relational database.
RDBMS are database management systems that store data in tables and define relationships between tables. Normalization is the process of organizing data to minimize redundancy by isolating data into tables and defining relationships between tables. Different normalization forms like 1NF, 2NF, 3NF, BCNF etc. are used to organize data with increasing levels of normalization. Stored procedures, triggers, views, indexes, cursors and other objects are used to manage, secure and optimize data and queries in a database.
The document discusses database normalization and provides examples to illustrate the concepts of first, second, and third normal forms. It explains that normalization is the process of evaluating and correcting database tables to minimize data redundancy and anomalies. The key steps in normalization include identifying attributes, dependencies between attributes, and creating normalized tables based on those dependencies. An example database for a college will be used to demonstrate converting tables into first, second, and third normal form. Additionally, an example will show when denormalization of a table may be acceptable.
The document provides an overview of using SQL to query relational databases, logical modeling to create relational databases, and querying multitable databases. It also discusses using XML for data transfer.
Specifically, it covers: using SQL to query single and multitable databases; logical modeling using entity-relationship diagrams; converting entity-relationship diagrams into relational data models; and performing JOIN operations to query relationships across multiple tables.
This document discusses the basics of database management systems (DBMS). It begins by explaining the data storage hierarchy from the bit level up to the database level. It then covers different database models including hierarchical, network, relational, and object-oriented. Key components of a DBMS like DDL, DML, query language, and report generators are defined. Commercial DBMS examples are provided. The document concludes with an overview of creating and using a database, including defining the structure, entering data, and searching for information.
Data warehousing interview_questionsandanswersSourav Singh
A data warehouse is a repository of integrated data from multiple sources that is organized for analysis. It contains historical data to support decision making. There are four fundamental stages of data warehousing: offline operational databases, offline data warehouse, real-time data warehouse, and integrated data warehouse. Dimensional modeling involves facts tables containing measurements and dimension tables containing context for the measurements. (191 words)
Introduction to database with ms access(DBMS)07HetviBhagat
A database is an organized collection of structured data stored electronically in a computer system. The document discusses database components including hardware, software, data, procedures, and access languages. It provides examples of database systems like MS Access and how it can be used to create tables, enter and query data, and perform other operations. Key database terms are defined such as entities, attributes, relationships, and database administrators' roles and responsibilities. Advantages and disadvantages of database management systems are also outlined.
AI Competitor Analysis: How to Monitor and Outperform Your CompetitorsContify
AI competitor analysis helps businesses watch and understand what their competitors are doing. Using smart competitor intelligence tools, you can track their moves, learn from their strategies, and find ways to do better. Stay smart, act fast, and grow your business with the power of AI insights.
For more information please visit here https://www.contify.com/
Just-in-time: Repetitive production system in which processing and movement of materials and goods occur just as they are needed, usually in small batches
JIT is characteristic of lean production systems
JIT operates with very little “fat”
computer organization and assembly language : its about types of programming language along with variable and array description..https://www.nfciet.edu.pk/
Telangana State, India’s newest state that was carved from the erstwhile state of Andhra
Pradesh in 2014 has launched the Water Grid Scheme named as ‘Mission Bhagiratha (MB)’
to seek a permanent and sustainable solution to the drinking water problem in the state. MB is
designed to provide potable drinking water to every household in their premises through
piped water supply (PWS) by 2018. The vision of the project is to ensure safe and sustainable
piped drinking water supply from surface water sources
By James Francis, CEO of Paradigm Asset Management
In the landscape of urban safety innovation, Mt. Vernon is emerging as a compelling case study for neighboring Westchester County cities. The municipality’s recently launched Public Safety Camera Program not only represents a significant advancement in community protection but also offers valuable insights for New Rochelle and White Plains as they consider their own safety infrastructure enhancements.
2. Database Basics
What is a database, DBMS and its types?
What makes a database?
Object-Oriented Design vs. Database Design
Database Normalization
Structured Query Language (SQL)
4. What is a database?
“A database is an organized collection of data. The data is typically
organized to model aspects of reality in a way that supports processes
requiring information”. [Wikipedia.org Definition]
“A database provides for the storing and control of business information,
independent from (but not separate from the processing requirements of)
one or more applications”. [IBM Definition]
“A database is a collection of information that is organized so that it can
easily be accessed, managed, and updated”. [WhatIs.com Definition]
So, What do you think?
5. Database Models, Types and Formats
Flat-file Model (Mainframes)
Hierarchical Model (Tree-Structure, LDAP)
Relational Model (RDBMS)
Object-Oriented Model (Apache Derby DB, H2 and In-memory databases)
Not Only SQL (NoSQL): Semi structured Model, Structure within data
6. What is a RDBMS?
RDBMS: Relational Database Management System
A tool for organizing, storing, retrieving, and communicating groups of
information that have similar characteristics.
Examples are: ORACLE DB, MySQL, MS Access, MS SQL Server, IBM DB2 and
Sybase
8. What makes a database?
Schema
(Owner)
Tables Views Indices Sequences Triggers Constraints Subroutines
9. Table
The primary unit of physical storage for data in a database.
Stores data, so they’re essential building blocks of any database.
Any database consists of one or more tables (at least one)
Contains Rows called Records and Columns called Fields.
Cell - ENTRY
Rows – RECORDS
Columns - FIELDS
ID CustomerName Email City
1 Mahmoud [email protected] Cairo
2 Samy [email protected] Alex
3 Aly [email protected] Aswan
10. View
Views can represent a subset of the data contained in a table. Consequently,
a view can limit the degree of exposure of the underlying tables to the outer
world: a given user may have permission to query the view, while denied
access to the rest of the base table.
Views can join and simplify multiple tables into a single virtual table.
Views can act as aggregated tables, where the database engine aggregates
data (sum, average, etc.) and presents the calculated results as part of the
data.
Views can hide the complexity of data. For example, a view could appear as
Sales2000 or Sales2001, transparently partitioning the actual underlying
table.
Views take very little space to store; the database contains only the
definition of a view, not a copy of all the data that it presents.
It can be read-only or updatable
11. Index
A data structure that improves the speed of data retrieval operations on a
database table at the cost of additional writes and storage space to maintain
the index data structure.
Used to quickly locate data without having to search every row in a database
table every time a database table is accessed.
Can be created using one or more columns of a database table, providing the
basis for both rapid random lookups and efficient access of ordered records.
An index is a copy of select columns of data from a table that can be
searched very efficiently that also includes a low-level disk block address or
direct link to the complete row of data it was copied from.
The Primary Key is merely an index that enforces uniqueness
12. Sequence
The sequence is a feature by some database products which just creates
unique values. It just increments a value and returns it.
The special thing about it is: there is no transaction isolation, so several
transactions can not get the same value, the incremental is also not rolled
back.
Sequence will allow you to populate primary key with a unique, serialized
number.
Without a database sequence, it is very hard to generate unique incrementing
numbers.
Other database products support columns that are automatically initialized
with a incrementing number.
13. Trigger
A procedural code that is automatically executed in response to certain
events on a particular table or view in a database.
The trigger is mostly used for maintaining the integrity of the information on
the database.
For example, in HRMS database when a new record (representing a new
worker) is added to the employees table, new records should also be created
in the tables of the taxes, vacations and salaries.
Can run before or after a database change.
Can run at the cell level, row level, column level, or statement level.
In some implementations, it can call an external program
14. Constraints
It can be a single rule or a set of rules to restrict the data entered in the
table and guarantee its correctness.
If there is any violation between the constraint and the data action, the
action is aborted by the constraint.
Can apply to a single column or the entire table
Can be specified when the table is created or after that
In SQL, we have the following constraints:
NOT NULL - UNIQUE - PRIMARY KEY - FOREIGN KEY - CHECK – DEFAULT
Advantages:
1. Input Validation
2. Data Consistency
3. Intelligent Defaults
15. Subroutines
A sequence of program instructions that perform a specific task, packaged as
a unit and stored in the database.
Can consolidate and centralize logic that was originally implemented in
applications
Sometimes called a stored procedure (SP), function or User Defined Function
(UDF)
Advantages:
1. Simple, no overhead
2. Avoidance of network traffic
3. Encapsulation of business logic
4. Delegation of access-rights
5. Some protection from SQL injection attacks
17. Entity Structure
Customer
• id: int
• name: String
• birthDate: Date
• salary: double
• jobCode: String
CUSTOMER
• C_ID: INTEGER
• C_NAME: VARCHAR(25)
• C_BIRTH_DATE: DATE
• C_SAL: DOUBLE
• C_JOB_CODE: CHAR(3)
CUSTOMER TABLE structure can be represented by a Customer Class
Every COLUMN is mapped to its equivalent class attribute/variable
Data types may vary according to the database vendor / programming
language
18. Entity Data
ID Name Birth Date Salary Job Code
5011 Moneim Emad 03/07/1982 5,000.00 SAR
5012 Kareem Hewady 28/06/1993 3,000.00 OSD
A single, specific occurrence of an entity is an instance.
The selected record/row represents a single record in CUSTOMER table
This is mapped to an instance / object of the Customer class
The entire table data can be mapped to a list of Customer objects
19. Entity Relationship Diagram (ERD)
A relationship is a link that relates two entities that share one or more attributes
An ERD can be mapped to UML Class Diagram
Database relations between tables can be mapped to UML association between classes
CustomerPublisher Book
Author Inventory Order
20. Relationship: Primary Key
ID Name Birth Date Salary Job Code
5011 Moneim Emad 03/07/1982 5,000.00 SAR
5012 Kareem Hewady 28/06/1993 3,000.00 OSD
A primary key is a unique identifier of records in a table.
A primary key values may be generated manually or automatically
A primary key can consist of more than one column (composite key)
21. Relationship: Foreign Key
ID Name Birth Date Salary Job Code
5011 Moneim Emad 03/07/1982 5,000.00 SAR
5012 Kareem Hewady 28/06/1993 3,000.00 OSD
A foreign key is a column reference to the primary key in its original table
In contrast to primary key, foreign key may be repeated in the child table
ID Customer ID Location Delivery Date
1 5011 El Dokky 27/03/2015 11:45 AM
2 5011 Nasr City 28/03/2015 09:30 AM
3 5897 El Zamalek 28/03/2015 02:15 PM
ORDER (Child table)
CUSTOMER (Parent table)
22. Relationship Types
One-to-one
Customer Basic info Customer Additional Info
One-to-many
Customer info Customer Orders Info
Many-to-many
Customer Info Customer Books Interest Books Info
24. Normalization
A set of recommendations to be followed when designing a database that
helps for organizing data elements into tables and optimizing the database.
We will see an example for database normalization in three steps using the
three normal forms
1NF 2NF 3NF
25. Normalization: Case Study (Un-normalized)
SalesOrders
• SalesOrderNo
• Date
• CustomerNo
• CustomerName
• CutomerAddress
• ClerkNo
• ClerkName
• Item1Description
• Item1Quantity
• Item1UnitPrice
• Item2Description
• Item2Quantity
• Item2UnitPrice
• Item3Description
• Item3Quantity
• Item3UnitPrice
• Total
26. Normalization: Into 1NF
Separate repeating groups into new tables.
Start a new table for the repeating data.
The primary key for the repeating group is usually a composite key.
28. Normalization: Into 2NF
Remove partial dependencies.
Start a new table for the partially dependent data and the part of the key it
depends on.
Tables started at this step usually contain descriptions of resources.
29. Normalization: Into 2NF
Functional dependency:
The value of one attribute depends entirely on the value of another.
Partial dependency:
An attribute depends on only part of the primary key. (The primary key must
be a composite key.)
Transitive dependency:
An attribute depends on an attribute other than the primary key.
31. Normalization: Into 2NF – Problems Solved
Duplication of data:
ItemDescription would appear for every order.
Insert anomaly:
To insert an inventory item, you must insert a sales order.
Delete anomaly:
Information about the items stay with sales order records. Delete a sales
order record, delete the item description.
Update anomaly:
To change an item description, you must change all the sales order
records that have the item.
32. Normalization: Into 3NF
Remove transitive dependencies.
Start a new table for the transitively dependent attribute and the attribute it
depends on.
Keep a copy of the key attribute in the original table.
33. Normalization: Into 3NF
• SalesOrderNo
• Date
• CustomerNo
• CustomerName
• CutomerAddress
• ClerkNo
• ClerkName
• Total
SalesOrders
Clerk
• ClerkNo
• ClerkName
Customer
• CustomerNo
• CustomerName
• CustomerAddress
• SalesOrderNo
• Date
• CustomerNo
• ClerkNo
• Total
SalesOrders
34. Normalization: Into 3NF – Problems Solved
Duplication of data:
Customer and Clerk details would appear for every order.
Insert anomaly:
To insert a customer or clerk, you must insert a sales order.
Delete anomaly:
Information about the customers and clerks stay with sales order records.
Delete a sales order record, delete the customer or clerk.
Update anomaly:
To change the details of a customer or clerk, you must change all the sales
order that involve that customer or clerk.
37. SQL
SQL is a standard language for accessing and manipulating databases.
Stands for Structured Query Language.
SQL can execute administrative, structural and data manipulation statements
Administrative:
Set permissions on schemas, tables, procedures and views
Structural:
Create, Drop or Alter tables, procedures and views
Data Manipulation:
Retrieve data from a database
Insert, update or delete records from a database
38. SQL
Although SQL is an ANSI (American National Standards Institute) standard,
there are different versions of the SQL language.
Most of the big database vendors have their own proprietary extensions in
addition to the SQL standard.
However, to be compliant with the ANSI standard, they all support at least the
major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a
similar manner.
SQL is NOT case sensitive: select is the same as SELECT.
As a coding convention, we should write all SQL keywords in upper-case.
Semicolon is the standard way to separate each SQL statement in database
systems that allow more than one SQL statement to be executed in the same
call to the server.
Some database vendors let you choose your statement terminator character.
39. SQL
SELECT - extracts data from a database
UPDATE - updates data in a database
DELETE - deletes data from a database
INSERT INTO - inserts new data into a database
CREATE DATABASE - creates a new database
ALTER DATABASE - modifies a database
CREATE TABLE - creates a new table
ALTER TABLE - modifies a table
DROP TABLE - deletes a table
CREATE INDEX - creates an index (search key)
DROP INDEX - deletes an index
40. SQL Syntax
SELECT col1_name,col2_name FROM table_name;
SELECT * FROM table_name;
The SELECT DISTINCT statement is used to return only distinct (different) values.
SELECT DISTINCT column1_name,column2_name FROM table_name;
The WHERE clause is used to extract only those records that fulfill a specified criterion.
SELECT col1_name,col2_name FROM table_name WHERE boolean_condition;
WHERE CITY=‘Cairo’
WHERE (CUSTOMER_ID=5011 OR CITY<>’Alex’)
WHERE CUSTOMER_ID IN(5011,5378,5834)
WHERE (PRICE>=5000 AND PRICE<10000)
WHERE CUSTOMER_NAME LIKE ’%Moneim%’
WHERE HIRE_DATE BETWEEN 2006-12-31 AND 2004-01-01
41. SQL Syntax
INSERT INTO table_name VALUES (value1,value2,value3,...);
INSERT INTO table_name (col1,col2,col3) VALUES (val1,val2,val3);
UPDATE table_name SET col1=val1,col2=val2 WHERE col5=val5;
DELETE FROM table_name WHERE col3=val5;
The WHERE clause specifies which record or records that should be updated or deleted.
If you omit the WHERE clause, all records will be updated or deleted!
Using Aliases for tables and columns
SELECT CUSTOMER_NAME AS C_NAME FROM CUSTOMER AS C;
SELECT CUSTOMER_NAME C_NAME FROM CUSTOMER C;
42. SQL Syntax
Using NOT & Wildcards
WHERE ID NOT IN (5011,5012); or WHERE PROVIDER NOT LIKE ‘%mobinil%’;
WHERE City LIKE '_erlin'; or WHERE City LIKE 'L_n_on';
City starting with "b", "s", or "p": WHERE City LIKE '[bsp]%'
starting with "a", "b", or "c": WHERE City LIKE '[a-c]%
City NOT starting with "b", "s", or "p":
WHERE City LIKE '[!bsp]%'; or WHERE City NOT LIKE '[bsp]%';
WHERE Price NOT BETWEEN 10 AND 20;
WHERE ProductName BETWEEN 'C' AND 'M'; -- beginning with C,D,…,M
Ordering Data
SELECT col1,col2 FROM table_name ORDER BY col1 ASC|DESC;-- Ascending
ORDER BY col1 ASC|DESC, col2 ASC|DESC;
43. SQL Syntax - JOINs
An SQL JOIN clause is used to combine rows from two or more tables, based on a common
field between them.
The most common type of join is: SQL INNER JOIN (simple join).
INNER JOIN: Returns all rows when there is at least one match in BOTH tables
LEFT JOIN: Return all rows from the left table, and the matched rows from the right table
RIGHT JOIN: Return all rows from the right table, and the matched rows from the left table
FULL JOIN: Return all rows when there is a match in ONE of the tables
44. SQL Syntax - JOINs
A B A B
A B A B
INNER JOIN LEFT OUTER JOIN
RIGHT OUTER JOIN FULL JOIN
45. SQL Syntax – INNER JOIN
OrderID CustomerID OrderDate
10308 2 1996-09-18
10309 2 1996-09-19
10310 1 1996-09-20
10311 1996-09-21
ID CustomerName Email City
1 Mahmoud [email protected] Cairo
2 Samy [email protected] Alex
3 Aly [email protected] Aswan
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers [INNER] JOIN Orders
ON Customers.ID=Orders.CustomerID
ORDER BY Customers.CustomerName; CustomerName OrderID
Mahmoud 10310
Samy 10308
Samy 10309
46. SQL Syntax – LEFT OUTER JOIN
OrderID CustomerID OrderDate
10308 2 1996-09-18
10309 2 1996-09-19
10310 1 1996-09-20
10311 1996-09-21
ID CustomerName Email City
1 Mahmoud [email protected] Cairo
2 Samy [email protected] Alex
3 Aly [email protected] Aswan
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers LEFT JOIN Orders
ON Customers.ID=Orders.CustomerID
ORDER BY Customers.CustomerName; CustomerName OrderID
Aly NULL
Mahmoud 10310
Samy 10308
Samy 10309
47. SQL Syntax – RIGHT OUTER JOIN
OrderID CustomerID OrderDate
10308 2 1996-09-18
10309 2 1996-09-19
10310 1 1996-09-20
10311 1996-09-21
ID CustomerName Email City
1 Mahmoud [email protected] Cairo
2 Samy [email protected] Alex
3 Aly [email protected] Aswan
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers RIGHT JOIN Orders
ON Customers.ID=Orders.CustomerID
ORDER BY Customers.CustomerName; CustomerName OrderID
Mahmoud 10310
Samy 10308
Samy 10309
NULL 10311
48. SQL Syntax – FULL OUTER JOIN
OrderID CustomerID OrderDate
10308 2 1996-09-18
10309 2 1996-09-19
10310 1 1996-09-20
10311 1996-09-21
ID CustomerName Email City
1 Mahmoud [email protected] Cairo
2 Samy [email protected] Alex
3 Aly [email protected] Aswan
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers FULL JOIN Orders
ON Customers.ID=Orders.CustomerID
ORDER BY Customers.CustomerName; CustomerName OrderID
Aly NULL
Mahmoud 10310
Samy 10308
Samy 10309
NULL 10311
49. SQL Syntax - Advanced
Using SELECT INTO
SELECT Customers.CustomerName, Orders.OrderID
INTO CustomersOrderBackup2013
FROM Customers LEFT JOIN Orders ON Customers.ID=Orders.CustomerID;
Using INSERT INTO SELECT
INSERT INTO Customers (CustomerName, Country)
SELECT SupplierName, Country FROM Suppliers;
Using SQL Create
CREATE DATABASE dbname;
CREATE TABLE Persons(PersonID int NOT NULL UNIQUE,LastName varchar(255),
FirstName varchar(255),Address varchar(255),City varchar(255));
50. SQL Aggregate Functions
AVG() Returns the average value
COUNT() Returns the number of rows
FIRST() Returns the first value
LAST() Returns the last value
MAX() Returns the largest value
MIN() Returns the smallest value
SUM() Returns the sumUsing SELECT INTO
51. SQL Scalar Functions
UCASE() Converts a field to upper case
LCASE() Converts a field to lower case
MID() Extract characters from a text field
LEN() Returns the length of a text field
ROUND() Rounds a numeric field to the number of decimals specified
NOW() Returns the current system date and time
FORMAT() Formats how a field is to be displayed
52. SQL GROUP BY Statement
The GROUP BY statement is used in conjunction with the aggregate functions
to group the result set by one or more columns.
It can be used for summary reports
SELECT Shippers.ShipperName,COUNT(Orders.OrderID) AS NumberOfOrders
FROM Orders LEFT JOIN Shippers ON Orders.ShipperID=Shippers.ShipperID
GROUP BY ShipperName;
ShipperName NumberOfOrders
Federal Shipping 68
Speedy Express 54
United Package 74
53. SQL GROUP BY Statement
Group by two columns
SELECT Shippers.ShipperName, Employees.LastName,
COUNT(Orders.OrderID) AS NumberOfOrders FROM ((Orders
INNER JOIN Shippers ON Orders.ShipperID=Shippers.ShipperID)
INNER JOIN Employees ON Orders.EmployeeID=Employees.EmployeeID)
GROUP BY ShipperName,LastName;
ShipperName Last Name NumberOfOrders
Federal Shipping Baher 38
Federal Shipping Mona 30
Speedy Express Aly 54
United Package Kareem 70
United Package Yasser 4
54. SQL HAVING Clause
The HAVING clause was added to SQL because the WHERE keyword could not be
used with aggregate functions.
Suppose that we want to find if any of the employees has registered more than 10 orders.
SELECT Employees.LastName, COUNT(Orders.OrderID) AS NumberOfOrders
FROM (Orders INNER JOIN Employees
ON Orders.EmployeeID=Employees.ID)
GROUP BY LastName
HAVING COUNT(Orders.OrderID) > 10;
Last Name NumberOfOrders
Aly 54
Baher 38
Kareem 70
Mona 30
55. SQL Injection
An SQL injection can destroy your database
SQL injection is a technique where malicious users can inject SQL commands into an SQL
statement, via web page input.
Injected SQL commands can alter SQL statement and compromise the security of a web
application.
txtUserId = getRequestString("UserId");
txtSQL = "SELECT * FROM Users WHERE UserId = " + txtUserId;
UserId: 105 or 1=1
SELECT * FROM Users WHERE UserId = 105 or 1=1
SELECT * FROM Users WHERE UserId = 105 or ""=""
UserId: 105; DROP TABLE SUPPLIERS
Use SQL Parameters / PreparedStatements