Configure columns when importing CSV into MySQL - mysql

I'm using phpmyadmin to import a CSV file into a MySQL database, the file contains a column that has 672 binary numbers, if I import that without checking the box The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data) everything goes in as VARCHAR columns and life is good.
If I check that box however, it tries to insert that column as a BIGINT and it fails because the maximum value for that is 255.
How can I modify the fields in the CSV file or while importing to MySQL to say consider every column is a varchar?
EDIT
Here's a subset of the data I'm trying to import. Save that into a CSV file:
ZomatoURL,PhoneNumber,More Info,Claimed,Booking,Hours2,RestaurantName,HoursMon,HoursTue,HoursWed,HoursThu,HoursFri,HoursSat,HoursSun
https://www.zomato.com/sydney/koi-dessert-bar-chippendale,02 9212 1230,More Info Takeaway Available Wheelchair Accessible No Alcohol Available Gluten Free Options Desserts and Bakes Kid Friendly Vegetarian Friendly,Report Error Claim this listing,,MonClosedTue10 AM to 10 PMWed10 AM to 10 PMThu10 AM to 10 PMFri10 AM to 10 PMSat10 AM to 10 PMSun10 AM to 10 PM,KOI Dessert Bar,000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,000000000000000000000000000000000000000111111111111111111111111111111111111111111111111000000000,000000000000000000000000000000000000000111111111111111111111111111111111111111111111111000000000,000000000000000000000000000000000000000111111111111111111111111111111111111111111111111000000000,000000000000000000000000000000000000000111111111111111111111111111111111111111111111111000000000,000000000000000000000000000000000000000111111111111111111111111111111111111111111111111000000000,000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111000
https://www.zomato.com/sydney/kobe-wagyu-yakiniku-cbd,02 9283 2268,More Info No Alcohol Available Sake Buffet,Claimed listing?,Table booking recommended,"Mon 12 Noon to 2:30 PM, 5:30 PM to 10:30 PM Tue 12 Noon to 2:30 PM, 5:30 PM to 10:30 PM Wed 12 Noon to 2:30 PM, 5:30 PM to 10:30 PM Thu 12 Noon to 2:30 PM, 5:30 PM to 10:30 PM Fri 12 Noon to 2:30 PM, 5 PM to 11:30 PM Sat 12 Noon to 11:30 PM Sun 12 Noon to 10:30 PM",Kobe Wagyu Yakiniku,000000000000000000000000000000000000000000000000111111111100000000000011111111111111111111000000,000000000000000000000000000000000000000000000001111111111000000000000111111111111111111110000000,000000000000000000000000000000000000000000000001111111111000000000000111111111111111111110000000,000000000000000000000000000000000000000000000001111111111000000000000111111111111111111110000000,000000000000000000000000000000000000000000000001111111111000000000011111111111111111111111111000,000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111000,111000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111110
https://www.zomato.com/sydney/home-thai-cbd,02 9261 5058,More Info Takeaway Available BYO BYOW Vegetarian Friendly,Report Error Claim this listing,,Mon 11 AM to 11 PM Tue 11 AM to 11 PM Wed 11 AM to 11 PM Thu 11 AM to 11 PM Fri 11 AM to 11 PM Sat 11 AM to 11 PM Sun 11 AM to 11 PM,Home Thai,000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111110000,000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111100000,000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111100000,000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111100000,000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111100000,000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111100000,100000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111

Related

Identifying dates from datespan for multiple entries

I need your guidance in regard to a query I am trying to write, but hitting a wall on. I am working on a project for a scheduling system. The scheduling system has in it a dates calendar table, a yearsemester table with datespans, a courses table with courses assigned to yearsemesters, and a components table with the course components (days of week & times) listed.
I need to write a query that identifies every day of the week within a given datesspan (parameters), from a web form, where a class takes place.
These tables approximately look like the example below:
(Dates) Calendar Table:
Date
DayofWeek
2021-01-01
Friday
2021-01-02
Saturday
2021-01-03
Sunday
.... On and on for like 20 years worth of dates
(YearSemester) table:
ID
Year
Semster
Start Date
End Date
1
2021
Spring
2021-01-04
2021-05-01
2
2021
Summer
2021-06-01
2021-08-15
3
2021
Fall
2021-08-15
2021-12-30
(CoursesSchedule) table:
ID
YearSemesterID
CourseID
1
1
CTI120
2
1
DBA110
3
1
DBA225
(ComponentSchedule) table:
ID
CourseScheduleID
Component
DayofWeek
Start Time
End Time
1
1
Class
Monday
8:00 AM
10:00 AM
2
1
lab
Monday
11:00 AM
11:50 AM
3
1
Class
Wednesday
8:00 AM
10:00 AM
4
1
Lab
Wednesday
11:00 AM
11:50 AM
5
2
Class
Tuesday
5:00 PM
9:00 PM
6
2
Class
Thursday
5:00 PM
9:00 PM
7
3
Class
Monday
1:00 PM
3:00 PM
8
3
Class
Friday
1:00 PM
3:00 PM
I need to find a way using either the calendars table, or some other method, to generate a result set like the following when given start and end dates as parameters from a web form
INTENDED QUERY OUTPUT
YEAR
SEMESTER
COURSE
COMPONENT
DATE
Start Time
End Time
2021
SPRING
CTI110
CLASS
2021-01-04
8:00 AM
10:00 AM
2021
SPRING
CTI110
LAB
2021-01-04
8:00 AM
10:00 AM
2021
SPRING
DBA225
CLASS
2021-01-04
1:00 PM
3:00 PM
2021
SPRING
DBA110
CLASS
2021-01-05
5:00 PM
9:00 PM
2021
SPRING
CTI110
CLASS
2021-01-06
8:00 AM
10:00 AM
2021
SPRING
CTI110
LAB
2021-01-06
8:00 AM
10:00 AM
... And so on and so forth to the end of the date span. This is to be displayed on the webpage, and used in a calendar view eventually, with some formatting of course.
I can't figure out how to generate the individual dates of occurrence by referencing the semester's date span against the course's component days of the week. Should this be a loop?
Any advice, or guidance, if you have a good guide on a topic such as this, would be greatly appreciated!! I haven't been able to find anything super helpful so far.

Set nominal time to run the oozie coordinator daily in HUE

I am trying to set SLA for my oozie coordinator but nominal_time always stays on the day when i submitted the coordinator.
SLA Details:
Nominal Time - Thu Dec 05 15:45:00 UTC 2019
Actual Start Time - Sat Dec 07 07:45:00 UTC 2019
Expected End Time - Thu Dec 05 16:05:00 UTC 2019
Expected Duration (in mins) - 45
Actual Duration (in mins) - -1
How do i increase nominal_time by a day to match it with actual_time ?
I could fix it by passing ${coord:nominalTime()} in nominal_time.

Sql Server Query not getting desire Result

I want show record month wise and date wise. My query is this but I am not getting how I can achieve this.
Query is
select
iWorkItemId
, convert(varchar(20),Progress.dtProgressDate,106) as dtProgressDate
, vsDescription
, WPD.rWeightage
, Progress.ProgressPerc as ProgressPerc
, Convert(decimal(6,2)
, ((WPD.rWeightage * Progress.ProgressPerc)/100)) as TotalProgress
from tblPkgWorkItems WPD
join tblPkgWorkItemsProgress Progress on WPD.iWorkItemId = Progress.iWorkItemsId
where iPackage='7'
group by iWorkItemId, dtProgressDate,vsDescription,rWeightage,ProgressPerc,progressmonth
order by progressmonth ASC,dtProgressDate ASC , iWorkItemId ASC
Column name : (1) progressmonth (Store Month Name)
(2) dtProgressDate (Store complete date)
Example :
In our table we are storing the records like in this manner:
30 Apr 2013
31 Aug 2013
28 Feb 2013
30 Jan 2013
Then I want to show records like this
30 Jan 2014
if some record is inserted in 15 jan 2014 then After 30 jan 2014 then 15 jan 2014 record will show.
28 Feb 2014
30 Apr 2014
30 Aug 2014
Means firstly Jan records will come then Feb record then March records.
Means all records will come month by order then sort by date wise .
My data is being returned like this:
iWorkItemId dtProgressDate progressmonth rWeightage
320 30 Apr 2014 Apr 2
321 20 Apr 2014 Apr 3
320 10 Feb 2014 Feb 4
321 9 Jan 2014 Jan 7
I want record should come first 9 jan 2014 then 10 Feb 2014 (Means Order by Month) then after it 30 April 2014, then 20 april 2014 (Then Sot by Date).
iWorkItemId will repeat win every month.
For my problem is I want to show
Firstly Jan records then Feb records , then March records
And whenever Jan month is coming then All Date which is belong to jan month that will come under JAN month.
Firstly Higher date of JAN month (Means ) 31 Jan 2014, 30 jan 2014, 29 jan 2014, 28 feb 2014, then 27 feb 2014.
Means first records fetch month wise then on particular month that records sort by datewise

MS Access year to date numbers by month

I have a query in an Access database which returns the results below:
MthName 2010
Jan £4.51
Feb £10.20
Mar £17.51
Apr £22.86
May £28.82
Jun £33.30
Jul £37.96
Aug £42.52
Sep £47.88
Oct £54.25
Nov £60.52
Dec £65.80
That is fine but these are year to date numbers and I would like to create a query that could give me the actual month numbers instead.
Taking the above sample the Jan number is clearly £4.51 but the Feb number is
(£10.2-£4.51)= £5.70
I have tried using something like DLOOKUP but it seems that would be really slow and wasn't working correctly.
This can be achieved very easily in Excel but I was hoping to find a query for future use.
Thanks
Avoid using Dlookup as much as you can.
if it is possible to add column [mntNum] with SEQUENCE number of month :
mtnNum MthName 2010
01 Jan £4.51
02 Feb £10.20
03 Mar £17.51
04 Apr £22.86
05 May £28.82
06 Jun £33.30
07 Jul £37.96
08 Aug £42.52
09 Sep £47.88
10 Oct £54.25
11 Nov £60.52
12 Dec £65.80
Query
SELECT table.mntNum, table.mntName, table.[2010], [2010]-nz((SELECT [prev].[2010] FROM [table] as [prev] where [prev].[mntNum]=[table].[mntNum]-1),0) AS JUST_THIS_MONTH
FROM [table];
UPD:
Result of this query
mntNum mntName 2010 JUST_THIS_MONTH
1 Jan 4.51 4.51
2 Feb 10.2 5.69
3 Mar 17.51 7.31
4 apr 22.86 5.35
5 may 28.82 5.96
6 jun 33.3 4.48
7 jul 37.96 4.66
8 Aug 42.52 4.56
9 Sep 47.88 5.36
10 Oct 54.25 6.37
11 Nov 60.52 6.27
12 Dec 65.8 5.27999999999999

Getting day number in the week in a stored procedure

How can I get the number of a day in a week fro example:
2009-10-21 would be 4 assuming that:
Sun - 1
Mon - 2
Tue - 3
Wed - 4
Thu - 5
Fri - 6
Sat - 7
I am using MySql Server 5.0.37
SELECTDAYOFWEEK('2009-10-13')