Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 16 (p481 – 485, 496-501) Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.

Similar presentations


Presentation on theme: "Chapter 16 (p481 – 485, 496-501) Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1."— Presentation transcript:

1

2 Chapter 16 (p481 – 485, 496-501) Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : woodall@mc.edu) 1

3 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 2

4 Part of a Database Table called Nations 3 Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest AustraliaAUCanberra37S148EBeach BahamasBSNassau25N78WBeach BarbadosBBBridgetown13N59WBeach BelizeBZBelize17N18WBeach BermudaBMHamilton32N64WBeach CyprusCYNicosia35N32EHistory Czech Rep.CZPrague51N15EPilsner DenmarkDKCopenhagen55N12EHistory Falkland IS.FKStanley51S58WNature FinlandFIHelsinki64N26ENature GreenlandGLNuuk72N40WNature IcelandISReykjavik65N18WGeysers IrelandIEDublin52N7WHistory

5 13 Rows, Tuples, Records 4 Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest AustraliaAUCanberra37S148EBeach BahamasBSNassau25N78WBeach BarbadosBBBridgetown13N59WBeach BelizeBZBelize17N18WBeach BermudaBMHamilton32N64WBeach CyprusCYNicosia35N32EHistory Czech Rep.CZPrague51N15EPilsner DenmarkDKCopenhagen55N12EHistory Falkland IS.FKStanley51S58WNature FinlandFIHelsinki64N26ENature GreenlandGLNuuk72N40WNature IcelandISReykjavik65N18WGeysers IrelandIEDublin52N7WHistory

6 8 Columns, Fields, Attributes 5 Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest AustraliaAUCanberra37S148EBeach BahamasBSNassau25N78WBeach BarbadosBBBridgetown13N59WBeach BelizeBZBelize17N18WBeach BermudaBMHamilton32N64WBeach CyprusCYNicosia35N32EHistory Czech Rep.CZPrague51N15EPilsner DenmarkDKCopenhagen55N12EHistory Falkland IS.FKStanley51S58WNature FinlandFIHelsinki64N26ENature GreenlandGLNuuk72N40WNature IcelandISReykjavik65N18WGeysers IrelandIEDublin52N7WHistory

7 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. 6

8 Properties of Database Tables: An Empty table 7 Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest

9 Properties of Database Tables: Two views of the same table 8 Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest AustraliaAUCanberra37S148EBeach BahamasBSNassau25N78WBeach BarbadosBBBridgetown13N59WBeach BelizeBZBelize17N18WBeach BermudaBMHamilton32N64WBeach CyprusCYNicosia35N32EHistory Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest BelizeBZBelize17N18WBeach BarbadosBBBridgetown13N59WBeach AustraliaAUCanberra37S148EBeach BermudaBMHamilton32N64WBeach BahamasBSNassau25N78WBeach CyprusCYNicosia35N32EHistory

10 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. 9

11 A Database Table called Nations 10 Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest AustraliaAUCanberra37S148EBeach BahamasBSNassau25N78WBeach BarbadosBBBridgetown13N59WBeach BelizeBZBelize17N18WBeach BermudaBMHamilton32N64WBeach CyprusCYNicosia35N32EHistory Czech Rep.CZPrague51N15EPilsner DenmarkDKCopenhagen55N12EHistory Falkland IS.FKStanley51S58WNature FinlandFIHelsinki64N26ENature GreenlandGLNuuk72N40WNature IcelandISReykjavik65N18WGeysers IrelandIEDublin52N7WHistory

12 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 11

13 A Database Table called Nations 12 Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest AustraliaAUCanberra37S148EBeach BahamasBSNassau25N78WBeach BarbadosBBBridgetown13N59WBeach BelizeBZBelize17N18WBeach BermudaBMHamilton32N64WBeach CyprusCYNicosia35N32EHistory Czech Rep.CZPrague51N15EPilsner DenmarkDKCopenhagen55N12EHistory Falkland IS.FKStanley51S58WNature FinlandFIHelsinki64N26ENature GreenlandGLNuuk72N40WNature IcelandISReykjavik65N18WGeysers IrelandIEDublin52N7WHistory

14 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 13

15 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) 14

16 Physical Database The physical database It is made up of all of the physical tables. Major rule: No Redundancy! 15

17 Nations is a Physical Table 16 Nations NameDomainCapitalLatitudeN_SLongitudeE_WInterest AustraliaAUCanberra37S148EBeach BahamasBSNassau25N78WBeach BarbadosBBBridgetown13N59WBeach BelizeBZBelize17N18WBeach BermudaBMHamilton32N64WBeach CyprusCYNicosia35N32EHistory Czech Rep.CZPrague51N15EPilsner DenmarkDKCopenhagen55N12EHistory Falkland IS.FKStanley51S58WNature FinlandFIHelsinki64N26ENature GreenlandGLNuuk72N40WNature IcelandISReykjavik65N18WGeysers IrelandIEDublin52N7WHistory

18 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) 17

19 Query 1 us a Logical Table 18 Query1 NameDomain BahamasBS BarbadosBB BelizeBZ BermudaBM Created by a Query on the Nations Table

20 Creating Queries (i.e. logical tables) Steps to create each query… 1.Select the table or tables with the needed data 2.Select the fields you wish to see 3.Set the criteria for which rows you want 4.Sort as prescribed 19

21 Entity Relationship diagrams Also called ER diagrams Show the relationships between the physical tables in the physical database. 20

22 ER Diagram 21

23 ER Diagram: ∞ to 1 Table: Movies Fields: Movie ID Director ID Title Release Year Directed by Table: Directors Fields: Director ID Last Name First Name Birth Year 22


Download ppt "Chapter 16 (p481 – 485, 496-501) Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1."

Similar presentations


Ads by Google