SELECT LA_code, sum(population)/sum(wardarea) AS density, (SELECT count(*) FROM wards_by_LA WLA2, violent_crime WHERE WLA2.ward_code =violent_crime.ward_code.

Slides:



Advertisements
Similar presentations
Jose Chinchilla MCITP: Database Administrator, SQL Server 2008 MCITP: Business Intelligence Design and Implementation, SQL Server 2008 President & CEO,
Advertisements

C6 Databases.
Technical BI Project Lifecycle
Management Information Systems, Sixth Edition
Data Warehousing M R BRAHMAM.
Modeling the Data: Conceptual and Logical Data Modeling
Decision Support and Data Warehouse. Decision supports Systems Components Data management function –Data warehouse Model management function –Analytical.
Chapter 3 Database Management
Database Management: Getting Data Together Chapter 14.
Advanced Querying OLAP Part 2. Context OLAP systems for supporting decision making. Components: –Dimensions with hierarchies, –Measures, –Aggregation.
COMP 578 Data Warehousing And OLAP Technology Keith C.C. Chan Department of Computing The Hong Kong Polytechnic University.
Data Warehousing. On-Line Analytical Processing (OLAP) Tools The use of a set of graphical tools that provides users with multidimensional views of their.
1 © Prentice Hall, 2002 Chapter 11: Data Warehousing.
Business Intelligence Instructor: Bajuna Salehe Web:
OLAP OPERATIONS. OLAP ONLINE ANALYTICAL PROCESSING OLAP provides a user-friendly environment for Interactive data analysis. In the multidimensional model,
What is Business Intelligence? Business intelligence (BI) –Range of applications, practices, and technologies for the extraction, translation, integration,
SQL Analysis Services Microsoft® SQL Server 2005 Analysis Services provides unified, fully integrated views of your business data to support online.
SharePoint 2010 Business Intelligence Module 6: Analysis Services.
©Silberschatz, Korth and Sudarshan18.1Database System Concepts - 5 th Edition, Aug 26, 2005 Buzzword List OLTP – OnLine Transaction Processing (normalized,
5.1 © 2007 by Prentice Hall 5 Chapter Foundations of Business Intelligence: Databases and Information Management.
1 Brett Hanes 30 March 2007 Data Warehousing & Business Intelligence 30 March 2007 Brett Hanes.
IST722 Data Warehousing Business Intelligence Development with SQL Server Analysis Services and Excel 2013 Michael A. Fudge, Jr.
Ihr Logo Chapter 5 Business Intelligence: Data Warehousing, Data Acquisition, Data Mining, Business Analytics, and Visualization Turban, Aronson, and Liang.
Best Practices for Data Warehousing. 2 Agenda – Best Practices for DW-BI Best Practices in Data Modeling Best Practices in ETL Best Practices in Reporting.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
South Africa Data Warehouse for PEPFAR Presented by: Michael Ogawa Khulisa Management Services
Chapter 6: Foundations of Business Intelligence - Databases and Information Management Dr. Andrew P. Ciganek, Ph.D.
The Business Intelligence Side of Blue Mountain RAM Bill Lucas, IT Systems Architect and Senior Software Engineer.
ETL Overview February 24, DS User Group - ETL - February ETL Overview “ETL is the heart and soul of business intelligence (BI).” -- TDWI ETL.
Business Intelligence Zamaneh Jahed. What is Business Intelligence? Business Intelligence (BI) is a broad category of applications and technologies for.
Inner Join vs. Outer Join
CS 157B: Database Management Systems II March 20 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
BUS1MIS Management Information Systems Semester 1, 2012 Week 6 Lecture 1.
1 Single Table Queries. 2 Objectives  SELECT, WHERE  AND / OR / NOT conditions  Computed columns  LIKE, IN, BETWEEN operators  ORDER BY, GROUP BY,
1 Data Warehouses BUAD/American University Data Warehouses.
OLAP & DSS SUPPORT IN DATA WAREHOUSE By - Pooja Sinha Kaushalya Bakde.
Data Warehousing.
C6 Databases. 2 Traditional file environment Data Redundancy and Inconsistency: –Data redundancy: The presence of duplicate data in multiple data files.
BI Terminologies.
October 28, Data Warehouse Architecture Data Sources Operational DBs other sources Analysis Query Reports Data mining Front-End Tools OLAP Engine.
Building Data and Document-Driven Decision Support Systems How do managers access and use large databases of historical and external facts?
Decision Support and Date Warehouse Jingyi Lu. Outline Decision Support System OLAP vs. OLTP What is Date Warehouse? Dimensional Modeling Extract, Transform,
6.1 © 2010 by Prentice Hall 6 Chapter Foundations of Business Intelligence: Databases and Information Management.
1 Technology in Action Chapter 11 Behind the Scenes: Databases and Information Systems Copyright © 2010 Pearson Education, Inc. Publishing as Prentice.
Chapter 13 Designing Databases Systems Analysis and Design Kendall & Kendall Sixth Edition.
Chapter 5 DATA WAREHOUSING Study Sections 5.2, 5.3, 5.5, Pages: & Snowflake schema.
Building Dashboards SharePoint and Business Intelligence.
Foundations of Business Intelligence: Databases and Information Management.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 8 Accessing Organizational Information – Data Warehouse.
Business Intelligence Transparencies 1. ©Pearson Education 2009 Objectives What business intelligence (BI) represents. The technologies associated with.
OLAP On Line Analytic Processing. OLTP On Line Transaction Processing –support for ‘real-time’ processing of orders, bookings, sales –typically access.
Data Warehousing.
Advanced Database Concepts
The Need for Data Analysis 2 Managers track daily transactions to evaluate how the business is performing Strategies should be developed to meet organizational.
1 Database Systems, 8 th Edition Star Schema Data modeling technique –Maps multidimensional decision support data into relational database Creates.
Building the Corporate Data Warehouse Pindaro Demertzoglou Data Resource Management.
The Concepts of Business Intelligence Microsoft® Business Intelligence Solutions.
BUSINESS INTELLIGENCE. The new technology for understanding the past & predicting the future … BI is broad category of technologies that allows for gathering,
Building the Corporate Data Warehouse Pindaro Demertzoglou Lally School of Management Data Resource Management.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
IFS180 Intro. to Data Management Chapter 10 - Unions.
PART 1: Models, metrics and the demystification of statistical significance FRSS!!!!
Business Intelligence Overview
01-Business intelligence
Data warehouse and OLAP
Data Warehouse.
Data Warehouse and OLAP
Introduction of Week 9 Return assignment 5-2
Chapter 17 Designing Databases
Data Warehouse and OLAP
Presentation transcript:

SELECT LA_code, sum(population)/sum(wardarea) AS density, (SELECT count(*) FROM wards_by_LA WLA2, violent_crime WHERE WLA2.ward_code =violent_crime.ward_code AND WLA2.LA_code= WLA1.LA_code ) AS n_crimes FROM ward_profile, wards_by_LA WLA1 WHERE ward_profile.ward_code= WLA1.ward_code GROUP BY LA_code ORDER BY sum(population)/sum(wardarea) DESC; Correlated subqueries Tutorial 3, Q2 d) Produce a table showing the total population for each LA and the area it covers. Compute the population density. Order your output from highest to lowest density. e) Extend the previous query to include the total number of crimes in each LA. Part e) is not a simple extension of d). Bringing in violent_crime in a 3 way join will not work, and this will mean the information about population density and ward are is repeated multiple times. The answer is to use a subquery: Note the use of the subquery as an output field. This type of subquery is called a correlated subquery because it makes an external reference (WLA1) to the main query, and has to be re-evaluated for each iteration of the main query, i.e. each value of LA_code

SELECT ward_profile.ward_code, count(crime_id) AS n_crime FROM ward_profile LEFT OUTER JOIN violent_crime ON ward_profile.ward_code = violent_crime.ward_code GROUP BY ward_profile.ward_code ORDER BY count(crime_id) DESC SELECT * FROM violent_crime INNER JOIN ward_profile ON violent_crime.ward_code= ward_profile.ward_code All the joins we have been considering so far are called inner joins. SQL provides an alternative syntax: Inner joins only include combinations of rows when there is a match in both tables. This can be problematic – the above join, for instance, would not produce any rows for wards where no crimes were committed. Sometimes we may want to include all the rows from one table even if there is no matching row in the other table. This is called an outer join. For example: More SQL LEFT just means all rows from the first table are included (vice versa for RIGHT) FINALLY – note that once you have stored an Access query, you can query it just like a table, e.g. SELECT * from Query1. This allows very complex queries to be built up. You can think of the query as providing a particular VIEW of the database.

MORE ERM Relationships can be a) three way and b) recursive. SUPPLIER SUPPLY PART PROJECT EMPLOYEE SUPERVISOR b) Recursive relationship. Note that the double line means every employee has to have a supervisor. This is called TOTAL PARTICIPATION in the relationship. a) three way N 1 Chen is not the only notation

ERM – finale: Wozzie’s Gym USER BOOKS USER ID NAME CASUAL MEMBER FULL MEMBER d BANK DETAILS U U FACILITY Two implementation options: 1) Combine casual and full members in same table, with an extra attribute to indicate status. Alternatively, have a separate table for each and then use the UNION operator to combine them: SELECT user_id FROM full_member UNION SELECT user_id FROM casual_member This notation is used to indicate subclasses of an entity. Note that the subclasses “inherit” all the attributes of the “parent class”.

Business Intelligence (BI) A rational approach to continuous improvement based on: –Gathering/analyzing operational (transactional) data –Making decisions & taking actions based on that data –Measuring results according to predetermined metrics (Key performance indicators – KPIs) –Feeding lessons from one decision into the next The production of timely, accurate, high value and actionable information David Wastell

Data warehousing A Data Warehouse is a centrally managed and integrated database containing structured data from operational sources in an organization. Data extracts are validated, cleansed and transformed into a common, stable, relatable view of data. ETL = Extract Transform Load

Dashboards and KPIs Business dashboards provide a “control panel” for monitoring the vital functions of the business, supplying immediate information, indicating when and where performance is lagging…..

BI in Action: Crime Policy Police County Council Fire service Ambulance Service Probation Other ETL MADE Monthly Reports Data- mining (policy research)

time of day serious violent crime Town 1 Town 2 Rural 1 Rural 2 Town 3 Data mining example: the aetiology of alcohol- related violence

Correlation = 0.67, very sig.

Evidence-based Policy: crime control Street drinking ban Ambulance Incidents (monthly) Target zone County demand Before ban After ban Change-9%+5% % total serious violent crime committed within target zone (reduced 14.8% to 12.3%) All effects stat. sig. BUT … any validity concerns, alternative explanations?? % of total in target zone Month Guess what…..

Crime data: relational view OLAP: Online analytical processing

Crime as a multi-dimensional “cube” Dimensions are typically hierarchies of categories

Slicing and dicing – and drilling down