Your SlideShare is downloading. ×
SQL overview and software
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide
  • 04/11/11 CIS-182 SQL
  • Transcript

    • 1. SQL Overview CIS-182
    • 2. Structured Query Language
      • Language used to work with databases
      • Used in ‘back end’
        • Typically not part of user interface (don’t expect users to type in a query…)
    • 3. SEQEL to SQL
      • Structured English Query Language developed by IBM
      • Other companies developed similar products
      • ANSI set standards in 1986
        • Standards are ‘open’
        • Different vendors have different levels of conformance
    • 4. SQL
      • Most languages are procedural
        • Describe how to perform a task
      • SQL is non-procedural (declarative)
        • Code describes results
        • Includes some procedural components
          • If … Then, Loops
      • Database apps typically use both types of languages
        • Procedural languages manage interface, data requests
        • SQL manages data storage and retrieval
    • 5. Types of SQL Statements
      • Data Definition Language (DDL): Create/edit objects
        • CREATE, ALTER
      • Data Control Language (DCL): Specify access and permissions
        • GRANT, REVOKE
      • Data Manipulation Language (DML): Work with data
        • SELECT * FROM Employees
        • INSERT INTO Students
    • 6. Logical Organization
      • Catalogs: group of schemas
      • Schema: group of related tables, views
      • Implementation is up to vendor
        • Some vendors use catalogs, some don’t
        • Vendors have different levels of support for schemas
    • 7. Databases
      • ‘ Database’ is not an ANSI specification
      • Most vendors have a database object
      • In practice, schema and database tend to be viewed interchangeably
        • Schema defines the contents of a database
        • May have sub-schemas to reflect application needs (include only a portion of the database)
    • 8. Coding
      • One command may extend across several lines
        • [Enter] doesn’t represent the end of a statement
        • SQL uses ; (semi-colon) to identify statement end
          • ; is optional in SQL Server
      • Keywords are capitalized
        • CREATE DATABASE MyNewDatabase
      • No standard conventions for naming
        • Typically use Pascal case naming with each new word capitalized
    • 9. Naming Requirements
      • Object names are not typically case sensitive
        • Delimited identifiers wrap names in double quotes and ARE case sensitive
        • “ MyNewTable” uses double quotes to identify the object name
        • Single quotes identify strings (text)
      • Can use letters, numbers, underscore
        • Can’t use spaces, punctuation
    • 10. Qualified Names
      • A qualified name defines explicitly how to find an object
        • ‘ .’ is used as separator
      • SQL Server uses ServerName.DatabaseName.OwnerName.ObjectName
      • OR
      • ServerName.DatabaseName.SchemaName.ObjectName
    • 11. Coding Reference
      • SQL Server uses special characters to identify different parts of commands
      • End of statement: ;
        • Optional in SQL Server
      • Placeholder: <>
      • Placeholder Definition: ::=
      • Optional Parameter(s): [ ]
      • Specific Parameter Values: { }
      • Value Separator: |
      • List Separator: ,
    • 12. Placeholder Example
      • Basic command definition:
        • ON UPDATE <referential action>
        • <referential action> ::= CASCADE|SET NULL
      • <referential action> is placeholder
      • CASCADE|SET NULL is placeholder definition (placeholder value must be one of these choices)
    • 13. Database Connections
      • Database applications typically separate the user interface and data management
        • A connection provides access to data, describing how to read and where to find data
      • Client/Server : Data requests are passed from application to data server (for example from Access to Jet database engine and data file)
      • N-tiered Applications : Data requests are passed through several layers between application and data server
    • 14. Common Database Engines
      • Jet: Database engine for Microsoft Access and Data Access Objects/Controls. Oriented to small, local applications or limited number of users
      • Servers: Typically used as a database server (provide relational data to another program) and as a warehouse (data may not be structured in tables)
        • Commercial: SQL Server, Oracle, DB2
        • Open Source: MySQL, Postgre
    • 15. SQL Server
      • Microsoft SQL Server has three versions that are commonly in use
        • SQL Server 2008/SQL Server 2008 R2
        • SQL Server 2005
      • Either version is suitable for CIS-182
      • Other database software can be used for CIS-182 – no support is available from faculty or staff and work cannot be done on-campus
        • Access does not directly offer all the capabilities needed for CIS-182
    • 16. SQL Server Editions
      • SQL Server is available in different editions
        • Each edition is targeted to a specific use or environment
      • Express Edition is a free download and suitable for CIS-182
        • Make sure to download Management Studio Express
      • Developer Edition is available for free download after the first week and registration with Microsoft and also suitable for CIS-182
        • provides registered students with access to all MS developer tools, including SQL Server
    • 17. Management Studio
      • Microsoft GUI for most SQL Server operations
        • Additional applications manage overall server security, business intelligence
      • Separate application from SQL Server
        • Uses a connection to send commands and capture results
        • SQL Server is not something we’ll work with directly