Database systems design implementation and management
Download
1 / 6

Database Systems: Design, Implementation, and Management - PowerPoint PPT Presentation


  • 142 Views
  • Uploaded on

Database Systems: Design, Implementation, and Management. Chapter 7 Introduction to Structured Query Language (SQL). Data Definition Language (DDL) and Data Manipulation Language (DML). Data Definition Language (DDL) defines the structure of the database

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Database Systems: Design, Implementation, and Management' - buckminster-haney


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Database systems design implementation and management

Database Systems: Design, Implementation, and Management

Chapter 7

Introduction to Structured Query Language (SQL)


Data definition language ddl and data manipulation language dml
Data Definition Language (DDL) andData Manipulation Language (DML)

  • Data Definition Language (DDL)defines the structure of the database

    • E.g. tables, columns, keys, indexes, etc.

  • Data Manipulation Language (DML)manipulates the actual data contents

    • E.g. adding, modifying and deleting data

  • Understanding the difference between these two types of SQL commands will help you master SQL


Create read edit update delete cred crud four major kinds of database operations
Create, Read, Edit/Update, Delete (CRED/CRUD): Four major kinds of database operations

  • Create

    • DDL: CREATE tables and other structures

    • DML: INSERT data into tables

  • Read

    • DDL: SELECT (system catalogue queries)

    • DML: SELECT

  • Edit/Update

    • DDL: ALTER table and other structures

    • DML: UPDATE table

  • Delete

    • DDL: DROP tables and other structures

    • DML: DELETE from table


Where versus having
WHERE versus HAVING kinds of database operations

  • WHERE is used to restrict a subset of rows from a regular query result

    • Usually a SELECT query, but also UPDATE and DELETE

  • HAVING is used to restrict a subset of rows when using a GROUP BY aggregation

    • HAVING only works with GROUP BY

  • Mnemonics to not confuse the two:

    • SELECT FROM WHERE? (WHERE is the normal clause for a SELECT statement)

    • G-H (GROUP BY goes with HAVING)


Set date and number formats in oracle
Set date and number formats in Oracle kinds of database operations

  • Some data (e.g. dates and numbers) assume that certain formats are being used

  • ALTER SESSION is used to set environment variables, including date and number formats

  • If you have problems entering dates, execute this SQL command before your other commands:

    • alter session set nls_date_format = 'dd-mm-yyyy';

  • With language and number format problems, try:

    • alter session set nls_language = English;

    • alter session set nls_territory = Canada;


Sources
Sources kinds of database operations

  • Most of the slides are adapted from Database Systems: Design, Implementation and Management by Carlos Coronel and Steven Morris. 11th edition (2015) published by Cengage Learning. ISBN 13: 978-1-285-19614-5

  • Other sources are noted on the slides themselves


ad