210 likes | 314 Views
IS 2101—Spring 2010. Chapter 9 Databases and Information Systems. Querying data. Listing data from a single table People Reports List of buildings List of people Listing data in related tables Rooms listed with building full names Events listed with all people attending.
E N D
IS 2101/07---Spring 2010 IS 2101—Spring 2010 Chapter 9 Databases and Information Systems
Querying data • Listing data from a single table • People • Reports • List of buildings • List of people • Listing data in related tables • Rooms listed with building full names • Events listed with all people attending IS 2101/07---Spring 2010
The Query Wizard • Choose tables • Choose columns from tables • Later we’ll put restrictions on the values chosen, but not yet IS 2101/07---Spring 2010
Listing All People • Pick the People table • Select which fields to include • First, middle, last names • ID • Notice that the query is stored with the table that it references IS 2101/07---Spring 2010
The Result of a Query • The result obtained from a query is actually a table. • This is a virtual table, that is, it is not stored directly but is computed as needed • Under the right conditions, you can modify data in the query table and it will be reflected back in the real tables IS 2101/07---Spring 2010
Reports • Reports display data in a form easier to read than the tables produced by queries • The data from a report can be arranged visually in various ways • Data for a report can be pulled from tables and queries IS 2101/07---Spring 2010
Create a Report • Create a report list all people • Create a report listing all buildings • Notice that reports are stored with the table they reference IS 2101/07---Spring 2010
Queries with Multiple Tables • Make a list of events and people attending them • Connect people to events using tables • Create a basic query • Look at SQL IS 2101/07---Spring 2010
Connecting People to Events • We want to get the people attending various events • Look at the relationship diagram • We can get from people to events by going through the attending table • We can get there through the organizing table but that would give people organizing events IS 2101/07---Spring 2010
Create a Query • Use the query wizard again • Create a simple query • Select three tables • Attending • Events • People • Select all fields in them IS 2101/07---Spring 2010
Run the Query • Run the query and examine the results • Each row gives information about a person attending an event • All the information about the event and the person are included • This data is highly redundant, but, since it is generated, we don’t have the consistency problem IS 2101/07---Spring 2010
Query Design View • We can hide certain fields • We can add constraints • Select start times later than 4/14/2015 IS 2101/07---Spring 2010
Create a Report • Listing attendees by event • Listing events by person IS 2101/07---Spring 2010
Looking at the SQL • SQL is a formally defined language for expressing queries and other database operations • SQL is used to give commands to a database • The word ‘SELECT’ begins query command • FROM lists tables that are used to get data • JOIN indicates that tables are related by foreign key to primary key • WHERE indicates further criteria IS 2101/07---Spring 2010
Data Warehouses • What is a data warehouse? • Large amounts of data • Selected from existing databases • Especially suited to high-level reports • Will usually hold data collected over time • Historical reports IS 2101/07---Spring 2010
Filling Data Warehouses • Data is brought in from several sources • Data may have to be staged, that is, transformed to a common format IS 2101/07---Spring 2010
Querying Data Warehouses • Since there is so much data, query engines must be more flexible • Queries will involve more summary results rather than IS 2101/07---Spring 2010
Information Systems • Office Support Systems • Transaction Processing Systems • Detail • Management Information System • Summary • Exception • Decision Support Systems IS 2101/07---Spring 2010
Information Systems • Model Management Systems • Knowledge Based Systems • Expert systems • Fuzzy Logic • Enterprise resource planning systems IS 2101/07---Spring 2010
Data Mining • Examining large amounts of data • Not using specific queries, but looking for patterns and trends IS 2101/07---Spring 2010
Data Mining Techniques • Classification • Estimation • Affinity grouping • Clustering • Visualization and description IS 2101/07---Spring 2010