SQL - STRING FUNCTIONS
|
|
|
- Sydney Hensley
- 9 years ago
- Views:
Transcription
1 SQL - STRING FUNCTIONS Copyright tutorialspoint.com SQL string functions are used primarily for string manipulation. The following table details the important string functions: Name ASCII BIN BIT_LENGTH CHAR_LENGTH CHAR CHARACTER_LENGTH CONCAT_WS CONCAT CONV ELT EXPORT_SET FIELD FIND_IN_SET FORMAT HEX INSERT INSTR LCASE LEFT LENGTH LOAD_FILE LOCATE LOWER LPAD LTRIM Description Returns numeric value of left-most character Returns a string representation of the argument Returns length of argument in bits Returns number of characters in argument Returns the character for each integer passed A synonym for CHAR_LENGTH Returns concatenate with separator Returns concatenated string Converts numbers between different number bases Returns string at index number Returns a string such that for every bit set in the value bits, you get an on string and for every unset bit, you get an off string Returns the index position of the first argument in the subsequent arguments Returns the index position of the first argument within the second argument Returns a number formatted to specified number of decimal places Returns a string representation of a hex value Inserts a substring at the specified position up to the specified number of characters Returns the index of the first occurrence of substring Synonym for LOWER Returns the leftmost number of characters as specified Returns the length of a string in bytes Loads the named file Returns the position of the first occurrence of substring Returns the argument in lowercase Returns the string argument, left-padded with the specified string Removes leading spaces
2 MAKE_SET MID OCT OCTET_LENGTH ORD POSITION QUOTE REGEXP REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SOUNDEX SOUNDS LIKE SPACE STRCMP SUBSTRING_INDEX SUBSTRING, SUBSTR TRIM UCASE UNHEX UPPER Returns a set of comma-separated strings that have the corresponding bit in bits set Returns a substring starting from the specified position Returns a string representation of the octal argument A synonym for LENGTH If the leftmost character of the argument is a multi-byte character, returns the code for that character A synonym for LOCATE Escapes the argument for use in an SQL statement Pattern matching using regular expressions Repeats a string the specified number of times Replaces occurrences of a specified string Reverses the characters in a string Returns the specified rightmost number of characters Appends string the specified number of times Removes trailing spaces Returns a soundex string Compares sounds Returns a string of the specified number of spaces Compares two strings Returns a substring from a string before the specified number of occurrences of the delimiter Returns the substring as specified Removes leading and trailing spaces Synonym for UPPER Converts each pair of hexadecimal digits to a character Converts to uppercase ASCIIstr Returns the numeric value of the leftmost character of the string str. Returns 0 if str is the empty string. Returns NULL if str is NULL. ASCII works for characters with numeric values from 0 to 255. SQL> SELECT ASCII('2'); ASCII('2') 50 SQL> SELECT ASCII('dx'); ASCII('dx')
3 100 BINN Returns a string representation of the binary value of N, where N is a longlong BIGINT number. This is equivalent to CONVN, 10, 2. Returns NULL if N is NULL. SQL> SELECT BIN(12); BIN(12) 1100 BIT_LENGTHstr Returns the length of the string str in bits. SQL> SELECT BIT_LENGTH('text'); BIT_LENGTH('text') 32 CHARN,... [USINGcharset n ame] CHAR interprets each argument N as an integer and returns a string consisting of the characters given by the code values of those integers. NULL values are skipped. SQL> SELECT CHAR(77,121,83,81,'76'); CHAR(77,121,83,81,'76') SQL CHAR_LENGTHstr Returns the length of the string str measured in characters. A multi-byte character counts as a single character. This means that for a string containing five two-byte characters, LENGTH returns 10, whereas CHAR_LENGTH returns 5. SQL> SELECT CHAR_LENGTH("text"); CHAR_LENGTH("text") 4 CHARACTER_LENGTHstr CHARACTER_LENGTH is a synonym for CHAR_LENGTH. CONCATstr1, str2,... Returns the string that results from concatenating the arguments. May have one or more
4 arguments. If all arguments are non-binary strings, the result is a non-binary string. If the arguments include any binary strings, the result is a binary string. A numeric argument is converted to its equivalent binary string form; if you want to avoid that, you can use an explicit type cast, as in this example: SQL> SELECT CONCAT('My', 'S', 'QL'); CONCAT('My', 'S', 'QL') SQL CONCAT_WSseparator, str1, str2,... CONCAT_WS stands for Concatenate With Separator and is a special form of CONCAT. The first argument is the separator for the rest of the arguments. The separator is added between the strings to be concatenated. The separator can be a string, as can the rest of the arguments. If the separator is NULL, the result is NULL. SQL> SELECT CONCAT_WS(',','First name','last Name' ); CONCAT_WS(',','First name','last Name' ) First name, Last Name CONVN, from b ase, to b ase Converts numbers between different number bases. Returns a string representation of the number N, converted from base from_base to to_base. Returns NULL if any argument is NULL. The argument N is interpreted as an integer, but may be specified as an integer or a string. The minimum base is 2 and the maximum base is 36. If to_base is a negative number, N is regarded as a signed number. Otherwise, N is treated as unsigned. CONV works with 64-bit precision. SQL> SELECT CONV('a',16,2); CONV('a',16,2) 1010 ELTN, str1, str2, str3,... Returns str1 if N = 1, str2 if N = 2, and so on. Returns NULL if N is less than 1 or greater than the number of arguments. ELT is the complement of FIELD. SQL> SELECT ELT(1, 'ej', 'Heja', 'hej', 'foo'); ELT(1, 'ej', 'Heja', 'hej', 'foo') ej EXPORT_SETbits, on, off[, separator[, number o f b its]] Returns a string such that for every bit set in the value bits, you get an on string and for every bit not set in the value, you get an off string. Bits in bits are examined from right to left fromlow ordertohigh orderbits. Strings are added to the result from left to right, separated by the separator string thedefaultbeingthecommacharacter.,.. The number of bits examined is given by number_of_bits defaultsto64.
5 SQL> SELECT EXPORT_SET(5,'Y','N',',',4); EXPORT_SET(5,'Y','N',',',4) Y,N,Y,N FIELDstr, str1, str2, str3,... Returns the index positionstartingwith1 of str in the str1, str2, str3,... list. Returns 0 if str is not found. SQL> SELECT FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo'); FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo') 2 FIND_IN_SETstr, strlist Returns a value in the range of 1 to N if the string str is in the string list strlist consisting of N substrings. SQL> SELECT FIND_IN_SET('b','a,b,c,d'); SELECT FIND_IN_SET('b','a,b,c,d') 2 FORMATX, D Formats the number X to a format like '#,###,###.##', rounded to D decimal places, and returns the result as a string. If D is 0, the result has no decimal point or fractional part. SQL> SELECT FORMAT( , 4); FORMAT( , 4) 12, HEXN o r S If N_or_S is a number, returns a string representation of the hexadecimal value of N, where N is a longlong BIGINT number. This is equivalent to CONVN, 10, 16. If N_or_S is a string, returns a hexadecimal string representation of N_or_S where each character in N_or_S is converted to two hexadecimal digits. SQL> SELECT HEX(255); HEX(255) FF SQL> SELECT 0x616263;
6 0x abc INSERTstr, pos, len, newstr Returns the string str, with the substring beginning at position pos and len characters long replaced by the string newstr. Returns the original string if pos is not within the length of the string. Replaces the rest of the string from position pos if len is not within the length of the rest of the string. Returns NULL if any argument is NULL. SQL> SELECT INSERT('Quadratic', 3, 4, 'What'); INSERT('Quadratic', 3, 4, 'What') QuWhattic INSTRstr, substr Returns the position of the first occurrence of substring substr in string str. This is the same as the two-argument form of LOCATE, except that the order of the arguments is reversed. SQL> SELECT INSTR('foobarbar', 'bar'); INSTR('foobarbar', 'bar') 4 LCASEstr LCASE is a synonym for LOWER. LEFTstr, len Returns the leftmost len characters from the string str, or NULL if any argument is NULL. SQL> SELECT LEFT('foobarbar', 5); LEFT('foobarbar', 5) fooba LENGTHstr Returns the length of the string str, measured in bytes. A multi-byte character counts as multiple bytes. This means that for a string containing five two-byte characters, LENGTH returns 10, whereas CHAR_LENGTH returns 5. SQL> SELECT LENGTH('text'); LENGTH('text') 4
7 LOAD_FILEfile n ame Reads the file and returns the file contents as a string. To use this function, the file must be located on the server host, you must specify the full pathname to the file, and you must have the FILE privilege. The file must be readable by all and its size less than max_allowed_packet bytes. If the file does not exist or cannot be read because one of the preceding conditions is not satisfied, the function returns NULL. As of SQL , the character_set_filesystem system variable controls interpretation of filenames that are given as literal strings. SQL> UPDATE table_test -> SET blob_col=load_file('/tmp/picture') -> WHERE id=1;... LOCATEsubstr, str, LOCATEsubstr, str, pos The first syntax returns the position of the first occurrence of substring substr in string str. The second syntax returns the position of the first occurrence of substring substr in string str, starting at position pos. Returns 0 if substr is not in str. SQL> SELECT LOCATE('bar', 'foobarbar'); LOCATE('bar', 'foobarbar') 4 LOWERstr Returns the string str with all characters changed to lowercase according to the current character set mapping. SQL> SELECT LOWER('QUADRATICALLY'); LOWER('QUADRATICALLY') quadratically LPADstr, len, padstr Returns the string str, left-padded with the string padstr to a length of len characters. If str is longer than len, the return value is shortened to len characters. SQL> SELECT LPAD('hi',4,'??'); LPAD('hi',4,'??')??hi LTRIMstr Returns the string str with leading space characters removed. SQL> SELECT LTRIM(' barbar'); LTRIM(' barbar')
8 barbar MAKE_SETbits, str1, str2,... Returns a set value astringcontainingsubstringsseparatedby.,. characters consisting of the strings that have the corresponding bit in bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL values in str1, str2,... are not appended to the result. SQL> SELECT MAKE_SET(1,'a','b','c'); MAKE_SET(1,'a','b','c') a MIDstr, pos, len MIDstr, pos, len is a synonym for SUBSTRINGstr, pos, len. OCTN Returns a string representation of the octal value of N, where N is a longlong BIGINT number. This is equivalent to CONVN, 10, 8. Returns NULL if N is NULL. SQL> SELECT OCT(12); OCT(12) 14 OCTET_LENGTHstr OCTET_LENGTH is a synonym for LENGTH. ORDstr If the leftmost character of the string str is a multi-byte character, returns the code for that character, calculated from the numeric values of its constituent bytes using this formula: (1st byte code) + (2nd byte code. 256) + (3rd byte code. 2562)... If the leftmost character is not a multi-byte character, ORD returns the same value as the ASCII function. SQL> SELECT ORD('2'); ORD('2') 50 POSITIONsubstrINstr POSITIONsubstrINstr is a synonym for LOCATEsubstr, str.
9 QUOTEstr Quotes a string to produce a result that can be used as a properly escaped data value in an SQL statement. The string is returned enclosed by single quotes and with each instance of single quote, backslash \', ASCII NUL, and Control-Z preceded by a backslash. If the argument is NULL, the return value is the word 'NULL' without enclosing single quotes. SQL> SELECT QUOTE('Don\'t!'); QUOTE('Don\'t!') 'Don\'t!' NOTE: Please check if your installation has any bug with this function then don't use this function. expr REGEXP pattern This function performs a pattern match of expr against pattern. Returns 1 if expr matches pat; otherwise it returns 0. If either expr or pat is NULL, the result is NULL. REGEXP is not case sensitive, except when used with binary strings. SQL> SELECT 'ABCDEF' REGEXP 'A%C%%'; 'ABCDEF' REGEXP 'A%C%%' 0 Another example is: SQL> SELECT 'ABCDE' REGEXP '.*'; 'ABCDE' REGEXP '.*' 1 Let's see one more example: SQL> SELECT 'new*\n* line' REGEXP 'new\\*.\\* line'; 'new*\n*line' REGEXP 'new\\*.\\*line' 1 REPEATstr, count Returns a string consisting of the string str repeated count times. If count is less than 1, returns an empty string. Returns NULL if str or count are NULL. SQL> SELECT REPEAT('SQL', 3); REPEAT('SQL', 3) SQLSQLSQL
10 REPLACEstr, from s tr, to s tr Returns the string str with all occurrences of the string from_str replaced by the string to_str. REPLACE performs a case-sensitive match when searching for from_str. SQL> SELECT REPLACE(' 'w', 'Ww'); REPLACE(' 'w', 'Ww') WwWwWw.mysql.com REVERSEstr Returns the string str with the order of the characters reversed. SQL> SELECT REVERSE('abcd'); REVERSE('abcd') dcba RIGHTstr, len Returns the rightmost len characters from the string str, or NULL if any argument is NULL. SQL> SELECT RIGHT('foobarbar', 4); RIGHT('foobarbar', 4) rbar RPADstr, len, padstr Returns the string str, right-padded with the string padstr to a length of len characters. If str is longer than len, the return value is shortened to len characters. SQL> SELECT RPAD('hi',5,'?'); RPAD('hi',5,'?') hi??? RTRIMstr Returns the string str with trailing space characters removed. SQL> SELECT RTRIM('barbar '); RTRIM('barbar ') barbar SOUNDEXstr
11 Returns a soundex string from str. Two strings that sound almost the same should have identical soundex strings. A standard soundex string is four characters long, but the SOUNDEX function returns an arbitrarily long string. You can use SUBSTRING on the result to get a standard soundex string. All non-alphabetic characters in str are ignored. All international alphabetic characters outside the A-Z range are treated as vowels. SQL> SELECT SOUNDEX('Hello'); SOUNDEX('Hello') H400 expr1 SOUNDS LIKE expr2 This is the same as SOUNDEXexpr1 = SOUNDEXexpr2. SPACEN Returns a string consisting of N space characters. SQL> SELECT SPACE(6); SELECT SPACE(6) ' ' STRCMPstr1, str2 Compares two strings and returns 0 if both strings are equal, it returns -1 if the first argument is smaller than the second according to the current sort order otherwise it returns 1. SQL> SELECT STRCMP('MOHD', 'MOHD'); STRCMP('MOHD', 'MOHD') 0 Another example is: SQL> SELECT STRCMP('AMOHD', 'MOHD'); STRCMP('AMOHD', 'MOHD') -1 Let's see one more example: SQL> SELECT STRCMP('MOHD', 'AMOHD'); STRCMP('MOHD', 'AMOHD') 1 SUBSTRINGstr, pos
12 SUBSTRINGstrFROMpos SUBSTRINGstr, pos, len SUBSTRINGstrFROMposFORlen The forms without a len argument return a substring from string str starting at position pos. The forms with a len argument return a substring len characters long from string str, starting at position pos. The forms that use FROM are standard SQL syntax. It is also possible to use a negative value for pos. In this case, the beginning of the substring is pos characters from the end of the string, rather than the beginning. A negative value may be used for pos in any of the forms of this function. SQL> SELECT SUBSTRING('Quadratically',5); SSUBSTRING('Quadratically',5) ratically SQL> SELECT SUBSTRING('foobarbar' FROM 4); SUBSTRING('foobarbar' FROM 4) barbar SQL> SELECT SUBSTRING('Quadratically',5,6); SUBSTRING('Quadratically',5,6) ratica SUBSTRING_INDEXstr, delim, count Returns the substring from string str before count occurrences of the delimiter delim. If count is positive, everything to the left of the final delimiter countingfromtheleft is returned. If count is negative, everything to the right of the final delimiter countingfromtheright is returned. SUBSTRING_INDEX performs a case-sensitive match when searching for delim. SQL> SELECT SUBSTRING_INDEX(' '.', 2); SUBSTRING_INDEX(' '.', 2) TRIM[BOTH LEADING TRAILING[remstr]FROM]str TRIM[remstrFROM]str Returns the string str with all remstr prefixes or suffixes removed. If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. remstr is optional and, if not specified, spaces are removed. SQL> SELECT TRIM(' bar '); TRIM(' bar ') bar
13 SQL> SELECT TRIM(LEADING 'x' FROM 'xxxbarxxx'); TRIM(LEADING 'x' FROM 'xxxbarxxx') barxxx SQL> SELECT TRIM(BOTH 'x' FROM 'xxxbarxxx'); TRIM(BOTH 'x' FROM 'xxxbarxxx') bar SQL> SELECT TRIM(TRAILING 'xyz' FROM 'barxxyz'); TRIM(TRAILING 'xyz' FROM 'barxxyz') barx UCASEstr UCASE is a synonym for UPPER. UNHEXstr Performs the inverse operation of HEXstr. That is, it interprets each pair of hexadecimal digits in the argument as a number and converts it to the character represented by the number. The resulting characters are returned as a binary string. SQL> SELECT UNHEX('4D C'); UNHEX('4D C') SQL The characters in the argument string must be legal hexadecimal digits: '0'.. '9', 'A'.. 'F', 'a'.. 'f'. If UNHEX encounters any non-hexadecimal digits in the argument, it returns NULL. UPPERstr Returns the string str with all characters changed to uppercase according to the current character set mapping. SQL> SELECT UPPER('Allah-hus-samad'); UPPER('Allah-hus-samad') ALLAH-HUS-SAMAD Processing math: 100%
Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query
Information and Computer Science Department ICS 324 Database Systems Lab#11 SQL-Basic Query Objectives The objective of this lab is to learn the query language of SQL. Outcomes After completing this Lab,
Chapter 4: Computer Codes
Slide 1/30 Learning Objectives In this chapter you will learn about: Computer data Computer codes: representation of data in binary Most commonly used computer codes Collating sequence 36 Slide 2/30 Data
Solution for Homework 2
Solution for Homework 2 Problem 1 a. What is the minimum number of bits that are required to uniquely represent the characters of English alphabet? (Consider upper case characters alone) The number of
Computer Science 281 Binary and Hexadecimal Review
Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two
Number Representation
Number Representation CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Topics to be Discussed How are numeric data
.NET Standard DateTime Format Strings
.NET Standard DateTime Format Strings Specifier Name Description d Short date pattern Represents a custom DateTime format string defined by the current ShortDatePattern property. D Long date pattern Represents
Useful Number Systems
Useful Number Systems Decimal Base = 10 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} Binary Base = 2 Digit Set = {0, 1} Octal Base = 8 = 2 3 Digit Set = {0, 1, 2, 3, 4, 5, 6, 7} Hexadecimal Base = 16 = 2
Chapter Binary, Octal, Decimal, and Hexadecimal Calculations
Chapter 5 Binary, Octal, Decimal, and Hexadecimal Calculations This calculator is capable of performing the following operations involving different number systems. Number system conversion Arithmetic
Lecture 11: Number Systems
Lecture 11: Number Systems Numeric Data Fixed point Integers (12, 345, 20567 etc) Real fractions (23.45, 23., 0.145 etc.) Floating point such as 23. 45 e 12 Basically an exponent representation Any number
Systems I: Computer Organization and Architecture
Systems I: Computer Organization and Architecture Lecture 2: Number Systems and Arithmetic Number Systems - Base The number system that we use is base : 734 = + 7 + 3 + 4 = x + 7x + 3x + 4x = x 3 + 7x
EE 261 Introduction to Logic Circuits. Module #2 Number Systems
EE 261 Introduction to Logic Circuits Module #2 Number Systems Topics A. Number System Formation B. Base Conversions C. Binary Arithmetic D. Signed Numbers E. Signed Arithmetic F. Binary Codes Textbook
Base Conversion written by Cathy Saxton
Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,
CSI 333 Lecture 1 Number Systems
CSI 333 Lecture 1 Number Systems 1 1 / 23 Basics of Number Systems Ref: Appendix C of Deitel & Deitel. Weighted Positional Notation: 192 = 2 10 0 + 9 10 1 + 1 10 2 General: Digit sequence : d n 1 d n 2...
CS106A, Stanford Handout #38. Strings and Chars
CS106A, Stanford Handout #38 Fall, 2004-05 Nick Parlante Strings and Chars The char type (pronounced "car") represents a single character. A char literal value can be written in the code using single quotes
CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012
CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline Data Representation Binary Codes Why 6-3-1-1 and Excess-3? Data Representation (1/2) Each numbering
Binary Numbers. Binary Octal Hexadecimal
Binary Numbers Binary Octal Hexadecimal Binary Numbers COUNTING SYSTEMS UNLIMITED... Since you have been using the 10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may wonder how
Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8
ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also
C++ Language Tutorial
cplusplus.com C++ Language Tutorial Written by: Juan Soulié Last revision: June, 2007 Available online at: http://www.cplusplus.com/doc/tutorial/ The online version is constantly revised and may contain
So far we have considered only numeric processing, i.e. processing of numeric data represented
Chapter 4 Processing Character Data So far we have considered only numeric processing, i.e. processing of numeric data represented as integer and oating point types. Humans also use computers to manipulate
CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011
CS101 Lecture 11: Number Systems and Binary Numbers Aaron Stevens 14 February 2011 1 2 1 3!!! MATH WARNING!!! TODAY S LECTURE CONTAINS TRACE AMOUNTS OF ARITHMETIC AND ALGEBRA PLEASE BE ADVISED THAT CALCULTORS
COMPSCI 210. Binary Fractions. Agenda & Reading
COMPSCI 21 Binary Fractions Agenda & Reading Topics: Fractions Binary Octal Hexadecimal Binary -> Octal, Hex Octal -> Binary, Hex Decimal -> Octal, Hex Hex -> Binary, Octal Animation: BinFrac.htm Example
JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved.
1 6 JavaScript: Introduction to Scripting 2 Comment is free, but facts are sacred. C. P. Scott The creditor hath a better memory than the debtor. James Howell When faced with a decision, I always ask,
3.GETTING STARTED WITH ORACLE8i
Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer
Guide to the Superbase. ODBC Driver. By Superbase Developers plc
Guide to the Superbase ODBC Driver By Superbase Developers plc This manual was produced using Doc-To-Help, by WexTech Systems, Inc. WexTech Systems, Inc. 310 Madison Avenue, Suite 905 New York, NY 10017
Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.
Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must be able to handle more than just values for real world problems
Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)
Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating
Levent EREN [email protected] A-306 Office Phone:488-9882 INTRODUCTION TO DIGITAL LOGIC
Levent EREN [email protected] A-306 Office Phone:488-9882 1 Number Systems Representation Positive radix, positional number systems A number with radix r is represented by a string of digits: A n
PL / SQL Basics. Chapter 3
PL / SQL Basics Chapter 3 PL / SQL Basics PL / SQL block Lexical units Variable declarations PL / SQL types Expressions and operators PL / SQL control structures PL / SQL style guide 2 PL / SQL Block Basic
Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement
This section describes how LabVIEW stores data in memory for controls, indicators, wires, and other objects.
Application Note 154 LabVIEW Data Storage Introduction This Application Note describes the formats in which you can save data. This information is most useful to advanced users, such as those using shared
Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:
Numeral Systems Which number is larger? 25 8 We need to distinguish between numbers and the symbols that represent them, called numerals. The number 25 is larger than 8, but the numeral 8 above is larger
Japanese Character Printers EPL2 Programming Manual Addendum
Japanese Character Printers EPL2 Programming Manual Addendum This addendum contains information unique to Zebra Technologies Japanese character bar code printers. The Japanese configuration printers support
grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print
grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print In the simplest terms, grep (global regular expression print) will search input
Netezza SQL Class Outline
Netezza SQL Class Outline CoffingDW education has been customized for every customer for the past 20 years. Our classes can be taught either on site or remotely via the internet. Education Contact: John
Regular Expression Syntax
1 of 5 12/22/2014 9:55 AM EmEditor Home - EmEditor Help - How to - Search Regular Expression Syntax EmEditor regular expression syntax is based on Perl regular expression syntax. Literals All characters
How Strings are Stored. Searching Text. Setting. ANSI_PADDING Setting
How Strings are Stored Searching Text SET ANSI_PADDING { ON OFF } Controls the way SQL Server stores values shorter than the defined size of the column, and the way the column stores values that have trailing
plc numbers - 13.1 Encoded values; BCD and ASCII Error detection; parity, gray code and checksums
plc numbers - 3. Topics: Number bases; binary, octal, decimal, hexadecimal Binary calculations; s compliments, addition, subtraction and Boolean operations Encoded values; BCD and ASCII Error detection;
Variables, Constants, and Data Types
Variables, Constants, and Data Types Primitive Data Types Variables, Initialization, and Assignment Constants Characters Strings Reading for this class: L&L, 2.1-2.3, App C 1 Primitive Data There are eight
Achieving Database Interoperability Across Data Access APIs through SQL Up-leveling
Achieving Database Interoperability Across Data Access APIs through SQL Up-leveling SQL up-leveling provides the capability to write a SQL statement that can be executed across multiple databases, regardless
Numbering Systems. InThisAppendix...
G InThisAppendix... Introduction Binary Numbering System Hexadecimal Numbering System Octal Numbering System Binary Coded Decimal (BCD) Numbering System Real (Floating Point) Numbering System BCD/Binary/Decimal/Hex/Octal
Regular Expressions Overview Suppose you needed to find a specific IPv4 address in a bunch of files? This is easy to do; you just specify the IP
Regular Expressions Overview Suppose you needed to find a specific IPv4 address in a bunch of files? This is easy to do; you just specify the IP address as a string and do a search. But, what if you didn
Python Lists and Loops
WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show
FileMaker 13. SQL Reference
FileMaker 13 SQL Reference 2013 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks of FileMaker, Inc. registered
Goals. Unary Numbers. Decimal Numbers. 3,148 is. 1000 s 100 s 10 s 1 s. Number Bases 1/12/2009. COMP370 Intro to Computer Architecture 1
Number Bases //9 Goals Numbers Understand binary and hexadecimal numbers Be able to convert between number bases Understand binary fractions COMP37 Introduction to Computer Architecture Unary Numbers Decimal
Programming with SQL
Unit 43: Programming with SQL Learning Outcomes A candidate following a programme of learning leading to this unit will be able to: Create queries to retrieve information from relational databases using
Counting in base 10, 2 and 16
Counting in base 10, 2 and 16 1. Binary Numbers A super-important fact: (Nearly all) Computers store all information in the form of binary numbers. Numbers, characters, images, music files --- all of these
Cyber Security Workshop Encryption Reference Manual
Cyber Security Workshop Encryption Reference Manual May 2015 Basic Concepts in Encoding and Encryption Binary Encoding Examples Encryption Cipher Examples 1 P a g e Encoding Concepts Binary Encoding Basics
6.170 Tutorial 3 - Ruby Basics
6.170 Tutorial 3 - Ruby Basics Prerequisites 1. Have Ruby installed on your computer a. If you use Mac/Linux, Ruby should already be preinstalled on your machine. b. If you have a Windows Machine, you
MS Access: Advanced Tables and Queries. Lesson Notes Author: Pamela Schmidt
Lesson Notes Author: Pamela Schmidt Tables Text Fields (Default) Text or combinations of text and numbers, as well as numbers that don't require calculations, such as phone numbers. or the length set by
First Bytes Programming Lab 2
First Bytes Programming Lab 2 This lab is available online at www.cs.utexas.edu/users/scottm/firstbytes. Introduction: In this lab you will investigate the properties of colors and how they are displayed
The Answer to the 14 Most Frequently Asked Modbus Questions
Modbus Frequently Asked Questions WP-34-REV0-0609-1/7 The Answer to the 14 Most Frequently Asked Modbus Questions Exactly what is Modbus? Modbus is an open serial communications protocol widely used in
CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals
CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals 1 Recall From Last Time: Java Program import java.util.scanner; public class EggBasket { public static void main(string[]
Positional Numbering System
APPENDIX B Positional Numbering System A positional numbering system uses a set of symbols. The value that each symbol represents, however, depends on its face value and its place value, the value associated
Chapter 1: Digital Systems and Binary Numbers
Chapter 1: Digital Systems and Binary Numbers Digital age and information age Digital computers general purposes many scientific, industrial and commercial applications Digital systems telephone switching
Regular Expressions. General Concepts About Regular Expressions
Regular Expressions This appendix explains regular expressions and how to use them in Cisco IOS software commands. It also provides details for composing regular expressions. This appendix has the following
Verilog - Representation of Number Literals
Verilog - Representation of Number Literals... And here there be monsters! (Capt. Barbossa) Numbers are represented as: value ( indicates optional part) size The number of binary
Pemrograman Dasar. Basic Elements Of Java
Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle
CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf
CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf First Name: Last Name: NetID: The purpose of this lab is to help you to better understand functions:
Binary Representation
Binary Representation The basis of all digital data is binary representation. Binary - means two 1, 0 True, False Hot, Cold On, Off We must tbe able to handle more than just values for real world problems
2/3/04 Doc 7 SQL Part 1 slide # 1
2/3/04 Doc 7 SQL Part 1 slide # 1 CS 580 Client-Server Programming Spring Semester, 2004 Doc 7 SQL Part 1 Contents Database... 2 Types of Databases... 6 Relational, Object-Oriented Databases and SQL...
The programming language C. sws1 1
The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan
The string of digits 101101 in the binary number system represents the quantity
Data Representation Section 3.1 Data Types Registers contain either data or control information Control information is a bit or group of bits used to specify the sequence of command signals needed for
Using SQL Queries in Crystal Reports
PPENDIX Using SQL Queries in Crystal Reports In this appendix Review of SQL Commands PDF 924 n Introduction to SQL PDF 924 PDF 924 ppendix Using SQL Queries in Crystal Reports The SQL Commands feature
MS ACCESS DATABASE DATA TYPES
MS ACCESS DATABASE DATA TYPES Data Type Use For Size Text Memo Number Text or combinations of text and numbers, such as addresses. Also numbers that do not require calculations, such as phone numbers,
Excel: Introduction to Formulas
Excel: Introduction to Formulas Table of Contents Formulas Arithmetic & Comparison Operators... 2 Text Concatenation... 2 Operator Precedence... 2 UPPER, LOWER, PROPER and TRIM... 3 & (Ampersand)... 4
Firebird. Embedded SQL Guide for RM/Cobol
Firebird Embedded SQL Guide for RM/Cobol Embedded SQL Guide for RM/Cobol 3 Table of Contents 1. Program Structure...6 1.1. General...6 1.2. Reading this Guide...6 1.3. Definition of Terms...6 1.4. Declaring
CONVERSION FUNCTIONS QUESTIONS
CONVERSION FUNCTIONS QUESTIONS http://www.tutorialspoint.com/sql_certificate/conversion_functions_questions.htm Copyright tutorialspoint.com 1. What will be the outcome of the following query? SELECT ROUND(144.23,-1)
This is great when speed is important and relatively few words are necessary, but Max would be a terrible language for writing a text editor.
Dealing With ASCII ASCII, of course, is the numeric representation of letters used in most computers. In ASCII, there is a number for each character in a message. Max does not use ACSII very much. In the
University Convocation. IT 3203 Introduction to Web Development. Pattern Matching. Why Match Patterns? The Search Method. The Replace Method
IT 3203 Introduction to Web Development Regular Expressions October 12 Notice: This session is being recorded. Copyright 2007 by Bob Brown University Convocation Tuesday, October 13, 11:00 AM 12:15 PM
sqlite driver manual
sqlite driver manual A libdbi driver using the SQLite embedded database engine Markus Hoenicka [email protected] sqlite driver manual: A libdbi driver using the SQLite embedded database engine
Oracle Rdb A Comparison of SQL Dialects for Oracle and Oracle Rdb
Oracle Rdb A Comparison of SQL Dialects for Oracle and Oracle Rdb Release: 1.0 Part No. A53248-01 Oracle Rdb A Comparison of SQL Dialects for Oracle and Oracle Rdb Part No. A53248-01 Release 1.0 Copyright
Binary, Hexadecimal, Octal, and BCD Numbers
23CH_PHCalter_TMSETE_949118 23/2/2007 1:37 PM Page 1 Binary, Hexadecimal, Octal, and BCD Numbers OBJECTIVES When you have completed this chapter, you should be able to: Convert between binary and decimal
Chapter 2. Binary Values and Number Systems
Chapter 2 Binary Values and Number Systems Numbers Natural numbers, a.k.a. positive integers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative numbers A
Key Functions in Oracle SQL
Page 1 of 6 Key Functions in Oracle SQL Use this Quick Reference Guide to locate functions you can use in your queries. There are five tables in this guide: Grouping Functions, Numeric Functions, String
CODESOFT TUTORIAL DOC-OEMCS10-TU-EN-01/01/12
T U T O R I A L CODESOFT TUTORIAL DOC-OEMCS10-TU-EN-01/01/12 The information contained in this guide is not of a contractual nature and may be subject to change without prior notice. The software described
HP Service Virtualization
HP Service Virtualization Fixed Length Protocol Virtualization SV Training September 2014 Fixed Length Protocol Virtualization Technology Description Use Cases Supported Message Structures SV Service Description
A list of data types appears at the bottom of this document. String datetimestamp = new java.sql.timestamp(system.currenttimemillis()).
Data Types Introduction A data type is category of data in computer programming. There are many types so are clustered into four broad categories (numeric, alphanumeric (characters and strings), dates,
Chapter 2: Elements of Java
Chapter 2: Elements of Java Basic components of a Java program Primitive data types Arithmetic expressions Type casting. The String type (introduction) Basic I/O statements Importing packages. 1 Introduction
VB.NET - STRINGS. By calling a formatting method to convert a value or object to its string representation
http://www.tutorialspoint.com/vb.net/vb.net_strings.htm VB.NET - STRINGS Copyright tutorialspoint.com In VB.Net, you can use strings as array of characters, however, more common practice is to use the
ASCII Encoding. The char Type. Manipulating Characters. Manipulating Characters
The char Type ASCII Encoding The C char type stores small integers. It is usually 8 bits. char variables guaranteed to be able to hold integers 0.. +127. char variables mostly used to store characters
NUMBER SYSTEMS. 1.1 Introduction
NUMBER SYSTEMS 1.1 Introduction There are several number systems which we normally use, such as decimal, binary, octal, hexadecimal, etc. Amongst them we are most familiar with the decimal number system.
Data Storage. Chapter 3. Objectives. 3-1 Data Types. Data Inside the Computer. After studying this chapter, students should be able to:
Chapter 3 Data Storage Objectives After studying this chapter, students should be able to: List five different data types used in a computer. Describe how integers are stored in a computer. Describe how
SQL Server Table Design - Best Practices
CwJ Consulting Ltd SQL Server Table Design - Best Practices Author: Andy Hogg Date: 20 th February 2015 Version: 1.11 SQL Server Table Design Best Practices 1 Contents 1. Introduction... 3 What is a table?...
IBM Emulation Mode Printer Commands
IBM Emulation Mode Printer Commands Section 3 This section provides a detailed description of IBM emulation mode commands you can use with your printer. Control Codes Control codes are one-character printer
Choosing a Data Model for Your Database
In This Chapter This chapter describes several issues that a database administrator (DBA) must understand to effectively plan for a database. It discusses the following topics: Choosing a data model for
NUMBER SYSTEMS APPENDIX D. You will learn about the following in this appendix:
APPENDIX D NUMBER SYSTEMS You will learn about the following in this appendix: The four important number systems in computing binary, octal, decimal, and hexadecimal. A number system converter program
Mini User's Guide for SQL*Plus T. J. Teorey
Mini User's Guide for SQL*Plus T. J. Teorey Table of Contents Oracle/logging-in 1 Nested subqueries 5 SQL create table/naming rules 2 Complex functions 6 Update commands 3 Save a query/perm table 6 Select
Lecture 2. Binary and Hexadecimal Numbers
Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations
SQL Server Database Coding Standards and Guidelines
SQL Server Database Coding Standards and Guidelines http://www.sqlauthority.com Naming Tables: Stored Procs: Triggers: Indexes: Primary Keys: Foreign Keys: Defaults: Columns: General Rules: Rules: Pascal
Objective-C Tutorial
Objective-C Tutorial OBJECTIVE-C TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Objective-c tutorial Objective-C is a general-purpose, object-oriented programming
Member Functions of the istream Class
Member Functions of the istream Class The extraction operator is of limited use because it always uses whitespace to delimit its reads of the input stream. It cannot be used to read those whitespace characters,
JavaScript Introduction
JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML, for the web, for servers, PCs, laptops, tablets, phones, and more. JavaScript is a Scripting
Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın
Digital Design Assoc. Prof. Dr. Berna Örs Yalçın Istanbul Technical University Faculty of Electrical and Electronics Engineering Office Number: 2318 E-mail: [email protected] Grading 1st Midterm -
Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
SAP BusinessObjects Business Intelligence platform Document Version: 4.1 Support Package 5-2014-11-06. Information Design Tool User Guide
SAP BusinessObjects Business Intelligence platform Document Version: 4.1 Support Package 5-2014-11-06 Table of Contents 1 What's new in the....14 2 Getting started with the information design tool....18
CS 106 Introduction to Computer Science I
CS 106 Introduction to Computer Science I 01 / 21 / 2014 Instructor: Michael Eckmann Today s Topics Introduction Homework assignment Review the syllabus Review the policies on academic dishonesty and improper
Unsigned Conversions from Decimal or to Decimal and other Number Systems
Page 1 of 5 Unsigned Conversions from Decimal or to Decimal and other Number Systems In all digital design, analysis, troubleshooting, and repair you will be working with binary numbers (or base 2). It
Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems
Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems This assignment is designed to familiarize you with different numbering systems, specifically: binary, octal, hexadecimal (and decimal)
Ejemplos de manipulación de cadenas
Ejemplos de manipulación de cadenas Función Left MsgBox(Funciones_vb.Left(Cadena, 6)) MsgBox(Cadena.Substring(0, 6)) Función Right MsgBox(Funciones_vb.Right(Cadena, 6)) MsgBox(Cadena.Substring(Cadena.Length
