Business Solutions. Formatting It is sometimes necessary to alter the output of a query for the sake of readability such as in report generation. This.

Slides:



Advertisements
Similar presentations
9 Creating and Managing Tables. Objectives After completing this lesson, you should be able to do the following: Describe the main database objects Create.
Advertisements

Copyright  Oracle Corporation, All rights reserved. 2 Single-Row Functions.
Review of ICS 102. Lecture Objectives To review the major topics covered in ICS 102 course Refresh the memory and get ready for the new adventure of ICS.
Databases Lab 5 Further Select Statements. Functions in SQL There are many types of functions provided. The ones that are used most are: –Date and Time.
Introduction to Oracle9i: SQL1 Selected Single-Row Functions.
Databases Week 1, lab 2 Simple selects. About the environment We are using SQL Server for the moment. The server we are using is: –Cian.student.comp.dit.ie.
Chapter 9: Arrays and Strings
Databases Tutorial 2 Further Select Statements. Objectives for Week Data types Sort retrieved data Formatting output.
Section 3.6 BUILT-IN FUNCTIONS involving numbers & strings.
Single-Row Functions. SQL Functions Functions are a very powerful feature of SQL and can be used to do the following: Perform calculations on data Modify.
Module 2 Working with Data Types. Module Overview Using Data Types Working with Character Data Converting Data Types Working with Specialized Data Types.
Chapter 10 Queries and Updating Part C. SQL Copyright 2005 Radian Publishing Co.
Security, Transactions, and Views. Security Achieved through GRANT & REVOKE Assumes the database can recognize its users and verify their identity can.
1 11/3/05CS360 Windows Programming Databases and Data Representation.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL.
CS190/295 Programming in Python for Life Sciences: Lecture 3 Instructor: Xiaohui Xie University of California, Irvine.
SINGLE-ROW FUNCTIONS Lecture 9. SQL Functions Functions are very powerful feature of SQL and can be used to do the following:  Perform a calculation.
Functions Oracle Labs 5 & 6. 2/3/2005Adapted from Introduction to Oracle: SQL and PL/SQL 2 SQL Functions Function arg n arg 2 arg 1. Input Resulting Value.
Chapter 8 Arrays and Strings
Single – Row Functions. Objectives After completing this lesson, you should be able to do the following:  Describe various types of functions available.
CHAPTER: 12. Array is a collection of variables of the same data type that are referenced by a common name. An Array of 10 Elements of type double.
Review of ICS 102. Lecture Objectives To review the major topics covered in ICS 102 course Refresh the memory and get ready for the new adventure of ICS.
SQL: DDL John Ortiz Cs.utsa.edu.
Databases: SQL Dr Andy Evans. SQL (Structured Query Language) ISO Standard for database management. Allows creation, alteration, and querying of databases.
Copyright © Nancy Acemian 2004 For Loops-Break-Continue COMP For loop is a counter controlled loop. For loop is a pretest loop. Used when number.
ROUND 1 Name a method associated with class String 1.) 15 compareTo() 26 indexOf() 34 length() 2.) 3.) 4.) 3 toUpper() 7 substring() 11 charAt() 5.)
Instructor: Craig Duckett Lecture 08: Thursday, October 22 nd, 2015 Patterns, Order of Evaluation, Concatenation, Substrings, Trim, Position 1 BIT275:
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
IFS Intro to Data Management Chapter 5 Getting More Than Simple Columns.
Using Java Class Library
Business Solutions. Formatting It is sometimes necessary to alter the output of a query for the sake of readability such as in report generation. This.
SQL CREATING AND MANAGING TABLES lecture4 1. Database Objects ObjectDescription TableBasic unit of storage; composed of rows and columns ViewLogically.
Using Recursion to Convert Number to Other Number Bases Data Structures in Java with JUnit ©Rick Mercer.
Table Creation / Data Types. A Data type is... Specifies what kind of information a column will hold so that the system will know how the data is to be.
1 STRINGS String data type Basic operations on strings String functions String procedures.
Introduction to Functions – Single Row Functions.
1 Predefined Classes and Objects Chapter 3. 2 Objectives You will be able to:  Use predefined classes available in the Java System Library in your own.
Oracle & SQL. Oracle Data Types Character Data Types: Char(2) Varchar (20) Clob: large character string as long as 4GB Bolb and bfile: large amount of.
C OMMON M ISTAKES CSC Java Program Structure  String Methods.
College of Information Technology, Universiti Tenaga Nasional1 Lab 2: Single-row Functions CISB224 01A CCSB244 01A Semester I, 2008/2009.
Writing Basic SQL SELECT Statements Lecture
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
Winter 2016CISC101 - Prof. McLeod1 CISC101 Reminders Quiz 3 this week – last section on Friday. Assignment 4 is posted. Data mining: –Designing functions.
Single Row Functions. 3-2 Objectives Explain the various types of functions available in SQL. Explain the various types of functions available in SQL.
Single Row Functions Part I Week 2. Objectives –Describe types of single row functions in SQL –Describe and use character, number and date SQL functions.
In this session, you will learn to:
Open Source Server Side Scripting MySQL Functions
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL
Two Dimensional Arrays
Two Dimensional Array Mr. Jacobs.
SQL Creating and Managing Tables
SQL Creating and Managing Tables
SQL Text Manipulation Farrokh Alemi, Ph.D.
Week 7 March 8 SQL: Chronological Sort, SUBSTRing, ROUND
SQL Creating and Managing Tables
A more complex example.
Single-Row Functions Lecture 9.
Writing Basic SQL SELECT Statements
CS190/295 Programming in Python for Life Sciences: Lecture 3
Lesson 3 Chapter 10.
CS1110 Today: collections.
Python Basics with Jupyter Notebook
Introduction to Computer Science
Lecture 5 SQL FUNCTIONS.
Structured Query Language Path from Unorganized to Organized….
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Programming Strings.
Presentation transcript:

Business Solutions

Formatting It is sometimes necessary to alter the output of a query for the sake of readability such as in report generation. This can also be applied to a view creation which users will share.

SUBSTRING Returns a part of a character or binary string. SUBSTRING (expression, start, length) SUBSTRING (expression, start, length) SUBSTRING (‘SQL Programming’, 1, 3) = SQL SUBSTRING (‘SQL Programming’, 1, 3) = SQL

CONVERT Changes one datatype to another. CONVERT(datatype[length], expression) CONVERT(char(2), ‘SQL’) = SQ CONVERT(int, ‘10’) = 10

Using them together... Select substring(title_id, 1, 2) as alpha convert(int, substring(title_id, 3, 4)) as num from titles

Other data Col_length - returns the length defined for a specific column. COL_LENGTH(‘table_name’, ‘col_name’) Data_length - returns the length of the data in an expression DATA_LENGTH(expression)

REPLICATE Replicates a given character or string the number of times specified. REPLICATE(char, int)

ROUND Rounds a number according to the specified accuracy. ROUND (col, int)

CHARINDEX Returns the index position of the specified string. CHARINDEX(search_str, str) CHARINDEX(‘.’, ‘12.3’) = 3

LIKE Ranges LIKE ‘[A-Z] [a-z] [a-z]’ Wildcards LIKE ‘_ _ _ _’ LIKE ‘[^] [^] [^]’ LIKE ‘%SQL%’