victorluissantos / mysql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MySQL

This project provides several functions and stored procedures for applications that use MySQL databases.

https://github.com/victorluissantos/mysql https://github.com/victorluissantos/mysql/tree/main/pt https://github.com/victorluissantos/mysql/tree/main/es https://tawk.to/chat/5afad6f35f7cdf4f05343d7e/default

Documentation

Function name Parameters Example of use Result\Return
iniFCap() VARCHAR(250) SELECT initCap('victor'); Victor
hiding() VARCHAR(120),VARCHAR(1),INT(11),INT(11) SELECT hiding('4290 8930 5632','*',2,12); 42** **** **32
iniCap() VARCHAR(250) SELECT initCap('victor luis'); Victor Luis
moneyFormat() String(22) Decimal(22,2), String(2) SELECT moneyFormat(2020.12,'$'); $2.020,12
shortName() VARCHAR(250) SELECT shortName('Victor Luis Santos') Victor L. Santos
pasTimer() DateTime SELECT pasTimer('2020-12-21 18:30:15') 1h
Stored Procedures name Parameters Example of use Result\Return
relocatedId() VARCHAR(250) CALL relocatedId('users'); Antes: SELECT MAX(id) FROM <your_table> Return: 190
Depois: SELECT MAX(id) FROM <your_table> Return: 140
criptoFields() VARCHAR(250) CALL criptoFields('users','senha','MD5'); SELECT senha FROM user Antes: 123456
Depois: 'e10adc3949ba59abbe56e057f20f883e'
removeDouble() VARCHAR(250) CALL removeDouble('products','name'); SELECT COUNT(t.total) AS total_repetidosFROM (SELECT COUNT(name) AStotal, name FROM products GROUP BY name) t WHERE t.total>1 Antes: 1
Depois: 0

How run

  1. You can Download to MySQL 5.6Version with Workbench in:
    Download
    or if you using Windows:
    Download windows

Acknowledgment

I made this repository to commemorate the conquest of MySQL Linkedin certificate that could

connect-linkedin

About

License:MIT License