SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table science_class (Enrollment_no INT, Name VARCHAR, Science_Marks DECIMAL); insert into science_class values (1, 'Popeye', -33.347); insert into science_class values (2, 'Olive', 54.589); insert into science_class values (3, 'Brutus', 98.452); insert into science_class values (4, 'Robb', 75.856); insert into science_class values (5, 'Olive', 98.452); insert into science_class values (6, 'Brutus', 127.541); select abs(science_marks) from science_class where name = 'Popeye'; create table science_id (id INT); insert into science_id values (1); select * from science_class; select sum(science_marks) as total_marks, count(enrollment_no) as total_enrollment from science_class where science_class.enrollment_no = (select id from science_id); select name from science_class where science_marks > 60; select name, sum(science_marks) from science_class group by name having sum(science_marks) > 100; select * from science_class where science_marks between 35 and 60; select * from science_class where science_marks not between 35 and 60; select count(*) from science_class where science_marks not between 35 and 60; UPDATE science_class SET science_marks = 45 WHERE name = 'Popeye'; alter table science_class rename column name to student_name; select * from science_class order by enrollment_no desc; select * from science_class order by enrollment_no asc limit 3; select enrollment_no, student_name from science_class; select * from science_class where student_name in ('Popeye', 'Olive'); select distinct student_name from science_class where student_name in ('Popeye', 'Olive'); select * from science_class where student_name like '_l%'; select * from science_class where student_name like '_^l%'; select * from science_class where student_name like 'B%'; select sum(science_marks) from science_class; select round(sum(science_marks),0) from science_class; select avg(science_marks) from science_class where student_name = 'Olive'; select min(science_marks) as min_age, max(science_marks) as max_age from science_class where student_name = 'Olive'; select distinct student_name from science_class where mod (enrollment_no, 2) = 0 order by student_name desc; select (count(science_marks) - count(distinct science_marks)) as science_count from science_class; select min (length(student_name)) from science_class; select distinct lower(substr(student_name, 1, 1)) as sub_name from science_class; select distinct student_name from science_class where lower(substr(student_name, 1, 1)) in ('p', 'o','e', 'y'); SELECT sqrt(power(3,2));

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear