Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
3.4 kB
1
Indexable
Never
MySQL table name: courses
fieldnames needed: course_number (VARCHAR), starting_date (DATE), language (VARCHAR), level (VARCHAR), location (VARCHAR)

---------------------------------------------
Widgets names:

Input_CourseNumber
DatePickerInput_StartingDate
MultiSelectInput_Languages
MultiSelectInput_Levels
MultiSelectInput_Locations

Note: for testing purposes, I make all of these fields required in the courses filtering form.


--------------------------------------------
Query:

SELECT  course_number AS Course,
starting_date AS "Starting Date",
language AS "Language",
level AS "Level",
location AS "Location"
FROM courses

WHERE course_number LIKE {{"%" + Input_CourseNumber.text + "%"}} AND

starting_date  > {{DatePickerInput_StartingDate.selectedDate  }} AND

language in({{MultiSelectInput_Languages.selectedOptionValues.map(value => "'" + value + "'").join(', ')}} ) AND 

level in({{MultiSelectInput_Levels.selectedOptionValues.map(value => "'" + value + "'").join(', ')}}) AND

location in({{MultiSelectInput_Locations.selectedOptionValues.map(value => "'" + value + "'").join(', ')}})                       

ORDER BY starting_date DESC

---------------------------------

Log file results :


"SELECT course_number AS Course,
         starting_date AS "Starting Date",
		 language AS "Language",
		 level AS "Level",
		 location AS "Location" FROM courses WHERE (
      		 course_number LIKE %R13005813% AND
			 starting_date > 2024-06-02T22:00:00.000Z AND
			 language in('Afrikaans', 'Akan', 'Albanian', 'Ancient Greek', 'Amharic', 'Arabic', 'Armenian', 'Azerbaijani', 'Bengali', 'Bosnian', 'Brazilian', 'Bulgarian', 'Cantonese', 'Catalan', 'Chinese', 'Croatian', 'Czech', 'Danish', 'Dari', 'Dimbambary', 'Dutch', 'English', 'Eritrean', 'Essimbi', 'Estonian', 'Farsi', 'Filipino', 'Finnish', 'French', 'Gaelic', 'Galician', 'Georgian', 'German', 'Greek', 'Hebrew', 'Hindi', 'Hindu', 'Hungarian', 'IBO', 'Icelandic', 'Igbo', 'Indonesian', 'Intercultural Training', 'Irish Gaelic', 'Italian', 'Japanese', 'Kashmiri', 'Korean', 'Kurdish', 'Lao', 'Latin', 'Latvian', 'Lithuanian', 'Macedonian', 'Malagasy', 'Malay', 'Malayalam', 'Mandarin', 'Mankon', 'Maori', 'Mongolian', 'Norwegian', 'Pashto', 'Persian', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Sanskrit', 'Serbian', 'Sesotho', 'Singalese', 'Sinhala', 'Slovakian', 'Slovenian', 'Spanish', 'Swahili', 'Swedish', 'Tagalog', 'Tamal', 'Tamil', 'Tamin', 'Tatar', 'Telugu', 'Thai', 'Turkish', 'Ugandan', 'Ukrainian', 'Urdu', 'Uzbek', 'Vietnamese', 'Yoruba', 'Zulu' ) AND
			 level in('A1.1', 'A1.2', 'A2.1', 'A2.2', 'B1.1', 'B1.2', 'B2.1', 'B2.2', 'C1.1', 'C1.2', 'C2.1', 'C2.2') AND
			 location in('Aachen', 'Augsburg', 'Berlin', 'Bielefeld', 'Bochum', 'Bonn', 'Brunswick', 'Bremen', 'Darmstadt', 'Dortmund', 'Dresden', 'Duisburg', 'Dusseldorf', 'Essen', 'Frankfurt', 'Freiburg', 'Friedrichshafen', 'Hamburg', 'Hanover', 'Heilbronn', 'Ingolstadt', 'Kaiserslautern', 'Karlsruhe', 'Kassel', 'Kiel', 'Cologne', 'Leipzig', 'Mainz', 'Mannheim', 'Moenchengladbach', 'Munich', 'Muenster', 'Nuremberg', 'Online via LearnCube', 'Online via MS Teams', 'Online via Zoom', 'Regensburg', 'Saarbruecken', 'Schweinfurt', 'Stuttgart', 'Ulm', 'Weilamrhein', 'Wiesbaden', 'Wuppertal', 'Wuerzburg')
			 )
			 ORDER BY starting_date DESC"
Leave a Comment