SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table tbl_student ( stud_id int PRIMARY KEY AUTO_INCREMENT, stud_name varchar(50), stud_age int, stud_bday date, stud_allowance int ); INSERT INTO tbl_student (stud_name, stud_age, stud_bday, stud_allowance) VALUES ('Lorrein', 21, '2002-11-20', 150), ('Josh', 21, '2002-08-09', 200), ('DJ', 20, '2003-08-18', 250); DELIMITER $$ CREATE OR REPLACE PROCEDURE pr_StudentData (_name varchar(50)) AS BEGIN SELECT * FROM tbl_student where stud_name = _name; END $$ DELIMITER; call pr_StudentData ('lors'); DROP FUNCTION Savings(); CREATE FUNCTION Savings() RETURNS int BEGIN RETURN 50; END CREATE FUNCTION studSavings(stud_allowance) RETURNS NUMERIC(5,2) BEGIN RETURN stud_allowance + (stud_allowance - Savings); END

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear