3 Replies - 711 Views - Last Post: 31 October 2012 - 03:13 AM Rate Topic: -----

#1 LocalNomad  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 01-September 11

Review of SQL Code

Posted 30 October 2012 - 03:07 PM

I am working on a information management class where the final project is making a database using sqlite. I've written the code for one table. I have a couple questions: 1-Could take a look at eh code to see if there are errors? 2-I am working on an Oracle Associate Certificate in MySQL, and downloaded the MYSQL workbench, is that a good place to operate form. The book comes tomorrow. The course is using SQLite, but from what I can tell the syntax is identical to MYSQL. Am I right, at all?


create table Brazil_Health_WorkForce_Longitudinal_Study
 (Year INT,
  Number of Physicians INT,
  Number of Nursing/MidWifery INT,
  Number of Dentistry Personnel INT,
  Number of Pharmaceutical Personnel INT,
  Number of Public Health Workers INT,);

insert into Brazil_Health_WorkForce_Longitudinal_Study
(2008, 341849, 1243804, 227141, 104098, null,);
insert into Brazil_Health_WorkForce_Longitudinal_Study
(2000,null, null, null, null, 167080,);




Is This A Good Question/Topic? 0
  • +

Replies To: Review of SQL Code

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3550
  • View blog
  • Posts: 10,324
  • Joined: 08-June 10

Re: Review of SQL Code

Posted 30 October 2012 - 11:50 PM

Quote

The course is using SQLite, but from what I can tell the syntax is identical to MYSQL.

more or less. there are commands unknown to SQLite (GROUP_CONCAT()), it is weakly typed, indexes work totally different, etc. you should always check in the SQLite documentation that what you do is correct.
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6075
  • View blog
  • Posts: 23,543
  • Joined: 23-August 08

Re: Review of SQL Code

Posted 31 October 2012 - 03:06 AM

Where SQLite is not MySQL, I'll move this to the plain old Databases forum.
Was This Post Helpful? 0
  • +
  • -

#4 darek9576  Icon User is offline

  • D.I.C Lover

Reputation: 198
  • View blog
  • Posts: 1,692
  • Joined: 13-March 10

Re: Review of SQL Code

Posted 31 October 2012 - 03:13 AM

I dont think you have specified a primary key. I dont know whether it would work in sqlite but in MySQL you can do:

create table sometable(ID INT NOT NULL AUTO_INCREMENT,
...
...,
PRIMARY KEY(ID));


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1