목차 SQL 표준 (ISO) SQL 실행 순서 및 명칭 부분 범위 처리 ( 다움기회에..) 인덱스 선정 ( 다음기회에..) DBMS 비교 최적화 데이터 설계 why sql learn??

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

Data Definition and Integrity Constraints
Stored procedures Procedural programming in Microsoft SQL Server 1Stored procedures.
SQL: Standards and Flavors A presentation for CS157B by David Wortham.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 28 Database Systems I The Relational Data Model.
Midterm Review Lecture 14b. 14 Lectures So Far 1.Introduction 2.The Relational Model 3.Disks and Files 4.Relational Algebra 5.File Org, Indexes 6.Relational.
A Comparison of Database Software CS 616 April 8, 2004 Team 7 Mandar Patankar Jonathan Cohen B. Timothy Walsh.
Introduction to Structured Query Language (SQL)
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
SQL/Server Stephen Cunningham Thema Davis. Problem Domain Designed for retrieval and management of data Defines the structures and operations of a data.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Database Systems Lecture 5 Natasha Alechina
Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial Password: UWPstudent Password is case sensitive.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
SQL Basics. SQL SQL (Structured Query Language) is a special-purpose programming language designed from managing data in relational database management.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 13 Managing Databases with SQL Server 2000.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
Using XML in SQL Server 2005 NameTitleCompany. XML Overview Business Opportunity The majority of all data transmitted electronically between organizations.
DBA Developer. Responsibilities  Designing Relational databases  Developing interface layer Environment Microsoft SQL Server,.NET SQL Layer: Stored.
Introduction to Databases Chapter 7: Data Access and Manipulation.
Module 4: Data Objects. Overview Tables are the main objects that store data Indexes, views, stored programs and other objects are the support structures.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
SQL data definition using Oracle1 SQL Data Definition using Oracle.
Lecture 4 PL/SQL language. PL/SQL – procedural SQL Allows combining procedural and SQL code PL/SQL code is compiled, including SQL commands PL/SQL code.
Overview of Standard Query Language (SQL) Saeideh Joodaki Instructor: Dr.Yingshu Li.
CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Stored Procedures, Triggers, Program Access Dr Lisa Ball 2008.
SQL data definition using Oracle1 SQL Data Definition using Oracle.
CSC 2720 Building Web Applications Database and SQL.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
Chapter 2: SQL – The Basics Objectives: 1.The SQL execution environment 2.SELECT statement 3.SQL Developer & SQL*Plus.
5/24/01 Leveraging SQL Server 2000 in ColdFusion Applications December 9, 2003 Chris Lomvardias SRA International
SQL Data Definition Language (DDL) Using Microsoft SQL Server 1SDL Data Definition Language (DDL)
Chapter 3 Concise History of SQL IFS Intro. to Data Management.
Microsoft SQL Server 2000 Cheng Ji November 3, 2003.
Advanced SQL Instructor: Mohamed Eltabakh 1 Part II.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
What’s New In Denali - TSQL David Ballantyne. Who am I Kent.Net/SqlServer.
Database Application Development using PL/SQL Programming.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Prepared by The Smartpath Information Systems
MySQL More… 1. More on SQL In MySQL, the Information Schema is the “Catalog” in the SQL standard SQL has three components: Data definition Data manipulation.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Visual Programing SQL Overview Section 1.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
GLOBEX INFOTEK Copyright © 2013 Dr. Emelda Ntinglet-DavisSYSTEMS ANALYSIS AND DESIGN METHODSINTRODUCTORY SESSION EFFECTIVE DATABASE DESIGN for BEGINNERS.
Week 4 Lecture Part 2 of 3 Structured Query Language (SQL) Samuel ConnSamuel Conn, Faculty Suggestions for using the Lecture Slides.
1 CS 430 Database Theory Winter 2005 Lecture 10: Introduction to SQL.
Slide 1 Chapter 7 – Part 3 Stored Procedure, Function &Trigger.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Ch 5. Introducing More Database Objects. Database Objects Table (ch2) View (ch3) Stored Procedure Trigger Function User-defined types.
1 Announcements Reading for next week: Chapters 6 and 7  Next-to-Last reading from the text for a little while (I promise) Your database accounts should.
IT420: Database Management and Organization Triggers and Stored Procedures 24 February 2006 Adina Crăiniceanu
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
uses of DB systems DB environment DB structure Codd’s rules current common RDBMs implementations.
Physical Model Lecture 11. Physical Data Model The last step is the physical design phase, In this phase data is – Store – Organized and – Access.
1 Stored Procedure, Function and Trigger. 2Objectives 1. Database Programming 2. Stored Procedure 3. Function 4. Trigger.
BTM 382 Database Management Chapter 8 Advanced SQL Chitu Okoli Associate Professor in Business Technology Management John Molson School of Business, Concordia.
Implementing Functions Advanced Database Dr. AlaaEddin Almabhouh.
CS320 Web and Internet Programming SQL and MySQL
SQL Server 2000 and Access 2000 limits
Database Application Development
DATABASE MANAGEMENT SYSTEM
Database systems Lecture 3 – SQL + CRUD
PL/SQL week10.
Database Application Development
Presentation transcript:

목차 SQL 표준 (ISO) SQL 실행 순서 및 명칭 부분 범위 처리 ( 다움기회에..) 인덱스 선정 ( 다음기회에..) DBMS 비교 최적화 데이터 설계 why sql learn??

SQL 표준 (ISO) YearNameAliasComments 1986SQL-86SQL-87First published by ANSI. Ratified by ISO in 1987.ANSIISO SQL-89Minor revision. 1992SQL-92SQL2Major revision (ISO 9075). 1999SQL:1999SQL3Added regular expression matching, recursive queries, triggers, non- scalar types and some object-oriented features. (The last two are somewhat controversial and not yet widely supported.) 2003SQL:2003 Introduced XML-related features, window functions, standardized sequences and columns with auto-generated values (including identity-columns).XML 2006SQL:2006 ISO/IEC :2006 defines ways in which SQL can be used in conjunction with XML. It defines ways of importing and storing XML data in an SQL database, manipulating it within the database and publishing both XML and conventional SQL-data in XML form. In addition, it provides facilities that permit applications to integrate into their SQL code the use of XQuery, the XML Query Language published by the World Wide Web Consortium (W3C), to concurrently access ordinary SQL-data and XML documents.XQueryW3C

SQL 실행 순서 및 명칭 SQL SELECT 이름, ( SELECT count(*) FROM 가족 B WHERE A. 사원번호 = B. 사원번호 ) 가족수, 봉급 FROM ( SELECT 이름, SAL, 부서번호 FROM 사원 WHERE SAL > 200 ) A WHERE 부서번호 IN ( SELECT 부서번호 FROM 부서 WHERE 부서명 = ‘ 개발팀 ’); 스칼라서브 쿼리 inline view nested sub query main query

툴을 사용한 실행 계획 nested subquery inline view 스칼라 서브 쿼리

sqlplus id/pwd sqlplus>set autotrace on

SQL Server 2000 vs MySQL 4.1 FeatureT-SQL MySQL dialect Views General Views, Indexed Views, Distributed Partitioned Views Not Supported Triggers AFTER triggers, INSTEAD OF triggers Not Supported Stored Procedures T-SQL statements Not Supported User-defined functions Scalar functions, Inline table-valued functions, Multistatement table-valued functions C, C++ external libraries Foreign KeysSupported Supported for only InnoDB tables CursorsSupported Not Supported ArraysNot SupportedSupported Feature SQL Server 2000 MySQL v4.1 column name length12864 index name length12864 table name length12864 max indexes per table25032 index length max index column length columns per index16 max char() size max varchar() size max blob size max number of columns in GROUP BY Limited on ly by numb er of bytes (8060) 64 max number of columns in ORDER BY Limited on ly by numb er of bytes (8060) 64 tables per SELECT statement25631 max columns per table max table row length longest SQL statement constant string size in SELECT SQL Server 2000 and MySQL v4.1 limits Features comparison

SQL Server 2000 vs Oracle 9i FeaturePL/SQLT-SQL Indexes B-Tree indexes, Bitmap indexes, Partitioned indexes, Function-based indexes, Domain indexes B-Tree in dexes Tables Relational tables, Object tables, Temporary tables, Partitioned tables, External tables, Index organized tables Relationa l tables, Temporar y tables Triggers BEFORE triggers, AFTER triggers, INSTEAD OF triggers, Database Event triggers AFTER tri ggers, INSTEAD OF trigge rs Procedures PL/SQL statements, Java methods, third-generation language (3GL) routines T-SQL sta tements ArraysSupported Not Supp orted Feature SQL Serve r 2000 Oracle 9i Database database name length1288 column name length12830 index name length12830 table name length12830 view name length12830 stored procedure name length12830 max columns per index1632 max char() size max varchar() size max columns per table max table row length max query size recursive subqueries4064 constant string size in SELECT constant string size in WHERE Features comparisonSQL Server 2000 and Oracle 9i limits

최적화 1.OS 자 원의 튜 닝 2. 인스턴스 튜닝 3. 어플리케이션의 튜닝 4. 오브젝트의 튜닝 5.SQL 튜닝 6.DB 설계 변경 ( 튜닝 ) 7.Architecture 변경 SE DBA 개발자, SE DBA, 개발 자 DBA DBA, 개발 자 개발자, DBA, SE

Architectue 변경 apache + shared server tomcat + dedicated server why???

MS-SQL 의 최적화 설계 CREATE TABLE BBS_T ( NAME varchar (10) NULL, varchar (100) NULL, SUBJECT varchar (100) NOT NULL, CONTENT text NOT NULL, REGI_DATE smalldatetime NOT NULL, IP varchar (15) NOT NULL, CNT int NOT NULL, GROUP_ID int NOT NULL, DEPTH int NULL, GROUP_ORDER int NOT NULL ) ON [PRIMARY] GO CREATE UNIQUE CLUSTERED INDEX PK_BBS_T ON dbo.BBS2_T (GROUP_ID DESC, GROUP_ORDER ASC) GO

Stored Procedure 사용 CREATE PROCEDURE int int output AS begin int -- 레코드갯수 얻기 = COUNT(GROUP_ID) FROM BBS_T (NOLOCK) -- 페이지 갯수 얻기 = 0 = 1 else = set else set - set SELECT NAME, , SUBJECT, REGI_DATE, CNT, GROUP_ID, GROUP_ORDER, DEPTH FROM ( SELECT TOP +' NAME, , SUBJECT, REGI_DATE, CNT, GROUP_ID, GROUP_ORDER, DEPTH FROM ( SELECT TOP +' NAME, , SUBJECT, REGI_DATE, CNT, GROUP_ID, GROUP_ORDER, DEPTH FROM BBS_T (NOLOCK) ) AS D2 ORDER BY GROUP_ID ASC, GROUP_ORDER DESC ) AS D1 ORDER BY GROUP_ID DESC, GROUP_ORDER ASC' exec end

오라클 최적화 설계 create table BOARD ( AID NUMBER(38) not null, BID NUMBER(7) not null, TITLE VARCHAR2(300) not null, CONTENT CLOB, REGDATE DATE not null, REGIP VARCHAR2(15) not null, PAID NUMBER(38) not null, PPAID NUMBER(38) not null, PPORDER NUMBER(10) not null, ALEVEL NUMBER(10) not null, VCNT NUMBER(10) default 0, ) create unique index BOARD_FBI1 on BOARD (LPAD(TO_CHAR(BID),4,'0')||LPAD(TO_CHAR(PPAID),9,'0')||TO_CHAR(99999-PPORDER))

why sql learn?? 돈이 된다. 삶을 윤택하게 …( 개발시간감소, 서 버 안죽음 ㅡ. ㅡ ) 배우기 쉽다.

참고자료 G=pg G=pg 대용량 데이터 베이스 솔루션 1 권 새로쓴 대용량 데이터 베이스 솔루션 Perfect! 오라클 실전 튜닝