20
Introduction to Introduction to SEQUEL SEQUEL

Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Embed Size (px)

Citation preview

Page 1: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Introduction to Introduction to SEQUELSEQUEL

Page 2: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

What is SEQUEL?What is SEQUEL?

Acronym for Structural English Query Acronym for Structural English Query LanguageLanguage

Standard language to access & manipulate Standard language to access & manipulate data and structures within a relational data and structures within a relational database.database.

See the Basics of SEQUEL tutorial for more See the Basics of SEQUEL tutorial for more information: information: http://www.w3schools.com/sql/default.asp

Page 3: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

What is MySQL?What is MySQL?

A DBMS with application A DBMS with application development tools for building development tools for building client/server apps.client/server apps.

Contains multiple data structures:Contains multiple data structures:Tables for data storageTables for data storageViews for holding data from tablesViews for holding data from tablesSequence for generating primary keySequence for generating primary keyIndex for improving performance of Index for improving performance of

queriesqueries

Page 4: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Accessing the MySQL Accessing the MySQL EnvironmentEnvironment

Register for your student Web space Register for your student Web space and log in to the C-panel. Video and log in to the C-panel. Video instructions can be found at instructions can be found at http://www4.uwm.edu/sois/resources/it/webspace/

Click the “home” icon at the top-left.Click the “home” icon at the top-left.Click “phmMyAdmin” under Click “phmMyAdmin” under

“Databases”“Databases”

Page 5: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Input AreaInput Area

Used for writing scriptsUsed for writing scriptsSupports use of Backspace and Supports use of Backspace and

DeleteDeleteSupports Cut, Copy, & Paste Supports Cut, Copy, & Paste

functionsfunctions

Page 6: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Script OutputScript Output

Displayed on Work Screen below Input AreaDisplayed on Work Screen below Input Area

OROR

Displayed on a separate windowDisplayed on a separate window

OROR

Saved to a file on client machineSaved to a file on client machine

Page 7: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

SEQUEL FeaturesSEQUEL FeaturesUses set English phrases to Uses set English phrases to

manipulate databasemanipulate databaseNon procedural (Specify information Non procedural (Specify information

not navigation or operations to not navigation or operations to access data). access data).

Encompass a range of users - DBA's, Encompass a range of users - DBA's, application programmers, application programmers, management and end users.management and end users.

Page 8: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

SEQUEL RulesSEQUEL Rules

Commands may be on one or many Commands may be on one or many lineslines

Clauses are placed on separate linesClauses are placed on separate linesCommand words are split across Command words are split across

lineslinesCommands are not case sensitiveCommands are not case sensitiveCommand entered at SEQUEL Command entered at SEQUEL

promptprompt

Page 9: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

SEQUEL Enabled TasksSEQUEL Enabled Tasks

• Query dataQuery data• Insert, update and delete dataInsert, update and delete data• Create, modify and delete database Create, modify and delete database

objectsobjects• Control access to database and its Control access to database and its

objectsobjects• Guarantee database consistencyGuarantee database consistency• Monitor database performance & Monitor database performance &

configurationconfiguration

Page 10: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

SEQUEL Sub-languagesSEQUEL Sub-languages

Data Control LanguageData Control LanguageUsed to give and take access rights to Used to give and take access rights to

database objects.database objects.E.g. E.g. RIGHTS REVOKE GRANT  REVOKE GRANT 

DATA DEFINITION LANGUAGE DATA DEFINITION LANGUAGE Used to manipulate database structures and Used to manipulate database structures and

definitions.definitions. E.g. DROP TRUNCATE CREATE ALTERE.g. DROP TRUNCATE CREATE ALTER

Page 11: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

SEQUEL Sub-language (Cont’d)SEQUEL Sub-language (Cont’d)

DATA MANIPULATION LANGUAGE DATA MANIPULATION LANGUAGE Used to change database data.Used to change database data. E.g. INSERT, UPDATE, DELETE E.g. INSERT, UPDATE, DELETE 

DATA QUERY LANGUAGE DATA QUERY LANGUAGE Used to get data from the database and impose Used to get data from the database and impose

ordering upon it.ordering upon it. E.g. SELECTE.g. SELECT

Transaction ControlTransaction Control E.g. COMMIT, ROLLBACK, SAVEPOINTE.g. COMMIT, ROLLBACK, SAVEPOINT

Page 12: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

DATA DEFINITION LANGUAGE DATA DEFINITION LANGUAGE (DDL)(DDL)

A set of commands to create, modify A set of commands to create, modify and delete database structures (not and delete database structures (not data). data).

Are immediate, not susceptible to Are immediate, not susceptible to ROLLBACK commands. ROLLBACK commands.

Only for users having CREATE object Only for users having CREATE object privilege and a Table space area to privilege and a Table space area to create objects (DBA, database designer, create objects (DBA, database designer, application developer).application developer).

Page 13: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Some DDL TasksSome DDL Tasks

Creating tables with constraintsAltering tables and constraintsDDeleting tables and constraintsRenaming database objectsDeleting all data from a tableIndexes, , Sequences, , Views

Page 14: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

DATA MANIPULATION DATA MANIPULATION LANGUAGE (DML)LANGUAGE (DML)

Data manipulation language is the area of Data manipulation language is the area of SEQUEL that allows you to change data SEQUEL that allows you to change data within the database.within the database.

Consists of three command statement Consists of three command statement groups - INSERT, UPDATE and DELETE.groups - INSERT, UPDATE and DELETE.

Page 15: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Some DML TasksSome DML Tasks

Inserting new rows into a tableCopying rows from another tableChanging row values with UPDATEUsing Subqueries in an UPDATE com

mandDeleting rows with DELETETransactions

Page 16: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

DATA QUERY LANGUAGE DATA QUERY LANGUAGE (DQL)(DQL)

The SELECT statement is the heart of The SELECT statement is the heart of SEQUEL. SEQUEL.

It allows retrieving & processing data from It allows retrieving & processing data from database.database.

Result of a SELECT is compiled into a Result of a SELECT is compiled into a temporary table, displayed on the temporary table, displayed on the screen.screen.

Page 17: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Some DQL TasksSome DQL Tasks

Get all table data Perform arithmetic on column values as they

are queried Preventing duplicate row selectionPreventing duplicate row selection Slice the result set by row numberSlice the result set by row number Breaking result sets into groupsBreaking result sets into groups Using SELECT against more than one tableUsing SELECT against more than one table Queries on QueriesQueries on Queries

Page 18: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Data Control LanguageData Control Language(DCL)(DCL)

Oracle implements a decentralized Oracle implements a decentralized security model. security model.

DBA creates a user and issues DBA creates a user and issues various system privileges . various system privileges .

System object rights are given and System object rights are given and taken away by GRANT and taken away by GRANT and REVOKE.REVOKE.

Page 19: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Some DCL TasksSome DCL Tasks

Object Privileges - GRANTObject Privileges - GRANTObject Privileges - REVOKEObject Privileges - REVOKE

Page 20: Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language

Learning Resources (Refer to Learning Resources (Refer to your syllabus for URLs)your syllabus for URLs)

Basics of SEQUEL TutorialBasics of SEQUEL TutorialMySQL Manual 5.6 Chapters 11 & 13MySQL Manual 5.6 Chapters 11 & 13MySQL Tutorial 5MySQL Tutorial 5Sample Scripts can be found in this Sample Scripts can be found in this

week’s Content module on D2L.week’s Content module on D2L.