Copyright © 2003-2008 Curt Hill SQL The Intergalactic Standard Database Query Language.

Slides:



Advertisements
Similar presentations
NTAUG Introduction in to use of SQL Peter Dominey Copyright © Peter Dominey 2004, Copyright © Peter Dominey 2004,
Advertisements

Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Murach’s Java SE 6, C21© 2007, Mike Murach & Associates, Inc.Slide 1.
What is MySQL? MySQL is a relational database management system (A relational database stores data in separate tables rather than putting all the data.
The Relational Model Class 2 Book Chapter 3 Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) (From ER to Relational)
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 David M. Kroenke Database Processing Chapter 2 Structured Query Language.
1 Relational Model. 2 Relational Database: Definitions  Relational database: a set of relations  Relation: made up of 2 parts: – Instance : a table,
The Relational Model Lecture 3 Book Chapter 3 Relational Data Model Relational Query Language (DDL + DML) Integrity Constraints (IC) From ER to Relational.
1 Foundations of Software Design Lecture 27: Java Database Programming Marti Hearst Fall 2002.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Introduction.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Nichelle K. Norris IS 373: World Wide Web Standards.
1 IT420: Database Management and Organization SQL: Structured Query Language 25 January 2006 Adina Crăiniceanu
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
The Relational Model These slides are based on the slides of your text book.
CSC2012 Database Technology & CSC2513 Database Systems.
Intro to JDBC To effectively use Java Data Base Connectivity we must understand: 1.Relational Database Management Systems (RDBMS) 2.JDBC Drivers 3.SQL.
True or False? Programming languages can be used to update databases and communicate with other systems. True.
The Relational Model. Review Why use a DBMS? OS provides RAM and disk.
Introduction to SQL Steve Perry
10/16/2015 1Yan Huang - Introduction Chapter 1: Introduction What is a DBMS? What is a DBMS? A little history of DB A little history of DB Major Components.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
Relational Databases Database Driven Applications Retrieving Data Changing Data Analysing Data What is a DBMS An application that holds the data manages.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Introduction to Relational Databases &
FEN  Data Definition: CREATE TABLE, ALTER TABLE  Data Manipulation: INSERT, UPDATE, DELETE  Queries: SELECT SQL: Structured Query Language.
Copyright © Curt Hill Stored Procedures In Transact-SQL.
FALL 2004CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
“INTRODUCTION TO DATABASE AND SQL”. Outlines 2  Introduction To Database  Database Concepts  Database Properties  What is Database Management System.
Tutorial 6 SQL Muhammad Sulayman
MySQL Database Management Systems Universitas Muhammadiyah Surakarta Yogiek Indra Kurniawan.
Lesson Overview 3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database Application 3.2 Components of The Database Application.
Copyright © by Curt Hill Database Introduction History Why we want to use them Other fun.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
Oracle & SQL Introduction. Database Concepts Revision DB? DBMS? DB Application? Application Programs? DBS? Examples of DBS? Examples of DBMS? 2Oracle.
Information Building and Retrieval Using MySQL Track 3 : Basic Course in Database.
Access The L Line The Express Line to Learning 2007 L Line L © Wiley Publishing All Rights Reserved.
Advanced Database CS-426 Week 1 - Introduction. Database Management System DBMS contains information about a particular enterprise Collection of interrelated.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
UNIVERSITAS MUHAMMADIYAH SURAKARTA DATABASE MANAGEMENT SYSTEM - INTRODUCTION.
The Relational Model Content based on Chapter 3 Database Management Systems, (Third Edition), by Raghu Ramakrishnan and Johannes Gehrke. McGraw Hill, 2003.
CS453: Databases and State in Web Applications (Part 2) Prof. Tom Horton.
12/6/2015B.Ramamurthy1 Java Database Connectivity B.Ramamurthy.
Copyright © Curt Hill Connectivity Communicating with the Database.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
Copyright 2003 Curt Hill Queries in SQL Syntax and semantics.
1 SY306 Web and Databases for Cyber Operations SQL: Structured Query Language.
Basics of JDBC Session 14.
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
Chapter 3 The Relational Model. Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. “Legacy.
Copyright © Curt Hill SQL The Data Manipulation Language.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
CENG 351 File Structures and Data Management1 Relational Model Chapter 3.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
© Virtual University of Pakistan Database Management System Lecture - 24.
SQL Introduction SQL stands for “Structured Query Language” and can be pronounced as “SQL” or “sequel – (Structured English.
Learn Structured Query Language to rule Database.
Oracle & SQL Introduction
Structured Query Language (SQL) William Klingelsmith
The Relational Model Content based on Chapter 3
The Relational Model Relational Data Model
Java Database Connectivity
The Relational Model Content based on Chapter 3
The Relational Model Content based on Chapter 3
Presentation transcript:

Copyright © Curt Hill SQL The Intergalactic Standard Database Query Language

What is it? Abbreviation of Structured Query Language Official pronunciation is spelled out S – Q – L Official as in from ISO/ANSI Often pronounced See-Quell Both work in this class Copyright © Curt Hill

Why SQL? A major strength of the relational model: supports simple, powerfulqueryingof data. Queries can be written intuitively, and the DBMS is responsible for efficient evaluation. – Precise semantics for relational queries. – Allows the optimizer to extensively re- order operations – Provided the answer does not change.

SQL – a requirement? A database does not need to offer SQL interpretation to be a classified as relational Commercially it is mostly a requirement Notice the names of some: –SQL-Server –MySql Copyright © Curt Hill

History Developed by IBM in system R –1974 – 1977 –Originally called SEQUEL for Structured English QUEry Language Used in some variation by all major relational DBs Standards: – SQL-86 – SQL-89 (minor revision) – SQL-92 (major revision) AKA SQL2 – SQL-1999 (major extensions) AKA SQL3 – SQL-2003 – SQL-2006 – SQL-2008

Standard? SQL is one of the least standardized common languages Why? Queries are specific to a single database –They must take into account table names and field names –Organizations have databases that contain data peculiar to them –Even similar databases will vary with regard to table and field names Copyright © Curt Hill

Variants It seems that each major database has its variants Accepts the basic language but: –Leaves out some pieces –Adds proprietary extensions We will try to examine the variations of the three major ones: –Oracle 10 –SQL Server –MySQL Copyright © Curt Hill

ODBC Online Data Base Connectivity Take commands from program Connect to a SQL based DB on the net ODBC handles two aspects: –The TCP/IP connection –Converting their SQL to the variant handled by this particular database and the format of the returned data JDBC –Java interface to ODBC Copyright © Curt Hill

Parts of the language Data Manipulation Language (DML) –This subset was influenced by the relational algebra and relational calculus –Gives us facility to: Generate queries Insert records Delete records Modify records Data Definition Language (DDL) –Used to define, update and delete databases, tables and views

Copyright © Curt Hill Faculty load query (calculus) Consider a sample query from the calculus { |  naid,dp,dg,ar,title(  Faculty)   Course   Faculty_Teach )}

Copyright © Curt Hill Faculty load query (SQL) Select f.name, c.dept, c.number, c.crhr From faculty as f, course as c, faculty_teach as ft Where f.naid=ft.naid AND ft.dept = c.dept AND ft.number = c.number Select is algebra or calculus From is set membership (calculus) Where is the implied equalities (calculus)