create table Author(
author_id Int Primary Key Auto_Increment ,
author_name Varchar(50) Not Null
);
create table Books(
book_id Int NOT Null AUTO_INCREMENT PRIMARY KEY ,
title Varchar(30) NOT NULL,
ratings Decimal(5,2),
au_id int,
Foreign Key (au_id) references Author(author_id)
);
insert into Author (author_name) values ('Raj') ,('Ram'), ('Shyam'), ('Mohan') ,('Sumit');
INSERT INTO Books(title, ratings, au_id) VALUES ('She Know to Dance', 1.2, 1),('He Willing to Dance', 4.2, 2),('Y Y Dance', 3.4, 2),('Come and Dance', 2.67, 4),('Not Now Never', 5.00, 3);
#select author_name , title, ratings from Author INNER JOIN Books On Books.au_id = Author.author_id;
#select author_name,title,ratings from Author Left Join Books On Books.au_id = Author.author_id ;
#select author_name,ifNull(title,'Not FOund'),IfNull(ratings,0) from Author Left Join Books On Books.au_id = Author.author_id ;
select author_name ,ratings, CASE WHEN IFNULL(ratings,0) >= 3 then "GOOD" ELSE "AVERAGE" END as REMARK from Author INNER JOIN Books On Books.au_id = Author.author_id;
#https://[Log in to view URL]
To embed this project on your website, copy the following code and paste it into your website's HTML: