Fundamentals/ICY: Databases 2012/13 WEEK 3 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.

Slides:



Advertisements
Similar presentations
Organisation Of Data (1) Database Theory
Advertisements

Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Fundamentals/ICY: Databases 2013/14 WEEK 4: Monday Intro to tables, etc. John Barnden Professor of Artificial Intelligence School of Computer Science University.
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Fundamentals/ICY: Databases 2013/14 Week 6: Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Exploring Microsoft Excel 2002 Chapter 7 Chapter 7 List and Data Management: Converting Data to Information By Robert T. Grauer Maryann Barber Exploring.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Query-By-Example (QBE) 2440: 180 Database Concepts.
Normalization Queries (contd)
Chapter 7 Data Management. Agenda Database concept Import data Input and edit data Sort data Function Filter data Create range name Calculate subtotal.
Week 2 Normalization and Queries
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Access Tutorial 3 Maintaining and Querying a Database
Computer Science 101 Web Access to Databases SQL – Extended Form.
Software Development Unit 2 Databases What is a database? A collection of data organised in a manner that allows access, retrieval and use of that data.
Querying and Sorting IT Key Ideas, Dynamic Database Systems, 2002 Chapter 3.
Intro to Maths for CS: 2013/14 Sets (2) – OPTIONAL MATERIAL John Barnden Professor of Artificial Intelligence School of Computer Science University of.
Concepts of Database Management, Fifth Edition
Coding for Excel Analysis Optional Exercise Map Your Hazards! Module, Unit 2 Map Your Hazards! Combining Natural Hazards with Societal Issues.
Relational DBs and SQL Designing Your Web Database (Ch. 8) → Creating and Working with a MySQL Database (Ch. 9, 10) 1.
Chapter 3 Single-Table Queries
Fundamentals/ICY: Databases 2010/11 WEEK 5 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Concepts and Terminology Introduction to Database.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
Fundamentals/ICY: Databases 2012/13 WEEK 5 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
Fundamentals/ICY: Databases 2012/13 WEEK 7 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
CSC 240 (Blum)1 Introduction to Database. CSC 240 (Blum)2 Data versus Information When people distinguish between data and information, –Data is simply.
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
1 Single Table Queries. 2 Objectives  SELECT, WHERE  AND / OR / NOT conditions  Computed columns  LIKE, IN, BETWEEN operators  ORDER BY, GROUP BY,
Concepts of Database Management Seventh Edition
Fundamentals/ICY: Databases 2013/14 WEEK 3: Friday Theme intro contd; towards tables John Barnden Professor of Artificial Intelligence School of Computer.
Chapter 17 Creating a Database.
M1G Introduction to Database Development 2. Creating a Database.
Fundamentals/ICY: Databases 2010/11 WEEK 3 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Fundamentals/ICY: Databases 2012/13 WEEK 11 – 4 th Normal Form (optional material) John Barnden Professor of Artificial Intelligence School of Computer.
Information Technologies and Microsoft SQL Server Day 2 by Alper Özpınar
Fundamentals/ICY: Databases 2012/13 Intro to Some Main Themes John Barnden Professor of Artificial Intelligence School of Computer Science University of.
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Fundamentals/ICY: Databases 2013/14 WEEK 9 –Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
A Simple Guide to Using SPSS ( Statistical Package for the Social Sciences) for Windows.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Fundamentals/ICY: Databases 2013/14 WEEK 9 –Friday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Working with Data Lists.
Concepts of Database Management Seventh Edition Chapter 3 The Relational Model 2: SQL.
Fundamentals/ICY: Databases 2013/14 Initial Orientation John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Fundamentals/ICY: Databases 2013/14 Week 5: Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Fundamentals/ICY: Databases 2012/13 Week 4 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Fundamentals/ICY: Databases 2013/14 Week 4: Friday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Fundamentals/ICY: Databases 2013/14 Week 11 – Monday – relations, ended. John Barnden Professor of Artificial Intelligence School of Computer Science University.
April 20022CS3X1 Database Design The relational model John Wordsworth Department of Computer Science The University of Reading
Fundamentals/ICY: Databases 2013/14 Week 3: Monday Intro to Some Main Themes John Barnden Professor of Artificial Intelligence School of Computer Science.
1 Chapter 3 Single Table Queries. 2 Simple Queries Query - a question represented in a way that the DBMS can understand Basic format SELECT-FROM Optional.
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
Operation Data Analysis Hints and Guidelines
Databases Chapter 16.
Fundamentals/ICY: Databases 2010/11 WEEK 1
Fundamentals/ICY: Databases 2010/11 WEEK 6
Relational Database Model
Creating Tables & Inserting Values Using SQL
M1G Introduction to Database Development
Fundamentals/ICY: Databases 2012/13 Initial Orientation
The ultimate in data organization
Fundamentals/ICY: Databases 2013/14 WEEK 6 - Friday
John Barnden Professor of Artificial Intelligence
Information system analysis and design
Presentation transcript:

Fundamentals/ICY: Databases 2012/13 WEEK 3 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK

Answer Notes! uWeek 1 exercises: on the web site, via Exercises page

New Exercises! uWeek 3 exercises: on the web site, via Exercises page uInclude SQL exercises and Conceptual exercises uExtensive notes on starting with SQL

Reminder of Week 2

TABLES for REPRESENTATION (theme introduction)

NAMEADDRESSPHONESBIRTHDAY Babloop Porkypasta 107 Worm Drive, Hedgebarton, Birmngham, B15 9ZZ January 1969 Coriolanus Zebedee O’Crackpotham The Wellyboots, Boring-under-Mosswood, Berks, HP11 1XX Johnny Next to the Tesco’s in Upper Street H: W: M: ??? Full Monty chip shop Harborne Oct 05 Hilary R. Clinton (grr!) The Old Black House, Aplanalp St., Las Cruces, NM , USA ex-dir16 Sep? (refused to tell me how old she was)

Problems with that Table uAlthough that table illustrates the sort of table used in databases in some sense, it has many tricky features: l Empty entries – what’s the interpretation? l Spelling error (Birmngham) l Names/addresses of different forms (perhaps unavoidably) l Different numbers of alternatives in different cells l Different interpretations of “birthday” field (per year, or when born, or when shop opened) l Vague entries (next to the Tesco’s in Upper St.; Harborne) l Expressed uncertainty (the question marks, alone or attached) l Additional comments (grr!, refused …) l Exceptional entry types (ex-dir, and the contents of the chip-shop row)

New for Week 3

Question to You: What other sorts of weird thing could happen in tables??

Restrictions on Database Tables: Overall Structure uRegular overall shape: rows all same length, similarly columns. uNo division into different regions (with a certain exception). uNo labels for rows, as opposed to columns. Mostly no significance to the order or number of rows (but the number can change). uNo additional comments, footnotes, etc.

Restrictions on Database Tables: Nature of Entries uAll cells in any one column are given the same intuitive interpretation. uEach cell’s item restricted to a pre-specified, fairly simple format, and all cells in any given column restricted to same format. uNo exceptional entries … with one exception!: empty entries uOne data item per cell (but it can be a variable-length character string, containing anything). uUncertainty and vagueness markers not supported.

Extra, Crucial Restriction (on the main tables) uNo row can be repeated in a table. (I.e., no two rows can contain exactly the same values.) uThis is equivalent to saying: Rows are uniquely determined (picked out) by the values in some set of columns (possibly the whole set, but could be fewer). That is, if you imagine some values for those columns, there is at most one row that has exactly those values in those columns.

LAST N.FIRST NMIADDRESSHome PhMobileB yearB day PorkypastaBabloop107 Worm Drive, Hedgebarton, Birmngham, B15 9ZZ Jan 11 O’CrackpothamCoriolanusZThe Wellyboots, Boring-under- Mosswood, Berks, HP11 1XX DelfinoJohnny-----Next to the Tesco’s in Upper Street ClintonHilaryRThe Old Black House, Aplanalp St., Las Cruces, NM , USA-----Sep 16

Coordination between Tables NAMEPHONEEMPLOYERAGE Chopples University of Birmingham 37 Blurp Monmouth School for Girls 21 Rumpel University of Birmingham 88 EMPLOYERADDRESSNUM. EMPLSSECTOR BTBT House, London, … 1,234,5678Private TCOM Monmouth School for Girls Hereford Rd, Monmouth, … 245Private 2E University of Birmingham Edgbaston Park Rd, …. 4023Public HE PHONETYPESTATUS officeOK homeFAULT homeOK mobileUNPAID There should really be a FIRST NAME as well, in practice

Remember: “Associative Linking” This is how the tables are linked.

But: What are the disadvantages of using character strings like “University of Birmingham” as linking values?

The Disadvantages uIn entering values, have to ensure exactly the same string of characters on each occasion l avoid typos on data entry l avoid variants: “The University of Birmingham” uDifficult to guarantee that two different entities won’t have the same name. uInefficiency of comparing such complex values. Reduce such problems by: uUsing artificial linking values that are simpler in form and easier to make distinct …..

Table Coordination: Revised NAMEPHONEEMPL. IDAGE Chopples E Blurp E Rumpel E EMPL. IDEMPL. NAMEADDRESSNUM. EMPLSSECTOR E48693BTBT House, London, … 1,234,5678Private TCOM E85704Monmouth School Hereford Rd, Monmouth, … 245Private 2E E22561University of Birmingham Edgbaston Park Rd, …. 3023Public HE PHONETYPESTATUS officeOK homeFAULT homeOK mobileUNPAID

Redundancy between Tables NAMEPHONESTATUSEMPLOYERAGE Chopples OK University of Birmingham 37 Blurp FAULT Monmouth School 21 Rumpel UNPAID University of Birmingham 88 PHONETYPESTATUS officeOK homeFAULT homeOK mobileUNPAID What are the advantages and disadvantages of the sharing of the STATUS attribute?

Tables and Things u The example tables involve various types of thing: l People l People’s names l Addresses l Phone numbers l Phone number types l Dates l Ages l Status indicators l etc.

uand also various types of connection between things, e.g.: l A person having an address l A person being employed by an organization l An organization having some employees l A person having a birth date l A phone number being of a type l A phone number having a status l etc.

ORGANIZATIONS (each with …) PHONE STATIONS (each with number, type & status) a person may be employed by one(?) organization a person may have one(?) phone station PEOPLE (each with name, address, etc.) PHONE EMPLOYER

You Judge Only Some Types of Thing to Merit Tables uIn the example above we have decreed that only the people, employing organizations, and phone stations CATEGORIES correspond to WHOLE TABLES. l In one table, each row represents a person. l In another table, each row represents an employing organization. l In yet another table, each row represents a phone station. uWe have decreed that the other types of things, such as people’s names, addresses, phone numbers, phone-number types, etc. correspond only to COLUMNS of tables, not whole tables, and each individual thing is just represented as a value in a cell.

Meriting Tables, contd. uThe question of what types of thing should correspond to tables depends on the application and your design judgment. uIt all depends on things like: l what range of information is needed about something l how separate the pieces of info about a given thing are l what operations are needed l how often they’re needed. u For example:

Typical Approach to Phone Numbers NAMEPHONEEMPLOYERAGE Chopples E Blurp E Rumpel E (There should really be a FIRST NAME as well)

But the following is possible … NAMEPHONE IDEMPLOYERAGE ChopplesABC123E BlurpABC137E RumpelDEF678E PHONE IDAREA CODEBODY ABC ABC DEF DEF There should really be a FIRST NAME as well

Some Operations on Individual Tables uCreating a new empty table of a particular “shape” (mainly, particular column names and value-types for the columns) uChanging the “shape” of an existing table (e.g., adding/deleting a column, or changing the type of a column) uAdding a row or rows to a table uDeleting a row or rows (question: how identified?) uUpdating values in an individual cell (column specified by name; but how identify the row?)

More Operations on Individual Tables uRetrieving values from an individual cell; doing calculations on them uRetrieving the values in the cells in some or all columns for some or all rows uCalculating statistics concerning values in particular columns across all rows, a subset of rows, or several subsets of rows (count, max, min, average, standard deviation, …) uOrdering rows in different ways in displays of a table.

Operations on Coordinated Tables uNeed to be able to combine data from related tables in a variety of ways. E.g.: l Join tables together in various ways l Select things from one table on the basis of information in others uNeed to ensure consistency between related tables. E.g.: l Deletion of something in one table may require deletions from or other modifications to other tables.

ENTITIES, RELATIONSHIPS & ATTRIBUTES (Introduction)

Entities uBasically, entities are just things of the “important types” that we judged above to merit tables. So we had entity types such as: l People l Employing Organizations l Phone Stations (as opposed to just phone numbers as such) uSo what the entity types are in a given working environment are partly a matter of judgment, as explained earlier. But we’ll see that in designing a DB we may need to introduce new, not immediately obvious, entity types. u“Entities” are, or should be, the things of a type: e.g., individual people. An entity is represented by a row in the appropriate table.

Entity Terminology uUnfortunately: “entity” is often used to mean entity type. “entity set” is often used for entity type. “entity occurrence” is often used to mean individual entity.