xyz publishing company produces scientific books on various subjects. they need
ID: 3670396 • Letter: X
Question
xyz publishing company produces scientific books on various subjects. they need a database to maintain information about their authors, editors and books. They need a database to mainatin their information about their authors, editors and books. The author information would include the name of the author, their phone number, and email address and the subject area they specialize in. Each author may be working with more tht one editor at any given time. Each author may have written many books. The editor information would include the name of the editor, their phone number#, and email address, the books they are editing and the authors they are working with. Each editor may be working with more than one author at any given time. Each editor may be editing many books at any given time. The book information would include the title of the book, ISBN number and the subject area that the book covers. Each book has only one author but may have many editors. Some of the goals that xyz wants to accomplish with their database include the following information: Names of the authors and the names of the editors, books that have been published for a particular subject area, editors that have worked on books for a particular subject. You are required to use any available tool to design and develop an ER diagram and write SQL script.
Explanation / Answer
CREATE TABLE `book_details` ( `id` int(5) NOT NULL AUTO_INCREMENT, `name` varchar(200) DEFAULT NULL, `pages` varchar(200) DEFAULT NULL, `category` varchar(200) DEFAULT NULL, `price` varchar(200) DEFAULT NULL, `isbn` varchar(200) DEFAULT NULL, `edition` varchar(200) DEFAULT NULL, `publication` varchar(200) DEFAULT NULL, `author` varchar(200) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*Data for the table `book_details` */ insert into `book_details`(`id`,`name`,`pages`,`category`,`price`,`isbn`,`edition`,`publication`,`author`) values (1,'ANCI C','543','Text Book','500','9884858702','2nd','TATA Mecrawhill','Balagurusamy'); /*Table structure for table `issue_book` */ DROP TABLE IF EXISTS `issue_book`; CREATE TABLE `issue_book` ( `user_id` varchar(200) DEFAULT NULL, `book_id` varchar(200) DEFAULT NULL, `issue_date` varchar(200) DEFAULT NULL, `renual_date` varchar(200) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*Data for the table `issue_book` */ insert into `issue_book`(`user_id`,`book_id`,`issue_date`,`renual_date`) values ('11MCA04 ','1','26/10/2013','10/11/2013'); /*Table structure for table `user` */ DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(5) NOT NULL AUTO_INCREMENT, `username` varchar(200) DEFAULT NULL, `pwd` varchar(200) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; /*Data for the table `user` */ insert into `user`(`id`,`username`,`pwd`) values (1,'ramesh','ramesh'),(2,'baskar','baskar');
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.