Beginning SQL

Beginning SQL Beginning SQL

marjan.fesb.hr
from marjan.fesb.hr More from this publisher
20.07.2013 Views

Chapter 1 Exercise 1 Solution A Exercise Answers A separate table, which you can call the Location table, with a primary key field of integer data type should hold the meeting location details. The table should look like the table shown below: Field Name Data Type Notes LocationId integer Primary key Location varchar(200) You need to alter the Attendance table so that instead of storing the whole address in the Location field for every record, the table stores the integer value from the Location table shown above. The new Attendance table looks like this: Field Name Data Type Notes MeetingDate date Change to datetime data type if using MS SQL Server LocationId integer Foreign key MemberAttended char(1) MemberId integer Foreign key linking to MemberDetails table

Chapter 1<br />

Exercise 1 Solution<br />

A<br />

Exercise Answers<br />

A separate table, which you can call the Location table, with a primary key field of integer data<br />

type should hold the meeting location details. The table should look like the table shown below:<br />

Field Name Data Type Notes<br />

LocationId integer Primary key<br />

Location varchar(200)<br />

You need to alter the Attendance table so that instead of storing the whole address in the Location<br />

field for every record, the table stores the integer value from the Location table shown above. The<br />

new Attendance table looks like this:<br />

Field Name Data Type Notes<br />

MeetingDate date Change to datetime data type if using MS<br />

<strong>SQL</strong> Server<br />

LocationId integer Foreign key<br />

MemberAttended char(1)<br />

MemberId integer Foreign key linking to MemberDetails table

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!