Write sql code that will create the writes table, PL-SQL Programming

Assignment Help:

Question:

Consider the following relations (primary keys are underlined):

AUTHOR (ANo, aname, address, speciality)
PUBLISHER (PNo, pname, Location)
BOOK (BNo, Title, ISBN, PNo, Edition)
WRITES (BNo, ANo, ReleasedDate)

Where

AUTHOR contains author details and ANo (Author Number) is the primary key, aname stands for Author NAme. PUBLISHER contains publisher details and PNo (Publisher Number) is the primary key, pname stands for Publisher Name . BOOK contains details of the book and its primary key is Bno (Book Number).

Express the following queries in SQL:

(a) Write SQL code that will create the WRITES table. Choose appropriate data type and field size. Your answer should show the Primary key and Foreign key constraint. Make any assumption if possible.

(b) Write SQL code which will insert a row in the publisher table. Choose appropriate data value for the record.

(c) List all the titles published by Pitman?

(d) List all the speciality of all authors publishing a book with MIT Press.

(e) List the location of the publisher who published the book 'A guide to DB2'?

(f) List the names of all publishers publishing any book written by Smith or Jones.

(g) Gives the names of all publishers who have not published a book by Jones?


Related Discussions:- Write sql code that will create the writes table

Closing a cursor - explicit cursor, Closing a Cursor The CLOSE stateme...

Closing a Cursor The CLOSE statements disable the cursor, and the result set becomes undefined. An illustration of the CLOSE statement as shown: CLOSE c1;

Using first and last - collection method, Using FIRST and LAST FIRST a...

Using FIRST and LAST FIRST and LAST return the first and last (minimum and maximum) index numbers in a collection. When the collection is empty, the FIRST and LAST return NULL

Declaring and initializing objects in pl/sql, Declaring and Initializing Ob...

Declaring and Initializing Objects: An object type is once defined and installed in the schema; you can use it to declare the objects in any PL/SQL, subprogram, block or packa

Data types, Datatypes Every constant and variable has a datatype that s...

Datatypes Every constant and variable has a datatype that specifies the storage format, constraints, and the valid range of values. The PL/SQL gives a variety of predefined dat

Exceptions - syntax, Exceptions An exception is the runtime error or wa...

Exceptions An exception is the runtime error or warning condition that can be predefined or user-defined. The Predefined exceptions are raised implicitly through runtime system

Updating objects in pl sql, Updating Objects: To change the attributes...

Updating Objects: To change the attributes of objects in an object table, you can use the UPDATE statement, as the illustration below shows: BEGIN UPDATE persons p SET p

Pl/sql expressions , Pl/SQL Expressions The Expressions are constructed...

Pl/SQL Expressions The Expressions are constructed by using the operands and operators. An operand is a constant, literal, variable, or function call which contributes a value

Update stock levels, At times, customers make mistakes in submitting their ...

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean's wants to create a trigger that automatically updates the stock level of all pr

Parameter and keyword description - exit statement, Parameter and Keyword D...

Parameter and Keyword Description: EXIT: An unconditional EXIT statement (i.e., one without a WHEN clause) exits the present loop instantly. The Execution resumes with th

Join and and in sql, JOIN and AND in SQL In this Section is all about ...

JOIN and AND in SQL In this Section is all about one operator, JOIN. SQL's closest counterpart, NATURAL JOIN, has already been covered. Here we look at several other "join" op

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd