Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
create table student (
id int(10) unsigned not null primary key auto_increment,
name varchar(100) not null
);
insert into student values (NULL, 'Ivan Ivanov'), (NULL, 'Peter Petrov');
create table major (
id int(10) unsigned not null primary key auto_increment,
name varchar(100) not null
);
insert into major values (NULL, 'Mathematics'), (NULL, 'Biology');
create table mark (
id int(10) unsigned not null primary key auto_increment,
student_id int(10) unsigned not null,
major_id int(10) unsigned not null,
score decimal(3,2) not null
);
insert into mark values (NULL, 1, 1, '5.40'), (NULL, 1, 2, '4.30'), (NULL, 2, 1, '6.00'), (NULL, 2, 2, '4.70');
select student.name as 'Student', major.name as 'Major', mark.score as 'Score' from student left join mark on student.id = mark.student_id left join major on mark.major_id = major.id;
+---------------+---------------+-------+
| Student | Major | Score |
+---------------+---------------+-------+
| Ivan Ivanov | Mathematics | 5.40 |
| Ivan Ivanov | Biology | 4.30 |
| Peter Petrov | Mathematics | 6.00 |
| Peter Petrov | Biology | 4.70 |
+---------------+-------------+-------+