20.07.2013 Views

Beginning SQL

Beginning SQL

Beginning SQL

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2<br />

Exercise 1 Solution<br />

There are two different solutions to this exercise (both displayed subsequently) because of the way in<br />

which Oracle requires you to write dates.<br />

Non-Oracle Solution<br />

If you’re using <strong>SQL</strong> Server, IBM DB2, My<strong>SQL</strong>, or MS Access, use the following solution:<br />

INSERT INTO MemberDetails<br />

(<br />

MemberId,<br />

FirstName,<br />

LastName,<br />

DateOfBirth,<br />

Street,<br />

City,<br />

State,<br />

ZipCode,<br />

Email,<br />

DateOfJoining<br />

)<br />

VALUES<br />

(<br />

7,<br />

‘John’,<br />

‘Jackson’,<br />

‘1974-05-27’,<br />

‘Long Lane’,<br />

‘Orange Town’,<br />

‘New State’,<br />

‘88992’,<br />

‘jjackson@mailme.net’,<br />

‘2005-11-21’<br />

);<br />

INSERT INTO MemberDetails<br />

(<br />

MemberId,<br />

FirstName,<br />

LastName,<br />

DateOfBirth,<br />

Street,<br />

City,<br />

State,<br />

ZipCode,<br />

Email,<br />

DateOfJoining<br />

)<br />

VALUES<br />

Exercise Answers<br />

369

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

Saved successfully!

Ooh no, something went wrong!