220 likes | 344 Views
Chapter 16 (p481 – 485, 496-501). Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : woodall@mc.edu). Database Defined. database – an organized collection of related information, used primarily to maintain and look up that information.
E N D
Chapter 16 (p481 – 485, 496-501) Fluency with Information Technology 4th edition by Lawrence Snyder (slides by Deborah Woodall : woodall@mc.edu)
Database Defined database– an organized collection of related information, used primarily to maintain and look up that information. relational database -the most common type of database Data is organized into tables that have rows and columns. Thus, a database is a collection of one or more tables
Properties of Database Tables • A relational database table can be empty. • Two tables with the same rows, but in a different order, are the same table. • Two tables with the same columns, but in a different order, are the same table. • Thus the information in a database can be ordered (i.e. sorted) in any order that you need.
Properties of Database Tables • Every row of a database table must be unique in some way. • The field (i.e. column or attribute) for which all rows of the data base table are unique is the primary key of the table.
Properties of Database Tables • Field names (i.e. column names, attribute names) should be descriptive. • Attribute data (i.e. column data, field data) is atomic • Or Indivisible • The value of a field (i.e. column, attribute) can not be subdivided into several smaller parts • The date attribute is a classic exception
Database Scheme • Also called database schema • It is the collection of all table definitions for a database. • Each table definition includes • Table name • Fields with data types • Primary key indicated
A Table Definition for Nations Table • Name: Nations • Fields: (with data type and primary key indicated) Name (Text) Domain (Text) Capital (Text) Latitude (Text) N_S (Number) Longitude (Text) E_W (Number) Interest (Text)
Physical Database Thephysical database • It is made up of all of the physical tables. • Major rule: No Redundancy!
Logical Database and Queries • It is made up of all of the logical tables. • A logical table is created as the result of a query. • A query is an operation on one or more database tables that pulls info from the database. • For complex queries, go beyond "drag and drop" with Structured Query Language (SQL)
Query 1 us a Logical Table Created by a Query on the Nations Table
Creating Queries(i.e. logical tables) Steps to create each query… • Select the table or tables with the needed data • Select the fields you wish to see • Set the criteria for which rows you want • Sort as prescribed
Entity Relationship diagrams • Also called ER diagrams • Show the relationships between the physical tables in the physical database.