Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

Express the following queries in SQL:

(a) Write the SQL code that will create ALL the four tables given in the appendix. Your answer should not contain the primary key and foreign key constraint declaration. The data type for each attribute should be for the SQL Server 2005 convention.

(b) Having created the table structure in question (a) above, write SQL code to make the following change in the structure of the tables:

(i) Make the PubId the Primary Key in the Publisher table

(ii) Make the ISBN the primary key and the Pub_Id the foreign key in the Book table.

(iii) Make the AU_ID and the ISBN the Primary Key of the Book_Author table.

(iv) Make the AU_ID and the ISBN the foreign key of the Book_Author table.

(v) Make the AU_ID the Primary key of the Author table

(c) After creating the table structure above, you write the following SQL code to insert the first row in the Book table:

Insert into Book

Values(‘0-0038307-6-4', ‘dBASE III : A Practical Guide', 1985, 469);

When you run the above code SQL Server shows an error message. Explain the reason for the error. How will you correct the error? Explain your answer fully.

(d) If you wanted the au_id column to be automatically incremented when inserting new record in the author table, how would you modify the create statement in question(a) above so that it starts with the number 100 and increment by one every time you create a new record in that table.

(e) Write the SQL code to change the year born value from 1970 to 1971 for the author whose ID is 1.

(f) Write the SQL code required to list all book details whose title's name contains the word "Information".

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M9585489

Have any Question?


Related Questions in DBMS

Stored procedure please create the following stored

Stored procedure. Please create the following stored routines using CPS3740_2017S database using the tables in dreamhome database. xxxx is your email id 1) Implement a stored procedure p3Q21_xxxx to display the Branch ci ...

Project outline and requirements provide a brief

Project Outline and Requirements Provide a brief description of the organization (can be hypothetical) that will be used as the basis for the projects in the course. Include company size, location(s), and other pertinent ...

Database design amp development assignment -assignment

Database Design & Development Assignment - Assignment title - Design and Implement a Relational Database for a local Print and Ink Refill Business. Learning Outcome - Use an appropriate design tool to design a relational ...

Real time analytics - data analytics assignment -this is a

Real Time Analytics - Data Analytics Assignment - This is a business analytics project aimed at generating innovative analytics solutions for a Global Food Consulting firm working in the area of Animal agriculture and fa ...

We can represent a data set as a collection of object nodes

We can represent a data set as a collection of object nodes and a collection of attribute nodes, where there is a link between each object and each attribute, and where the weight of that link is the value of the object ...

Instructionsfor decades relational databases remained

Instructions For decades, relational databases remained essentially unchanged; data was segmented into specific chunks for columns, slots, and repositories, also called structured data. However, in this Internet of Thing ...

Case study problem 1 the case study company has experienced

Case Study: Problem 1 The case study company has experienced rapid growth in both the size of its client base and also in the services provided to clients. Unfortunately, the growth in data management policies, procedure ...

Assignment question - write and run sql statements to

Assignment Question - Write and run SQL statements to complete the following tasks Part A - DML 1. Locate the record in the vendor table that does not have a value for the attribute V_STATE 2. Find the customers whose ba ...

Assignmenta restaurant is designing a database to keep

Assignment A restaurant is designing a database to keep track of customer services. A customer is defined as a customer ID, name, address and a telephone number. Customers are served by employees. Each employee is define ...

This assignment is a continuation of this solution the case

This assignment is a continuation of this solution The case study company has received the first report from its enterprise content management (ECM) consultant and now has a documented list of major content requirements ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As