Eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA 91101 USA 626-535-9658 www.eriscorp.com SQL Overview Introduction to SQL for.

Slides:



Advertisements
Similar presentations
Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
Advertisements

Basic SQL Introduction Presented by: Madhuri Bhogadi.
Let’s try Oracle. Accessing Oracle The Oracle system, like the SQL Server system, is client / server. For SQL Server, –the client is the Query Analyser.
Beginning SQL Tutorial Author Jay Mussan-Levy. What is SQL?  Structured Query Language  Communicate with databases  Used to created and edit databases.
Chapter 8 Special-Purpose Languages. SQL SQL stands for "Structured Query Language". Allows the user to pose complex questions of a database. It also.
Introduction to Structured Query Language (SQL)
SQL components In Oracle. SQL in Oracle SQL is made up of 4 components: –DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE. Creates / Alters.
This course has taken from This unique introductory SQL tutorial not only provides easy-to-understand SQL instructions, but it allows.
CSE 190: Internet E-Commerce Lecture 10: Data Tier.
SQL SQL stands for Structured Query Language SQL allows you to access a database SQL is an ANSI standard computer language SQL can execute queries against.
30-Jun-15 SQL A Brief Introduction. SQL SQL is Structured Query Language Some people pronounce SQL as “sequel” Other people insist that only “ess-cue-ell”
Introduction to Structured Query Language (SQL)
DAY 21: MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Akhila Kondai October 30, 2013.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Chapter 5 Introduction to SQL. Structured Query Language = the “programming language” for relational databases SQL is a nonprocedural language = the user.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Database A collection of related data. Database Applications Banking: all transactions Airlines: reservations, schedules Universities: registration, grades.
SQL data definition using Oracle1 SQL Data Definition using Oracle.
Database Technical Session By: Prof. Adarsh Patel.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
SQL data definition using Oracle1 SQL Data Definition using Oracle.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
Eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA XML Overview Introduction to XML for.
SQL SQL Server : Overview SQL : Overview Types of SQL Database : Creation Tables : Creation & Manipulation Data : Creation & Manipulation Data : Retrieving.
Eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Reporting made easy DataReady for web-based.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Topic 1: Introduction to SQL. SQL stands for Structured Query Language. SQL is a standard computer language for accessing and manipulating databases SQL.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
SQL Basic. What is SQL? SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database.
Tables and Constraints Oracle PL/SQL. Datatypes The SQL Data Definition Language Commands (or DDL) enable us to create, modify and remove database data.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
# 1# 1 Creating Tables, Setting Constraints, and Datatypes What is a constraint and why do we use it? What is a datatype? What does CHAR mean? CS 105.
Visual Programing SQL Overview Section 1.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
Information Technology Structured Query Language Grade11.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Week 8-9 SQL-1. SQL Components: DDL, DCL, & DML SQL is a very large and powerful language, but every type of SQL statement falls within one of three main.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
IS6146 Databases for Management Information Systems Lecture 3: SQL III – The DDL Rob Gleasure robgleasure.com.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
SQL Introduction to database and SQL. Chapter 1: Databases and Database Users 6 Introduction to Databases Databases touch all aspects of our lives. Examples:
CSC314 DAY 8 Introduction to SQL 1. Chapter 6 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SQL OVERVIEW  Structured Query Language  The.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
CS320 Web and Internet Programming SQL and MySQL Chengyu Sun California State University, Los Angeles.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
Physical Model Lecture 11. Physical Data Model The last step is the physical design phase, In this phase data is – Store – Organized and – Access.
BTM 382 Database Management Chapter 8 Advanced SQL Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia.
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.
Rob Gleasure robgleasure.com
Web Systems & Technologies
SQL Query Getting to the data ……..
Chapter 5 Introduction to SQL.
CS320 Web and Internet Programming SQL and MySQL
DATABASE MANAGEMENT SYSTEM
STRUCTURED QUERY LANGUAGE
SQL data definition using Oracle
Database systems Lecture 3 – SQL + CRUD
SQL-1 Week 8-9.
CS3220 Web and Internet Programming SQL and MySQL
MIS2502: Data Analytics SQL 4– Putting Information Into a Database
CS3220 Web and Internet Programming SQL and MySQL
Presentation transcript:

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA SQL Overview Introduction to SQL for the MultiValue Developer

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Why are we here? Many MultiValue developers now are working with the various relational databases We want to look at common commands and data structures for SQL databases We want to see how they relate to the MultiValue

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA eris Database to Web integration since 1992 Customers with up to $2 Billion in annual revenue Clients throughout North America Education, Medical, Manufacturing, EDI, Distribution, Sales Force Automation, Help Desk, and Reporting Systems e-Commerce and database product development, e.g., WebWizard, DataReady, mv://e-Store Los Angeles and Chicago offices

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Agenda About eris SQL Overview –Basics –Reporting –Database maintenance

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA What is SQL? Standard Query Language Used to communicate with the database –Get data –Maintain data –Create data

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Standard SQL? Not really Similar related languages (think Latin) –You need to understand the dialect –Be able to compare what yours has vs others Hmm…Think MultiValue

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Basic parts of SQL Data Definition Language (DDL) Database Manipulation Language (DML) Database Control Language (DCL) Database Stored Procedure Language (DSPL)

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Data Definition Language (DDL) Defines the database environment Varies most among the various SQL flavors Covers –Database –Design Structures –Related System Tables –Metadata Schemas Catalogs Stored Procedures Other structural elements

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Database Manipulation Language (DML) Reasonably standardized. We'll look at DML later on Problems arise not in what they offer but what they might not have –Types of joins –Sub-queries

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Database Control Language (DCL) How to maintain and configure the database Permission, roles, and referential integrity –Grant –Check –Constraint –Primary Key –Foreign Key Fairly dissimilar among the various flavors

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Database Stored Procedure Language (DSPL) All the previous variations compound when you get to this section Triggers Event handler Stored procedures Can barely compare –Oracle's PL/SQL –SQL Server's Transact SQL –DB2's Stored Procedures

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Reporting – Which SQL? Microsoft SQL Server mySQL Oracle DB2 SQLite SQLAnywhere MultiValue, such as in uniVerse/UniData

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA What does a table look like? citystatehighlow Las VegasNevada11590 PasadenaCalifornia8857 PasadenaTexas9281 Santa MonicaCalifornia7767 Weather

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Lingo Row –Record Column –Attribute / Field

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA How do I list? Select select high, low from Weather where city like “%Pasa%”; select * from Weather where city = “California”;

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Selecting Data “select” is comparable to “LIST” Syntax: select column1 [,column2,etc or * for all] from tablename [where condition] ; Compare with –LIST "tablename" "column1" "column2" WITH "condition"

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Roster database firstlastidagecity EricEdwards210117San Diego JohnJohnson180117Pasadena SamJoliet131417Pasadena MaryJones134216Altadena EricTaylor241216Pasadena JosephTyler144217Pasadena JaniceWilliams144616Pasadena

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Sample queries select first, last, city from roster; select last, city, age from roster where age > 30; select first, last, city, state from roster where first like 'J%'; select * from roster; select first, last, from roster where last like '%s'; select first, last, age from roster where last like '%on%'; select * from roster where first = 'Eric';

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Sample operators in Joins, Where and Having And, Or, Not –itemWidth > 11 and itemHeight < 14 –not (region = "E" or sales < quota) Is Null, Is Not Null –Nulls occur when no data value has been entered into a field. Different from MultiValue Between –a shorthand way to refer to a range –totalSales between 1500 and 1800

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA More operators In, Not In - allows table lookups –vehicleType in ("sedan", "roadster", "2-door") –sportPlayed not in ("tennis","squash", "badminton", "raquetball") Like –one of the most powerful for searches within a text or varchar field –Think “…” or “[“ and “]” in MultiValue –Supports text search patterns which work like but not identically the same in syntax as regular expressions from Unix and XML

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Like, Even More Operators "%" is any length (think "*" in DOS) "_" is a single character (think "?" in DOS) [] lists valid characters at the point: [mp]a[nt] can be map, mat, pan, pat [0-9] means a numeric character [^] lists excluded characters

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Inner Joins This is what makes SQL "relational“ It joins tables Similar to translates in MultiValue Syntax: select list-of-columns from tablename1,tablename2 where search-condition(s) ;

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Imagine an Inner Join customers table –customer_id –firstname –lastname –address –city –state –zip sales table –sale_id –cust_id –date –Item –price select customers.firstname, customers.lastname, sales.item from customers, sales where customers.customer_id = sales.cust_id;

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA No need for a new dictionary element The columns have the table name in front A period separates the table name from the column name –This is opional but is very recommended. It is required if the name column names are the same between the two tables.

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Alternate Syntax select customers.firstname, customers.lastname, sales.item from customers, sales where customers.customer_id = sales.cust_id; select customers.firstname, customers.lastname, sales.item from customers inner join sales on customers.customer_id = sales.cust_id;

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Database Maintenance Creating tables Adding records Editing records Deleting records

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Creating tables Analogous to CREATE-FILE / CREATE.FILE Syntax: create table tablename (column1 datatype, …) ; Table and Column names –must start with a letter –can be followed by letters, numbers, or underscores –not to exceed a total of 30 characters in length –Do not use any SQL reserved keywords

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Common Data types char(size)Fixed-length character string. Size is specified in parenthesis. Max 255 bytes. varchar(size)Variable-length character string. Max size is specified in parenthesis. number(size)Number value with a max number of column digits specified in parenthesis. dateDate value number(size,d)Number value with a maximum number of digits of "size" total, with a maximum number of "d" digits to the right of the decimal.

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Add records - Insert Syntax: insert into tablename (first_column,...,last_column) values (‘first_value’,...,’last_value’); Strings need single-quotes! Example: insert into customers (first, last, age, address, city, state) values ('Joe', 'Johnson', 21, '199 Los Robles', 'Pasadena', 'California');

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Updating Records - Update and where Syntax: update tablename set first_column = new_value [,next_column = newvalue2 …] where condition [and|or condition2 …];

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Examples update phone_book set area_code = 323 where prefix = 213; update phone_book set prefix=555, suffix=9292 where last_name = 'Jones' and first_name = 'John' ; update employee set age = age+1 where first_name='Mary' and last_name='Williams';

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Deleting records Syntax: delete from tablename where condition [and|or condition2 …]; Warning! if you leave off the where clause, all records will be deleted!

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Bottom Line SQL has the very same intent, functionality, and general purpose across database vendors - users have had to get used to working in dialects. SQL interoperability is a problem. It provides the Rosetta Stone of a standard, common syntax for data interchange not just between relational databases; but also structured data in general.

eagle rock information systems 199 So Los Robles, Suite 860, Pasadena, CA USA Contact us Main Office:199 S. Los Robles Ave, Suite 860 Pasadena, CA Tel: (626) Fax: (626) eriscorp.com