• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

Revision question

Please can someone help with these questions: -

(1)

Given the tables of a database below, write an sql statement which merges the author names and the names of the titles they have published into a new table. The result has to be sorted using the title names. The asterisks (*) indicate the primary keys. The relationships are ISBN (Titles) to ISBN (Author_title) as 1:n without referential integrity. Author_ID (Author_title) to Author_ID (Author) as n:1 with referential integrity.

Titles                               Author_title                     Author

(*)ISDN                           ISBN                          (*)Author_ID
title_name                        Author_ID                       Author_name  
pub_id
year
0
lukegriffiths110
Asked:
lukegriffiths110
1 Solution
 
rafranciscoCommented:
Is this homework?
0
 
lukegriffiths110Author Commented:
nar it is exam revision. A question from a previouse paper. I am not sure if it is asking for select statement or a create statement.
0
 
lukegriffiths110Author Commented:
or an insert
0
 
dbeneitCommented:
Here's that:


select t.Title_name,A.author_name into Newtablename from titles t inner join author_title AT on t.ISDN=at.ISBN inner join author a on at.author_id=a.author_ID order by t.title_name

0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
We shouldn't give you the answer but put you in the right way.
It's a SELECT INTO statement that you need to answer that question.

Good luck
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now