About Me

My photo
I worked as freelancer on freelance.com for many years, Then opened my Company. I did software coding with my company. But also did pottery -- I know well business management. Software coding is coming next to it as a plus. It helps but organising is as much important as coding. I have many years of experience in business management of Industrial Construction works. I am quite known as company for CAD drafting and 3d for architectural design. I had quite a lot experience at USA and at Turkey. I am less known, in my pottery love.

Thursday, February 22, 2024

SQL - examples

 3 tables join

SELECT

  tbl_data_09_12_fon_islem.fon_id,

  tbl_data_09_11_fon_id.fon_ad,

  tbl_data_09_12_fon_islem.islem_id_date,

  tbl_ref_09_11_islem_tip.islem_tip, 

  tbl_data_09_12_fon_islem.islem_amount 

FROM

  tbl_data_09_12_fon_islem

  INNER JOIN tbl_data_09_11_fon_id ON tbl_data_09_12_fon_islem.fon_id = tbl_data_09_11_fon_id.fon_id

  INNER JOIN tbl_ref_09_11_islem_tip ON tbl_data_09_12_fon_islem.islem_tip_id = tbl_ref_09_11_islem_tip.islem_tip_id 

Order By tbl_data_09_11_fon_id.fon_ad, tbl_data_09_12_fon_islem.islem_id_date;


Relationship; 

suppose we have two tables country and city

  • country: 
    • countryid - integer - Primarykey
    • countryname - char - index unique
  • city
    • cityid - int - primary key
    • cityname - char - index unique
    • countryid - int - index 
      • relationship connection is done here on the child table and not on the parent
      • so the relationship to the table country will appear on here
      • you must first create the index here so as the connection 1 to many becomes possible 
XAMPP - how to transfer db from one computer to another
  • dbconfig.php
    • localhost:3310 or whatever - change it
  • phpmyadmin
    • user account password 
      • olustur
      • pass ayni olmayabilir ona gore update?
    • user account config pass 
      • degistir
    • XAMPP 
      • kapat
      • yeniden ac
  • XAMPP versiyonlari
    • bendeki versiyon neyse karsida oyle olmali
      • apache 4.47
        • işlemeyen versiyon: 4,50
      • php 7.23.18
        • işlemeyen versiyon: 8,0,11
    • karsi tarafta versiyon farkliysa islemeyebilir
    • php update ve ust versiyonlarda sistem islemeyebilir

Neo4j - importing Nodes and Relationships

Beginner

https://neo4j.com/docs/getting-started/

https://neo4j.com/use-cases/

First : create constraints = key

  • key:
//constraint book nodes isbn property
CREATE CONSTRAINT tur_id_cnst
FOR (emlk:Tur) REQUIRE emlk.tur_id IS UNIQUE

  • drop key:
//constraint drop 
DROP CONSTRAINT tur_id_cnst

Note

  • files should be placed inside your project folder:

file:/C:/Users/HP/Documents/neo4j-app-data/relate-data/dbmss/YOUR_PROJECT_FOLDER/import/xxx.csv

  • use csv for importing : there are two columns `name` and `sene`

  • Create nodes- my code:

//import nodes
LOAD CSV  with headers FROM 'file:///artist_sene.csv' AS row
CREATE (a:SANATCI {name: row.name, sene: row.sene})
RETURN a.name, a.sene
  • create relationship with csv file - 

This doesn`t work , it is obselete. It works only, as they say, the internet online version of Neo4j. It doesn`t work for Neo4j Desktop.

LOAD CSV WITH HEADERS FROM "file:///roles.csv" AS csvLine 
CALL {WITH csvLine MATCH (person:Person {id: toInteger(csvLine.personId)}), (movie:Movie {id: toInteger(csvLine.movieId)}) 
CREATE (person)-[:ACTED_IN {role: csvLine.role}]->(movie)} 
IN TRANSACTIONS OF 2 ROWS'

  • my relationship import code: 


  • First: In the cypher code be careful to the two pairs to be exactly the same! The head naming must be different.
  • Second thing: careful to not have empty space in your cypher code for the field to import
  • Third thing: careful to not have empty space in the header / field names
//import csv relationship
LOAD CSV WITH HEADERS FROM "file:///ogr_ulke.csv" AS csvLine 
MATCH (ogrtm:OGRETMEN {ogr_id: toInteger(csvLine.ogr_id)}),(sehirs:SEHIR {shr_id: toInteger(csvLine.shr_id)}) 
MERGE (ogrtm)-[live:LIVES_IN]->(sehirs);

(I noticed the mistake in the Neo4j tutorials and wrote a note about it to them: 


Error handling

import edemiyorsa:
  • csv file dogru klasor / folder içinde mi
  • csv dosya adı doğru olarak cypher koda yazılmış mı
  • csv  dosyasındaki header'larda boşluk var mı - olmamalı
  • bazen import ederken "toInteger" gerekli bazen de silmek gerekiyor

//Other :


developer

 https://neo4j.com/developer/javascript

https://neo4j.com/docs/python-manual/current/

Bulk import Nodes to Neo4j:

your csv files have headers (column names) in the data

LOAD CSV  WITH HEADERS FROM 'file:///n4j_cift_02_node_yrd_dal_is_kolu.csv'
AS row
MERGE (:2_yrd_dal {id:  row[1], is_ad: row[2], Sehir: row[3], type: row[4]});

or more shortly:

LOAD CSV WITH HEADERS FROM 'FILE:///n4j_cift_02_node_yrd_dal_is_kolu.csv'
AS row
CREATE (yrd:yrd_dal)
SET yrd = row;

note 1: second one is preferable; you don`t have to write the column names one by one
note 2: don`t hustle importing id, neo4j gives anyway automatically an id to all. I don`t have the code to stop it

Bulk import Relationships to Neo4j:

searching for it

source:

https://neo4j.com/docs/cypher-manual/current/clauses/load-csv/?source=post_page-----f3553f1a76cf-------------------------------- 


LOAD CSV WITH HEADERS FROM 'FILE:///n4j_cift_05_rel_menfaat_iliskisi.csv' AS row
MATCH (p:uyg_tip {id: row.sourceId})
MATCH (m:uyg_kol {id: row.targetId})
MERGE (p)-[r:MENFAAT {role: row.menfaat}]->(m);


Sunday, February 11, 2024

designing a database - outsideuniverse.com

 About me

I did databases:

  • quantity surveying,
  • logistics,
  • purchasing and warehousing,
  • cost,
  • finance,
  • electrical, mechanical and civil site construction control,
  • personnel payroll
  • and finally safety departments.

I did as freelance programmer databases for

  • call lines helpdesk,
  • document control ,
  • advertising agency general database (including bid, accounting and customer address book).
this program with open source code and user manual. Also I will be online for the time you request for after sales service.

Your satisfaction is my primary objective in my business

If you are interested and you would like to get more information on my services, do not hesitate to contact me. 

2 - Planning of work

I will be preparing a prototype for you in one week time. 

After your revisions on this prototype and then notifying me of the additional reports/forms you may want, or change some reports and forms, 

I`ll send the second database wich will be the program ready to run. On your approval I will prepare the final database by making the final touch on it, and finalise it.

may require absolutely all your requests as reports content, type of data to enter. 

A database should not be designed for entering data all day long  

it is also for making the automation in the company`s work process

minimize the paper come and go, 

minimize the daily data controls etc. 

So the objective is to make your business running more efficiently with a database use.

3 - Further Technical details of the database:

the database will be an access database. 

So it`s installation is easy. It takes no more then 5 minutes. 

its backend wıll be on the server. So the whole data entered will be stored on your server.

The frontend will be placed on the user`s computer, The frontend is just incorporating links to tables on the server, the VBA source codes, the macros, the reports and the forms.

The main reason I do this is because the frontend is much more heavier then the backend, and when you run it it requires more space in memory of the computer. By placing it on the user`s computer I avoid server`s memory being overloaded.

This system will open you the way to convert in the future, this database to sql server easily.

other big advantage of this system. While the system will be running, you may need an additional report, or a minimal change on the frontend. Then you may just need to notify me for the changes to be done, I`ll prepare this changes or addtional reports. After all will be finished you will just delete the old frontend and copy paste the new frontend on the user computer.

During the laps of time from your request of frontend change and the installation of the new one there will not be any stop in the daily data entries.

5 - Commercial details:

The price I may require for this database is (as specified in my bid) - I can prepare fully functional database in (as specified in my bid) days.

database , it will have open codes, it can be changed anytime by any other professional coder you may have around you.

I will give you also a user manual for the database for all the forms and reports the user will have to deal with.

Please do not hesitate to contact me for any other questions you may have

Best regards
Oruc Kenan
C
oding For Your Business Success

Sunday, February 4, 2024

Database types and comparison

 Types of database structures


Free Databases

source: softwaretestinghelp.com/free-database-software/

dbO/SLimitationEase
AltibaseLinuxNo limitVery Easy
MySQLWin/Lin/MacNo limitEasy
OracleWin/Lin1 GB Ram / 11 GB db / 1 CPUMedium
SQL ServerWin/Lin1 GB Ram / 10 GB db / 1 CPUVery Easy
FirebirdWin/Lin/MacMulti CPU / 20 TB db-
PostgreSQLWin/Lin/MacNo limitEasy for developpers




neo4j-mathematics

 create the nodes: CREATE   ( n : sil  { name : "k1" ,  val :   1250 }),( m : sil2  { name : "k2" ,  val : 1250 }),   ( ...