MySQL/tasks/01-select-intro.sql

29 lines
572 B
MySQL
Raw Normal View History

2023-10-27 15:08:20 +00:00
-- Active: 1697184303960@@127.0.0.1@3306
# Date: 13.10.2023
# Author: Sven Vogel
# ---------------------------------------------
# setup database schema
CREATE SCHEMA IF NOT EXISTS task01;
USE task01;
# select a single number
SELECT 5 AS number;
# interpret value as hex
SELECT hex(255) AS hexnum;
# intger encode of ascii '5'
SELECT ASCII('5');
SELECT BIN(65);
# binary value of 'A'
SELECT BIN(ASCII('A'));
# binary encode of 'Mucke'
SELECT CONCAT_WS(
' ',
BIN(ASCII('M')),
BIN(ASCII('u')),
BIN(ASCII('c')),
BIN(ASCII('k')),
BIN(ASCII('e'))
);