Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-27 Thread Arun - Siara Logics (cc)
I have modified the database and updated the repository at https://github.com/siara-cc/employee_db. Given below is the revised script. Regards Arun CREATE TABLE employees ( emp_id INTEGER NOT NULL, birth_date DATE NOT NULL, first_name TEXT NOT NULL, la

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-24 Thread Jungle Boogie
On Sun 23 Dec 2018 7:15 PM, Larry Brasfield wrote: > Jungle Boogie wrote: > ➢ Anyone else have issues decompressing the file? $ bzip2 -d employees.db.bz2 > bzip2: employees.db.bz2 is not a bzip2 file. bunzip2 employees.db.bz2 > bunzip2: employees.db.bz2 is not a bzip2 file. $ file employees.db.b

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-23 Thread Arun - Siara Logics (cc)
I simply did a bzip2 of the db file, uploaded it using "git add" and "git commit". I just downloaded it now from "View Raw" and the shasum of the downloaded file matches with what I uploaded. shasum -a 256 ~/Downloads/employees.db.bz2 dd0b87d339494d2ee2f21a66a3b253f58c1a5517e7705427382c0ff8c5a

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-23 Thread Larry Brasfield
Jungle Boogie wrote: ➢ Anyone else have issues decompressing the file? $ bzip2 -d employees.db.bz2 bzip2: employees.db.bz2 is not a bzip2 file. bunzip2 employees.db.bz2 bunzip2: employees.db.bz2 is not a bzip2 file. $ file employees.db.bz2 employees.db.bz2: Non-ISO extended-ASCII HTML document t

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-23 Thread Jungle Boogie
On Wed 19 Dec 2018 2:34 PM, Arun - Siara Logics (cc) wrote: > This project (https://github.com/siara-cc/employee_db) hosts the Sqlite3 db > file ported from mysql test_db found at > https://github.com/datacharmer/test_db. It can be used to test your > applications and database servers. To use t

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-21 Thread Simon Slavin
On 21 Dec 2018, at 5:54pm, James K. Lowden wrote: > If the assigning body didn't intend the "number" as a quantity, it's > not. Treating it as such will often come to tears. I've seen this argument phrased as "Are you going to do maths on it ? If not, don't store it as a number.". And yes,

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-21 Thread James K. Lowden
On Thu, 20 Dec 2018 15:42:27 + Chris Locke wrote: > and a model number is a numeric number My phone's model number is VVX 500. > set the column affinity to the type of data Yes, and not everything that looks like a number is a number. Some things that start out looking like numbers chan

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-20 Thread Stephen Chrzanowski
Right up until procedures change and the identifier has changed from an integer only data type to something that starts containing characters. There's so many different types of UPCs out there, for example, that a company can switch from an integer only type of UPC to something that contains letter

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-20 Thread Arun - Siara Logics (cc)
Hi Chris, James, Shawn, Thanks for the suggestions - I think they are quite relevant. I will modify and update soon. I kept the page size as 512 without rowid and dropped foreign keys so I could use it to demo SQLite on a low memory SoC ESP8266 (see https://github.com/siara-cc/esp_arduino_sql

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-20 Thread Chris Locke
> Just because something doesn't have to be calculated, means that it has to be stored as text. Sorry - forgot a 'doesn't'. Just because something doesn't have to be calculated, doesn't mean that it has to be stored as text. On Thu, Dec 20, 2018 at 3:42 PM Chris Locke wrote: > Just because some

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-20 Thread Chris Locke
Just because something doesn't have to be calculated, means that it has to be stored as text. Its usually recommended to set the column affinity to the type of data you're storing. If you're storing a number (and a model number is a numeric number) then it should be stored in a numeric field. If

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-20 Thread James K. Lowden
On Wed, 19 Dec 2018 10:55:11 + Chris Locke wrote: > Fields with '_no' are read as 'number' and so should be a number. > OK, that doesn't always work for 'telephone_no' (they usually start > with a 0 Lots of numbers are labels that aren't meant to be calculated on. Item number, part number,

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Chris Locke
> Then add foreign key constraints so the relations between the tables > are explicit... On the GitHub page for the database, it states that, "RowIds, Foreign keys, secondary keys, defaults and cascade have not been ported." Most of the tools to create a 'proper' database... But otherwise, an inte

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Shawn Wagner
I'd start by making the employees table a normal rowid one with an INTEGER PRIMARY KEY (*Not* INT) column, and change all those VARCHAR, CHAR and DATE column types to TEXT (or NUMERIC for the dates depending on the values they hold). Then add foreign key constraints so the relations between the ta

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Arun - Siara Logics (cc)
Hi Chris, I don't own the MySQL side of the db, but its easy for me to change anything on Sqlite side. To me the data looks decent for testing and creating applications for demo or learning. I am giving below the script and I will incorporate any other suggestions you may come up with: CREAT

Re: [sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Chris Locke
The scheme (for me) is like nails on a chalkboard. 'dept_no' but defined as a 'CHAR', then 'emp_no' as an INT. Fields with '_no' are read as 'number' and so should be a number. OK, that doesn't always work for 'telephone_no' (they usually start with a 0 ... well, they do in the UK where I am...)

[sqlite] Sample Employee database ported to SQLite from MySQL

2018-12-19 Thread Arun - Siara Logics (cc)
This project (https://github.com/siara-cc/employee_db) hosts the Sqlite3 db file ported from mysql test_db found at https://github.com/datacharmer/test_db. It can be used to test your applications and database servers. To use this project, download employees.db.bz2, unzip and open using sqlite3