sql for the non - technician jeffrey walsh answerthink consulting group, inc
TRANSCRIPT
![Page 1: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/1.jpg)
SQL for the Non-Technician
Jeffrey Walsh
AnswerThink Consulting Group, Inc.
![Page 2: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/2.jpg)
Today’s Topics
An Introduction to Databases Structured Query Language Data Definition and Data Manipulation SQL versus SQL*Plus PL/SQL Database Security
![Page 3: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/3.jpg)
What the Heck is a Database?
Data Set of Elements Set of Operations
Database Data Definition Data Manipulation
![Page 4: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/4.jpg)
Structured Query Language
Standard Set of Commands Provides means for
Data Definition (DDL) Data Manipulation (DML)
![Page 5: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/5.jpg)
Data Manipulation
Select Statements Insert Statements Update Statements Delete Statements Data Conversion
![Page 6: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/6.jpg)
SELECT Statements
SELECT column1, column2, … column xFROM table, ... view, …WHERE where conditionGROUP BY group conditionORDER BY ordering criteria
![Page 7: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/7.jpg)
SELECT StatementsSELECT Segment1 ‘Company’, Segment2 ‘Division’, Segment3 ‘Account’, Segment4 ‘Sub-Account’FROM GL_Code_CombinationsWHERE Enabled_Flag = ‘N’ORDER BY Segment1, Segment2, Segment3, Segment4;
![Page 8: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/8.jpg)
INSERT StatementsINSERT INTO table_nameVALUES (list of values);
INSERT INTO table_name (list of columns)VALUES (list of values);
![Page 9: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/9.jpg)
INSERT StatementsINSERT INTO table_nameselect_statement;
INSERT INTO table_name (list of columns)select_statement;
![Page 10: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/10.jpg)
INSERT StatementsINSERT INTO FND_USER (user_name, end_date)VALUES (‘WALSHJ’, SYSDATE + 365);
![Page 11: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/11.jpg)
UPDATE StatementsUPDATE table_nameSET column = value, column = select_statement column, column = value …WHERE where condition;
![Page 12: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/12.jpg)
UPDATE StatementsUPDATE AP_Selected_Invoice_ChecksSET Vendor_Name = ‘Charles Keating’ WHERE Payment_Amount > 5000;
![Page 13: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/13.jpg)
DELETE StatementsDELETE FROM table_nameWHERE where_condition;
![Page 14: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/14.jpg)
DELETE StatementsDELETE FROM FND_UserWHERE User_Name = ‘WALSHJ’;
![Page 15: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/15.jpg)
Data Definition
Create Table Create View Create Sequence
![Page 16: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/16.jpg)
Data Types
Character Numbers Dates Binary Objects File Pointers
![Page 17: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/17.jpg)
Create TableCREATE TABLE table_name(column datatype, column datatype, …);
CREATE TABLE table_nameAS select_statement;
![Page 18: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/18.jpg)
Create TableCREATE TABLE Legacy_Vendors(Vendor_Name VARCHAR2(50), Vendor_Number VARCHAR2(10), Address1 VARCHAR2(50), Address2 VARCHAR2(50), City VARCHAR2(25), State VARCHAR2(2), Zip_Code VARCHAR2(10));
![Page 19: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/19.jpg)
Create TableCREATE TABLE Payroll_Code_CombinationsAS SELECT Segment1 Company, Segment2 Division, Segment3 Account, Segment4 SubAccount FROM GL_Code_Combinations WHERE Segment3 LIKE ‘45%’;
![Page 20: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/20.jpg)
Create ViewCREATE VIEW OR REPLACE view_nameAS select_statement;
![Page 21: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/21.jpg)
Create ViewCREATE VIEW OR REPLACE Payroll_Code_Combinations_VAS SELECT Segment1 Company, Segment2 Division, Segment3 Account, Segment4 SubAccount FROM GL_Code_Combinations WHERE Segment3 LIKE ‘45%’;
![Page 22: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/22.jpg)
Create SequenceCREATE SEQUENCE sequence_name;
CREATE SEQUENCE sequence_nameINCREMENT BY incrementSTART WITH starting_point;
![Page 23: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/23.jpg)
Create SequenceCREATE SEQUENCE Library_Card _Number;
CREATE SEQUENCE TAR_NumberINCREMENT BY 10START WITH 1000000.6;
![Page 24: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/24.jpg)
Data Conversion
Character to Numbers to_number(‘string’)
Character to Dates to_date(‘string’, ‘format’)
Dates to Characters to_char(date, ‘format’)
Numbers to Characters to_char(number, ‘format’)
![Page 25: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/25.jpg)
SQL versus SQL*Plus
SQL is a Standard SQL*Plus extends standard SQL
Editing DECODE COLUMN SET
![Page 26: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/26.jpg)
PL/SQL
Procedural Language Provides Structures
Sequence Iteration Alternation
Create Procedures, Functions, Packages Store Code in Database
![Page 27: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/27.jpg)
Database Objects
Tables Views Sequences Procedures Functions Packages Package Bodies
![Page 28: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/28.jpg)
Dropping Objects
Drop Table table_name; Drop View view_name; Drop Sequence sequence_name; Drop Package package_name; Drop Procedure procedure_name; Drop Function function_name;
![Page 29: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/29.jpg)
Database Security
Privileged Users SYS SYSTEM APPLSYS APPS
Users with Critical Data GL, AP, AR, etc.
![Page 30: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/30.jpg)
Database Security
Oracle Applications Tables Columns Creation_Date Created_By Last_Update_Date Last_Updated_By
![Page 31: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/31.jpg)
Database Security
Holes In Security Copy of Production for Development/Test Discoverer Express Analyzer Third Party Applications that require DBA
![Page 32: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/32.jpg)
Database Security
Plugging the Holes Protect Passwords Separate DBAs Archive Logs
![Page 33: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/33.jpg)
Things We Didn’t Discuss
Sets (Union, Intersection, Minus) Joins Indexes Triggers Grants Constraints Data Dictionary Database Administration
![Page 34: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/34.jpg)
The Next Step
Get A Book Oracle Press
Oracle8 The Complete Reference For Dummies Series O’Reilly & Associates
Get Personal Oracle8 Attend Classes Practice
![Page 35: SQL for the Non - Technician Jeffrey Walsh AnswerThink Consulting Group, Inc](https://reader035.vdocuments.site/reader035/viewer/2022081603/56649f1f5503460f94c37e56/html5/thumbnails/35.jpg)
Questions?