Question
create database db use db create table author(author_id int primary key,author_name varchar(20)); create table publisher(publisher_id int primary key,publisher_name varchar(20)); create table book1(book_id int primary key,ISBN
create database db use db create table author(author_id int primary key,author_name varchar(20)); create table publisher(publisher_id int primary key,publisher_name varchar(20)); create table book1(book_id int primary key,ISBN varchar(20),publisher_id int,Title varchar(20),author_id int, price int,Foreign key(publisher_id) references publisher(publisher_id), Foreign key(author_id) references author(author_id), Foreign key(publisher_id) references publisher(publisher_id)); Insert into author values(40,'James'); Insert into author values(50,'Scott'); Insert into author values(60,'David'); insert into author values(70,'Stuart'); Insert into publisher values(131,'Lap Lambert'); Insert into publisher values(132,'Thomson Reuters'); Insert into publisher values(133,'Wiley'); Insert into book1 values(1,'999-17-129',131,'database',40,5000); Insert into book1 values(2,'989-11-143',132,'Ride sharing system',50,2000); Insert into book1 values(3,'965-12-133',133,'Performance Evaluation System',50,1000); Insert into book1 values(4,'987-15-276',133,'OOP concepts',60,7000); insert into book1 values(5,'999-17-281',133,'Mathematics',60,7000);
write queries in mysql workbench using the given tables.
A. Display book id, title and price of those books whose price is within the range of smallest book price and 3000. 03 B. Display all information of the book whose price is 40% greater than the Database book price? 3.5 C. Display the book id and title of those books who has the same price. Order the output in descending order of their book id? 3.5 D. Display the publisher name and id of those publishers who has published at least 3 books. 03 E. Display book Id and author name of all books whether author has written any book or not? 03 F. Create a view named bookshop such that it displays the id of those books whose title contains alphabet D and price is above 2000. 2.5 G. Display the 3rd highest price of the book along with their book id? 03 H. Display publisher names and first 50 percent characters of the book Title column in lower case? 2.5 I. Display the book title and publisher names in one column named Books Author, show only those books author values whose length is greater than 30? 04 J. Display the last three characters of the book title column? 02Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started