lukegriffiths110
asked on
sql statements
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
(2)
Given the same tables above, write an sql statement which adds the following data to the table named 'titles'
Title: Mysql Pocket Reference
ISBN: 059600446x
Year:2003
Publisher ID:1234
(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
(2)
Given the same tables above, write an sql statement which adds the following data to the table named 'titles'
Title: Mysql Pocket Reference
ISBN: 059600446x
Year:2003
Publisher ID:1234
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You also don't need the "WITH OWNERACCESSOPTION".
This ought to cover the second question:
INSERT INTO Titles ( ISBN, Title_name, [year], pub_id )
SELECT "059600446x" AS Expr1, "Mysql Pocket Reference" AS Expr2, "2003" AS Expr3, "1234" AS Expr4
INSERT INTO Titles ( ISBN, Title_name, [year], pub_id )
SELECT "059600446x" AS Expr1, "Mysql Pocket Reference" AS Expr2, "2003" AS Expr3, "1234" AS Expr4