STRUCTURED QUERY LANGUAGE SQL Fact of the Week: According to the 2010 outlook from the BLS 286,600 new Computer, Network, and Database administrator jobs.

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.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 SQL Server Management Studio SQL DDL CREATE TABLE Constraints ALTER TABLE DROP TABLE The GUI way Steen Jensen, autumn 2013.
Virtual training week 4 structured query language (SQL)
CIT 613: Relational Database Development using SQL Introduction to SQL.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 David M. Kroenke Database Processing Chapter 2 Structured Query Language.
Chapter 7: Introduction to 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.
Structured Query Language SQL
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Structured Query Language SQL IST359 M005 Yang Wang 342 Hinds
Introduction to DBMS and SQL Introduction to DBMS and SQL GUIDED BY : MR. YOGESH SAROJ (PGT-CS) MR. YOGESH SAROJ (PGT-CS) Presented By : JAYA XII –COM.
The Relational Model These slides are based on the slides of your text book.
Project Implementation for COSC 5050 Distributed Database Applications Lab2.
Chapter 6: Introduction to SQL
I Copyright © 2004, Oracle. All rights reserved. Introduction.
RDB/1 An introduction to RDBMS Objectives –To learn about the history and future direction of the SQL standard –To get an overall appreciation of a modern.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
I Copyright © Oracle Corporation, All rights reserved. Introduction.
CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.
1 Chapter 7 Introduction to SQL. 2 Objectives Definition of terms Interpret history and role of SQL Define a database using SQL data definition language.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Introduction to SQL.
CHAPTER 6: INTRODUCTION TO SQL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 UNIT 6: Chapter 7: Introduction to SQL Modern Database Management 9 th Edition Jeffrey A.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 6: Introduction to SQL Modern Database Management 10 th Edition Jeffrey A. Hoffer,
Module 11: Programming Across Multiple Servers. Overview Introducing Distributed Queries Setting Up a Linked Server Environment Working with Linked Servers.
SQL SQL Server : Overview SQL : Overview Types of SQL Database : Creation Tables : Creation & Manipulation Data : Creation & Manipulation Data : Retrieving.
Dr. Chen, Data Base Management Chapter 6: Introduction to SQL Jason C. H. Chen, Ph.D. Professor of MIS School of Business Administration Gonzaga University.
“INTRODUCTION TO DATABASE AND SQL”. Outlines 2  Introduction To Database  Database Concepts  Database Properties  What is Database Management System.
MySQL Database Connection
Chapter 6 © 2013 Pearson Education, Inc. Publishing as Prentice Hall Chapter 6: Introduction to SQL Modern Database Management 11 th Edition Jeffrey A.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
CHAPTER 6: INTRODUCTION TO SQL Copyright © 2014 Pearson Education, Inc. 1 Essentials of Database Management Jeffrey A. Hoffer, Heikki Topi, V. Ramesh.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
Database Systems DBMS Environment Data Abstraction.
Chapter 7: Introduction to SQL
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
© 2011 Pearson Education 1 Chapter 6: Basic SQL Modern Database Management 10 th Edition, International Edition Jeffrey A. Hoffer, V. Ramesh, Heikki Topi.
DBSQL 5-1 Copyright © Genetic Computer School 2009 Chapter 5 Structured Query Language.
IS 380 Introduction to SQL This lectures covers material from: database textbook chapter 3 Oracle chapter: 3,14,17.
DBMS_Week 3-4 DBMS. Three-Schema Architecture – Internal schema (one view) describes physical storage structures access paths, indexes used Typically.
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.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
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.
Installation Oracle 11g Express 2 double click the "setup" button to install the Oracle.
CSC314 DAY 8 Introduction to SQL 1. Chapter 6 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SQL OVERVIEW  Structured Query Language  The.
Lecture # 24 Introduction to SQL Muhammad Emran Database Systems.
1 Database Fundamentals Introduction to SQL. 2 SQL Overview Structured Query Language The standard for relational database management systems (RDBMS)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 7: Introduction to SQL Modern Database Management 9 th Edition Jeffrey A. Hoffer,
Copyright © 2016 Pearson Education, Inc. Modern Database Management 12 th Edition Jeff Hoffer, Ramesh Venkataraman, Heikki Topi CHAPTER 6: INTRODUCTION.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
SQL Basics Review Reviewing what we’ve learned so far…….
CHAPTER 6: INTRODUCTION TO SQL © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey A. Hoffer,
1 Copyright © 2005, Oracle. All rights reserved. Oracle Database Administration: Overview.
CS 3630 Database Design and Implementation
“Introduction To Database and SQL”
PGT(CS) ,KV JHAGRAKHAND
The Basics of Data Manipulation
“Introduction To Database and SQL”
DATABASE MANAGEMENT SYSTEM
The Basics of Data Manipulation
مقدمة في قواعد البيانات
SQL Fundamentals in Three Hours
SQL .. An overview lecture3.
SQL-1 Week 8-9.
Chapter # 7 Introduction to Structured Query Language (SQL) Part I.
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Presentation transcript:

STRUCTURED QUERY LANGUAGE SQL Fact of the Week: According to the 2010 outlook from the BLS 286,600 new Computer, Network, and Database administrator jobs will be added in the next decade.

Learning Objectives  Describe and use basic SQL commands  Explain how and why SQL is used, and why its important  Compare and contrast DML and DDL  Use SQL commands to create metadata structures and perform CRUD operations.

Brief History of SQL  1970– E. Codd develops relational database concept  –System R with Sequel (later SQL) created at IBM Research Lab  1979–Oracle markets first relational DB with SQL  1986–ANSI SQL standard released  1989, 1992, 1999, 2003, 2007–Major ANSI standard updates  Current–SQL is supported by most major database vendors at 1999, 2003 and

The purpose of the SQL standard SQL Syntax and Semantics Intrinsic Data Structures Portability Levels: Minimal (L1) Complete (L2) Allow for Growth / Enhancement

Benefits of the SQL standard  Reduced training costs  Productivity  Application portability  Application longevity  Reduced dependence on a single vendor  Cross-system communication Yes. The standard helps, but each of these benefits is not as realized as other standards, such as HTML

The SQL Environment Server Instance Catalog (db) Schema Objects In this class we use: SQL Server ist-s-students,1533 With the default instance Each student has their own catalog (db) Default schema (dbo)

SQL Server 2005: ist-s-students  Other Information:  SQL Dialect: T-SQL / Transact-SQL  Case Sensitive Collation?: Yes  System tables used to represent meta data.  Client / Server over TCP/IP Connect to database using: host/IP, port number, logon, password Client software used to manage data/meta data on server  Everything can be expressed in SQL!  Naming Rules for Objects in SQL Server:  Up to 128 characters long  Must begin with a letter  Can contain digits, letters, _,.  Spaces can be used but should be avoided.

My Naming Conventions WhatMike’s ConventionRationale for use All object namesUse all lower case letters.Disambiguation: eg. Employee vs. employee for example All object namesUse underscore in place of SPACE Avoid the need to place brackets around identifiers. employee_phone_number vs. [employee phone number] TablesPluralizeShould be employees table, since it contains more than one employee TablesQualify with logical schemaDisambiguation of objects within the same database: eg. fudgemart_employees vs. fudgeflix_employees Column namesQuality with table nameHelps define scope of object. Eg. employee_zipcode.vs vendor_zipcode Constraintspk= primary key fk=foreign key u=unique ck=check i=index Disambiguation of constraints, for example: ck_vendor_zipcode.vs. fk_vendor_zipcode

SQL: Language Breakdown DomainSQL CommandsObjects Metadata (DDL) CREATE ALTER DROP Tables, functions, views, procedures, etc DATA (DML) C - INSERT R - SELECT U - UPDATE D - DELETE Tables (as a target) Security (DCL) GRANT REVOKE Tables, functions, views, procedures, etc. Transactions (DTL) BEGIN TRANS COMMIT ROLLBACK Controls DML statements

Workflow in SQL Mgmt Studio 1. Type in SQL 2. Highlight it 3. Check it (For syntax errors) 4. Wreck it (Execute on Server) 5. Once you execute “the program has run and the damage is done.” There is no undo, only redo, meaning if you delete something to get it back you must start over again.

Examples  Create students table  First name, Last name, netid, Year, GPA  Inserting data  Constraints unique, check  Updating Data  Foreign key lookup table  Using the select statement

STRUCTURED QUERY LANGUAGE SQL Basics On to the Demos…