Search results
1 cze 2021 · Use the || operator to concatenate two strings: SELECT 'Hi ' || 'there!'; -- result: Hi there! ||. Use this trick for numbers: Some databases implement non-standard solutions for concatenating strings like CONCAT() or CONCAT_WS(). Check the documentation for your specific database. Use the _ character to replace any single character.
Function coalesce(column_1, column_2, ...) takes two or more arguments (columns or other values like strings, numbers) and return first non-NULL argument. Principle of work: check if first argument is NULL. if yes, go to the next step, otherwise return the argument
Chapter 1: Getting started with SQL; Chapter 2: ALTER TABLE; Chapter 3: AND & OR Operators; Chapter 4: Cascading Delete; Chapter 5: CASE; Chapter 6: Clean Code in SQL; Chapter 7: Comments; Chapter 8: Common Table Expressions; Chapter 9: CREATE Database; Chapter 10: CREATE FUNCTION; Chapter 11: CREATE TABLE; Chapter 12: cross apply, outer apply ...
Standard SQL Functions Cheat Sheet. NUMERIC FUNCTIONS. BASIC OPERATIONS. Use +, -, *, / to do some basic math. To get the number of seconds in a week: SELECT 60 * 60 * 24 * 7; -- result: 604800. CASTING. From time to time, you need to change the type of a number. The . CAST() function is there to help you out. It lets you change the type of ...
SQL is a standard language for storing, manipulating and retrieving data in databases. Our SQL tutorial will teach you how to use SQL in: MySQL, SQL Server, MS Access, Oracle, Sybase, Informix, Postgres, and other database systems.
You’ll learn the theory behind T-SQL querying and programming and how to develop T-SQL code to query and modify data, and you’ll get an overview of programmable objects. Although this book is intended for beginners, it’s not merely a set of procedures for readers to follow.
SQL, or Structured Query Language, is the primary language used to communicate with relational databases. The goal of this book is to serve as a useful introductory guide to this essential language. In an alternate universe, the title of this book might have been The Logic of SQL.