0% found this document useful (0 votes)
84 views2 pages

Create Int Int Foreign Key References: Author-Id:int, Publisher-Id:int, Category-Id:int, Book-Id:int

1. The document describes how to create tables for a book dealer database including tables for authors, publishers, categories, books, and orders. It also provides examples of queries and data manipulation tasks for the database. 2. Tables are created with the proper data types and constraints like primary keys and foreign keys. Sample data is inserted into each table. 3. Queries are written to find book details by price, compare book prices to average, delete a tuple matching conditions, and display results meeting other criteria.

Uploaded by

praneeth530
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views2 pages

Create Int Int Foreign Key References: Author-Id:int, Publisher-Id:int, Category-Id:int, Book-Id:int

1. The document describes how to create tables for a book dealer database including tables for authors, publishers, categories, books, and orders. It also provides examples of queries and data manipulation tasks for the database. 2. Tables are created with the proper data types and constraints like primary keys and foreign keys. Sample data is inserted into each table. 3. Queries are written to find book details by price, compare book prices to average, delete a tuple matching conditions, and display results meeting other criteria.

Uploaded by

praneeth530
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

create table emp (empid int, deptid int foreign key references department(deptid)) 1.

Expain views in sql server with examples? 2.Explain stored procedures and functions with examples? 3.Explain triggers with examples? 4. The following tables are maintained by a book dealer: 1. AUTHOR (author-id: int, name: string, city: string, country: string) 2. PUBLISHER (publisher-id : int, name: string, city:string, country : string) 3. CATEGORY (category-id:int, description:string) 4. CATALOG (book-id : int, title : string, author-id:int, publisher-id:int, category-id:int, year:int, price:int) 5. ORDER-DETAILS (order-no:int, book-id:int, quantity:int) (i) Create the above tables by properly specifying the primary keys and the foreign key? (ii) Enter at least five tuples for each relation. (iii) Increase the price of books published by a publisher whose name starts with a by 10%.?

(iv) Write a query to find the book details whose price is maximum? (v) Write a query to find the book details whose price is greater than the average amount? (vi) Delete the tuple whose book price is 500 and author name ends with y? (vii) Display the name of the books whose author name is repeated more than once? (viii) Display the orderno whose book id is more than 2? (ix) Display the book id whose price is between 500 and 2000?

You might also like