SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
DROP TABLE IF EXISTS Directors; CREATE TABLE Directors ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(40), surname VARCHAR(40), email VARCHAR(40) ); INSERT INTO Directors (name, surname, email) VALUES ('Christopher', 'Nolan', 'chris@gmail.com'), ('Steven', 'Spielberg', 'sspil@outlook.com'), ('Quentin', 'Tarantino', 'queen@gmail.com'), ('Martin', 'Scorsese', 'martins@outlook.com'), ('David', 'Fincher', 'dfincher@outlook.com'), ('Ridley', 'Scott', 'riddler@gmail.com'), ('Stanley', 'Kubrick', 'bigstan@icloud.com'), ('Clint', 'Eastwood', 'cowboy@yahoo.com'), ('James', 'Cameron', 'jamesava@yahoo.com'), ('Tim', 'Burton', 'timmy@icloud.com'); SELECT RPAD(LEFT(name, 1), CHAR_LENGTH(name)-1, '*'), surname FROM Directors --WHERE LOCATE('s', surname ) = 1 --ORDER BY LEFT(name, 1) , surname --LIMIT 5

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear