November 2012
Beginner
336 pages
9h 48m
English
If you indicate on your résumé that you have some database experience or the job you apply for involves working with databases, interviewers will probably ask you database questions to determine the depth of your knowledge.
Olympics(
city CHAR(16),
year INTEGER(4)
);
This is an extremely easy problem that an interviewer might use to determine whether you have ever used SQL before or whether you were padding your résumé when you mentioned it. If you know SQL, you’re all set. It’s a straightforward SQL INSERT statement; no tricks. If you don’t know SQL, you’re in trouble. The correct answer is
INSERT INTO Olympics VALUES( 'Montreal', 1976 );
Company (
companyName CHAR(30),
id INTEGER(4) PRIMARY KEY
);
EmployeesHired (
id INTEGER(4),
numHired INTEGER(4),
fiscalQuarter INTEGER(4),
FOREIGN KEY (id) REFERENCES Company
);
| companyName | id |
| Hillary Plumbing | 6 |
| John Lawn Company | 9 |
| Dave Cookie Company | 19 |
| Jane Electricity | 3 |
| id | numHired | fiscalQuarter |
| 3 | 3 | 2 |
| 3 | 2 | 4 |
| 19 | 4 | 1 |
| 6 | 2 | 1 |
Read now
Unlock full access