Implementing the Database        Server SW###Session 1
Who am I?Name : Guillermo JulcaPhone : 914-309-8412Email : webmaster@gjp2s.comWebsite : gjp2s.comBest way to reach me is b...
Class InfoImplementing the Database ServerMS SQL ServerSW############, Room ###Tuesday 6:30-9:30PMLecture/Lab format
SQL Server VersionsClass is based on SQL Server 2005.Some concepts in the slides may refer toprevious versions of SQL Serv...
TextsRECOMMENDED, not required. I do notteach from a book.Dewson, Beginning SQL Server 2005 forDevelopers: From Novice to ...
SQL Server 2005 For YOU!http://www.microsoft.com/sql/downloads/trial-so180-day trial.You can order a DVD for $5.99 + shipp...
Class ObjectivesThe student will understand the basics ofthe Relational Database Model.The student will learn DatabaseAdmi...
SyllabusObjectivesSchedule of ClassesReadingGradingTentative?
What is a database?Ideas?
What is a Database?A collection of information.The implication is that there is somelogical ordering of the data stored in...
What is a DBMS?DataBase Management SystemA software system that is responsiblefor managing the data in the database.Provid...
Why use a database?Permanent Storage.Information is shared.Provide synchronized access - locking.Centralized security.Back...
Types of Databases - ‘Flat’ Files A single file on a disk. Access is sequential. Operations on large files require enormou...
Types of Databases - Indexed            FilesStart with a flat file. Each item of data isthe same size, and they are in an...
Types of Databases -         HierarchicalData is organized as a tree.Can use a single or multiple files.The Windows Regist...
Types of Databases - Relational Data is organized in tables. Tables consist of rows and columns. Tables with related infor...
Type of Databases - Object          OrientedClasses define the data.An instance of a class is an object.Methods can be def...
System Architecture -          MainframeThe database is on a mainframe.The application is also on the mainframe.Users acce...
System Architecture - PC / FileThe database and the DBMS are on thePC.4GLs define the application, which alsoruns on the P...
System Architecture -The database Client/Server a server (or             and DBMS are onset of severs).Application logic i...
Client/Sever - Fat ClientsThe bulk of the application logic resideson the client PC - the ‘workstation’.Allows very comple...
Client/Server - Fat ServerThe server handles most business logic.Little or no application changes requiredwhen business ru...
Client/Server - ‘Mixed         Environments’A nice way to say somewhere in themiddle.Generally, all but very specific syst...
System Architecture - TiersClient/Server is passé – the new paradigm (and buzzword) is“n-tiered architecture”.As systems t...
System Architecture - SOAsService-Oriented Architectures.SOAs are really free-from tiers with well-defined interfaces. Eac...
Application ExamplesFat Client - the advertising system.Fat Server - UPC generation.Mixed Environment - VersionManagement....
ScalabilityHow big is too big?What is the line between MySQL, SQLServer, Oracle, and what lies beyond?Factors:– Size– Secu...
The Relational Model.Defined by Codd, 1969. (Jeopardy?)We will:– present the technical definition of each term.– translate...
DomainsA set of values.Must be atomic - cannot be brokendown further with respect to thepurpose it is modeled for. For exa...
DomainsA domain has a data type and optionally aname.Data type may be a simple PL data typesuch as integer or string, or m...
DomainsGiving a domain a name is similar to #typedefin C - it allows you to change the valuesallowed in a domain used in m...
Relation Schema“Table Definition”A name and a set of “attributes”attribute = columneach attribute has a name and a domain....
Relation InstanceRelation for short, or just Table.an instance of a relation schema.“a set of tuples, where a tuple is ano...
Null ValuesUsed to signify that either:A value does not apply– An apartment # of a person that lives in a  house.A value i...
Keys“by definition of a set, all tuples in arelation must be distinct.”No duplicate rows in a table.a ‘superkey’ is a set ...
Primary KeyThe primary key is a key that has beenchosen as the identifying key for thattable.Usually, a synthetic value (c...
Recaprelation schema - definition of a tablerelation - tableattribute - column or fieldtuple - rowsuperkey - set of column...
Naming ConventionsMakes things easier to read.Should be different than PL code.My convention:– All database objects and at...
LabWhat is the SQL Server ManagementStudio?
Upcoming SlideShare
Loading in …5
×

Implementing the Database Server session 01

376 views

Published on

The student will understand the basics of the Relational Database Model.
The student will learn Database Administration functions as appropriate for software developers.
The student will learn SQL.
The student will become familiar with the entire implementation cycle of a client server application.
And, you will build one.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
376
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Implementing the Database Server session 01

  1. 1. Implementing the Database Server SW###Session 1
  2. 2. Who am I?Name : Guillermo JulcaPhone : 914-309-8412Email : webmaster@gjp2s.comWebsite : gjp2s.comBest way to reach me is by Email!What do I do?Why am I here?
  3. 3. Class InfoImplementing the Database ServerMS SQL ServerSW############, Room ###Tuesday 6:30-9:30PMLecture/Lab format
  4. 4. SQL Server VersionsClass is based on SQL Server 2005.Some concepts in the slides may refer toprevious versions of SQL Server - forreference.Most of the class will be applicable to anydatabase environment…
  5. 5. TextsRECOMMENDED, not required. I do notteach from a book.Dewson, Beginning SQL Server 2005 forDevelopers: From Novice to Professional.Bowman et al, The Practical SQL Handbook… or any other books you are comfortablewith!
  6. 6. SQL Server 2005 For YOU!http://www.microsoft.com/sql/downloads/trial-so180-day trial.You can order a DVD for $5.99 + shipping.Don’t dally – 3 weeks average delivery.Will *NOT* install on Windows 95 or ME.Previous students highly recommend this.Good for mid-term and project.
  7. 7. Class ObjectivesThe student will understand the basics ofthe Relational Database Model.The student will learn DatabaseAdministration functions as appropriate forsoftware developers.The student will learn SQL.The student will become familiar with theentire implementation cycle of a clientserver application.And, you will build one.
  8. 8. SyllabusObjectivesSchedule of ClassesReadingGradingTentative?
  9. 9. What is a database?Ideas?
  10. 10. What is a Database?A collection of information.The implication is that there is somelogical ordering of the data stored in it.Databases are stored as one or morefiles, on one or more disks, on one ormore computers.
  11. 11. What is a DBMS?DataBase Management SystemA software system that is responsiblefor managing the data in the database.Provides an interface through whichother software applications store andretrieve data.Secondary functions: Backup,Distribution, etc.SQL Server, Oracle, DB2, MySQL,Access, etc.
  12. 12. Why use a database?Permanent Storage.Information is shared.Provide synchronized access - locking.Centralized security.Backups.
  13. 13. Types of Databases - ‘Flat’ Files A single file on a disk. Access is sequential. Operations on large files require enormous amounts of memory (or are very slow). Locking is all or nothing - flagged. Security is based on operating system privileges. The original.
  14. 14. Types of Databases - Indexed FilesStart with a flat file. Each item of data isthe same size, and they are in any order.A smaller external file exists which has‘key’ data, and a pointer or ‘index’ into thefile.Something like a table of contents.File is accessed by an offset like an arrayData of varying sizes not easily modeled.
  15. 15. Types of Databases - HierarchicalData is organized as a tree.Can use a single or multiple files.The Windows Registry.Network Database Model (structures thatcontain pointers to structures).
  16. 16. Types of Databases - Relational Data is organized in tables. Tables consist of rows and columns. Tables with related information are linked, allowing for data integrity. Locking can go as low as the row level (field level?).
  17. 17. Type of Databases - Object OrientedClasses define the data.An instance of a class is an object.Methods can be defined for classes thatcontain the application logic.Inheritance (subclasses) define data thatis related. Multiple inheritance allows forwide variations in the types ofrelationships.Locking at the object level.
  18. 18. System Architecture - MainframeThe database is on a mainframe.The application is also on the mainframe.Users access ‘dumb terminals’, which arecontrolled by the mainframe.Durable, reliable, centralized.EXPENSIVE!
  19. 19. System Architecture - PC / FileThe database and the DBMS are on thePC.4GLs define the application, which alsoruns on the PC.Optionally, the database is on the network.Large amounts of network traffic.Dbase, FoxPro, Access, etc.
  20. 20. System Architecture -The database Client/Server a server (or and DBMS are onset of severs).Application logic is split between the client andthe server.Less network traffic.Allowed for complicated applications involvingmultiple users on lower-cost equipment than amainframe.
  21. 21. Client/Sever - Fat ClientsThe bulk of the application logic resideson the client PC - the ‘workstation’.Allows very complex logic to beimplemented using programminglanguages.Can be more difficult to design andmanage.Requires application changes when‘business rules’ change.May require more network bandwidth.Decision Support Systems, Expert
  22. 22. Client/Server - Fat ServerThe server handles most business logic.Little or no application changes requiredwhen business rules change.Uses ‘transactions’.Implemented with referential integrity,stored procedures, and constraints.On-Line Transaction Processing (OLTP).Systems where orders are processed.
  23. 23. Client/Server - ‘Mixed Environments’A nice way to say somewhere in themiddle.Generally, all but very specific systemsshould be (and are) designed in thismanner.Systems that combine OLTP and decisionsupport functionality.
  24. 24. System Architecture - TiersClient/Server is passé – the new paradigm (and buzzword) is“n-tiered architecture”.As systems that grow from diverse needs require informationfrom each other, there may be multiple Servers as well asmultiple clients.In many cases the data from these servers is combined,processed, or amalgamated on yet another “Server”. Thissoftware is called middleware; the machine is often called abroker.A web server is sometimes considered a tier; in this case theclients are browser-based, and the distribution of applicationlogic can be divided across multiple tiers (Client side scripts?Server side ASP / Applets? Database sprocs?).You can describe a “fat tier” or a “dense tier” – the opposite of athin tier or a passthrough tier.
  25. 25. System Architecture - SOAsService-Oriented Architectures.SOAs are really free-from tiers with well-defined interfaces. Each should be, or maintainthe appearance of being, self contained.A service may have its own database; theremay be a single service that provides aninterface to the database.Services may be client or server side,whichever is appropriate.Each database server may be considered aservice of its own…
  26. 26. Application ExamplesFat Client - the advertising system.Fat Server - UPC generation.Mixed Environment - VersionManagement.All are somewhat mixed…Other examples?
  27. 27. ScalabilityHow big is too big?What is the line between MySQL, SQLServer, Oracle, and what lies beyond?Factors:– Size– Security– Usage (TPS)– Money– Performance Requirements– Nature of Transactions (Locking Strategies)
  28. 28. The Relational Model.Defined by Codd, 1969. (Jeopardy?)We will:– present the technical definition of each term.– translate that to standard vocab.This is useful for talking to Unix gurus andacademic types… but this is a Master’sprogram...
  29. 29. DomainsA set of values.Must be atomic - cannot be brokendown further with respect to thepurpose it is modeled for. For example,FULL_NAME can be atomic, as well asFIRST_NAME and LAST_NAMEdepending on the purpose of the field.Point is, you never want to use it as lessthan the whole thing.
  30. 30. DomainsA domain has a data type and optionally aname.Data type may be a simple PL data typesuch as integer or string, or may beconstrained in some way:– strings with a maximum length of 20 chars.– All integers less than 100.– The name of any city containing an NFL team.
  31. 31. DomainsGiving a domain a name is similar to #typedefin C - it allows you to change the valuesallowed in a domain used in multiple placeswith a single code change. Not a great idea ifyou are defining tables?Conceptually :TEAM_NAME = CHAR[26]SALARY_RANGE = {20000..200000}If you want to allow for longer team names,higher salaries...
  32. 32. Relation Schema“Table Definition”A name and a set of “attributes”attribute = columneach attribute has a name and a domain.the “degree of the relation” is the numberof columns in the table.
  33. 33. Relation InstanceRelation for short, or just Table.an instance of a relation schema.“a set of tuples, where a tuple is anordered list of values, and where eachvalue is in the domain of thecorresponding attributes in the relationschema being instantiated, or is aspecial null value”a set of unique rows, where each rowhas values that match the definition of
  34. 34. Null ValuesUsed to signify that either:A value does not apply– An apartment # of a person that lives in a house.A value is unknown– An unlisted phone #.Comparisons to null values returnUNKNOWN, not TRUE or FALSE.
  35. 35. Keys“by definition of a set, all tuples in arelation must be distinct.”No duplicate rows in a table.a ‘superkey’ is a set of columns that areunique in every row.a ‘key’ is a superkey which cannot haveany more columns taken away from itand still remain unique.
  36. 36. Primary KeyThe primary key is a key that has beenchosen as the identifying key for thattable.Usually, a synthetic value (customernumber, type id, etc.) is used. Thisabstracts the real data from the key.Example - product names.
  37. 37. Recaprelation schema - definition of a tablerelation - tableattribute - column or fieldtuple - rowsuperkey - set of columns guaranteedunique.key - a minimal superkeyprimary key - the key used as an id fora row.
  38. 38. Naming ConventionsMakes things easier to read.Should be different than PL code.My convention:– All database objects and attributes in upper case using underscores.– PL and PL/SQL variables in mixed, starting with lower– Other PL names (Functions, Classes) in mixed starting with caps.– Table names always singular (EMPLOYEE)
  39. 39. LabWhat is the SQL Server ManagementStudio?

×