Search results
1 cze 2021 · Fetch all names that start with any letter followed by 'atherine': SELECT name FROM names WHERE name LIKE '_atherine'; Fetch all names that end with 'a': SELECT name FROM names WHERE name LIKE '%a'; USEFUL FUNCTIONS. Get the count of characters in a string: SELECT LENGTH('LearnSQL.com');-- result: 12 Convert all letters to lowercase: SELECT ...
1 cze 2021 · Standard SQL Functions Cheat Sheet. TEXT FUNCTIONS. CONCATENATION. Use the || operator to concatenate two strings: SELECT 'Hi ' || 'there!'; -- result: Hi there! Remember that you can concatenate only character strings using. ||. Use this trick for numbers: SELECT '' || 4 || 2; -- result: 42.
Exercises. We have gathered a variety of SQL exercises (with answers) for each SQL Chapter. Try to solve an exercise by filling in the missing parts of a code. If you're stuck, hit the "Show Answer" button to see what you've done wrong. Count Your Score. You will get 1 point for each correct answer.
Learning SQL eBook (PDF) Download this eBook for free. Chapters. 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.
The SQL Cookbook moves quickly from problem to solution, saving you time each step of the way.... Table of Contents. 1. Working with Ranges. 1.1. Locating a Range of Consecutive Values. 1.2. Finding Differences Between Rows in the Same Group or Partition. 1.3. Locating the Beginning and End of a Range of Consecutive Values. 1.4.
10 sty 2012 · It has to do with the Normal Form for the SQL language. IF statements can, by definition, only take a single SQL statement. However, there is a special kind of SQL statement which can contain multiple SQL statements, the BEGIN-END block.
This document contains a 15 question quiz about SQL functions. It tests knowledge of functions like TRUNC, ROUND, MOD, SUBSTR, INSTR, LENGTH, CONCAT, SYSDATE, ADD_MONTHS, and LAST_DAY. For each question, the user selects an answer and is told if it is correct or not, with explanations for incorrect answers.