Mysql database syincronizaton - mysql

I am developing a database for an organization, which has three branches. They want to use this database locally.
The problem is that they want to gather all three branches data after each three months for reporting from all of the three branches.
For example, if branch A has 40 records and branch B has 50 records and Branch C has 30 records: after three months each of the branch should have (30+40+50) records.
How can I do that? Any suggestions?

You can export individual data from 3 databases and then insert into a new database as it is not frequent (3 months interval) like syncronize.
or
You can create an API for fetching data and call the APIs in a loop, and after fetching 3 databases separately, join them in one array and then show them as you want.
It is like:
1st
Select Database
Fetch The Data
then again
Change Database
Fetch The Data from 2nd DB
and so on.
then join every array of data in a single variable and show it

Related

Azure Data Factory For Each Avoid Array

Im quit new in ADF so here's the challenge from me.
I have a Pipeline that consist a LookUp activity and ForEach and inside this a Copy Activity
When i run this pipeline the first output of the Lookup activity looks like this
The output contains 11 different values. From my perspective i only see 11 records that will need to be copied to my Sink which is Azure SQL DB.
The input of the ForEach activity looks like this
During the running the Pipeline copy 11 times and in my sql database it has now 121 records. This amount is based on 11 rows multiple 11 iteration. This is not the output which i expected.
I only expect 11 rows in my sink table. How can i change this pipeline in order to achieve the expected outcome of only 11 rows?
Many thanks!
In order to copy data, Lookup activity and copy data source activity should not be given same configuration. If given so, duplicate rows will be copied.
I tried to repro the same in my environment.
If 3 records are there in source data, 3 times 3 records will be copied.
In order to avoid duplicates, we can use only copy activity to copy data from Source to sink.
Only 3 records are in target table.

Can I use an Acces query to create a temp table from APPEND

I'm trying to write a query that I can call from with Excel that will return the results from a handlfull of tables in a single list.
I could create the table I need from APPEND and just pull that into excel, but the tables I want in the APPEND will change from time to time and I'd rather just add them into the append than keep creating the tables I need and deleting the ones i don't need.
I have a monthly invoices from a number of clients in tables for each client and month. The total number of invoices per month is ~1m. I started just joining them into one large table but it starts to add up to a massive database quite quickly. Most of the time I'd only need to query the first couple of months but everyone in a while I'd have to go back longer.
What I want to do is have a query for each company that I can alter to pull back varying groups of months, but without actually creating the table.
i.e append
Company A Jan,
Company A Feb,
etc
Is there away to do this in a query without creating an actual table
I needed a UNION query.
I knew it was an issue with terminology.

How to manage big database in mysql

I have a database of analytic information.
my database as is below.
Table Name: display_page. here we store data about page when customer(of our user) create an order.(page has multiple sections). the table has 12 Million rows
element_impression. Here we store data about each section. (if the page has 5 sections we insert 5 rows for it. we have 10 unique sections and each will be repeated on page). the table has 45 Million rows
element_clicks. Here we store data about click over the section means when someone clicks on any section of the page we store the data into clicks table.
the table has 1.52 Million rows
Everything is worked fine since last year. But now it will create an issue when trying to fetch data according to the date range.
in future it will become 10X more from this stage. Please suggest with the best way to handle it.

php mysql find records between two dates

i am working on a system that manages atm card stocks at a local bank. would like code that can parse through the db and give me number of cards received by the branch from the card producers and the number collected by the customers on each day between two specified dates.
Fields in my db AccountNUm,DateReceived,DateCollected
Connection to DB http://www.tutorialspoint.com/mysql/mysql-select-query.htm
Difference date How do I query between two dates using MySQL?
Use google =\ Question should be really closed.

Merging table data in mysql?

I have an LDAP CSV file that is imported nightly and dumped into my MYSQL database. It has about 70000 employee records.
Included in that is empl#, email, group, supervisor, etc.
I have reports that are being generated from various web sites. We are dumping these reports in the database once a month. These reports usually have empl#, email, hits, logins, whatever...
My goal is to combine the report data and add in things like group, supervisor, etc based on empl#... Speed is a big concern because of the size of the database and number of users.
At first I thought of making a simple left join (given that report data is left - and that all people in the report may not be an employee). However the problem with that is that it does not take a snapshot in time. If report data from 6 months ago is viewed I don't want it mixed with current employee data - I want it to stay a snapshot in time.
What is the best way to handle this?
You will need a date column of some kind in both sets of data on which to join. Once you have that, you can simply put a condition that establishes the snapshot in the WHERE that limits the selection.