I have created a database using SQL and I have a functional web page built on Angular and nodejs which is connected to the database. I need to make the search bar functional. How should I proceed? Answer Create a input box in html with keyup event as : Add this function in your .ts file which will be triggere…
How to transform one SQL column into multiple columns on the same row?
I am working in a Progress ODBC in Excel and I have a data set that currently holds an ID, Object type and the result for that object. The dataset looks a little like below: EveNumber …
Convert character string into this specific date format?
I am using SQL Server 2014 and I have a table (t1) which contain a column (ReviewDate) in the nvarchar format. An example of a row of this column is given below: I need to extract the “date” component from this character string. To do this, my T-SQL is as follows: This gives me “Oct 2017R…
How long in years the artist was in the band for all artists who are or ever have been in bands
For the artists currently in bands, the value is null. How can I calculate how long they have been in the band if the value is null using mySQL? I was thinking of doing something like this, which only works for artists who have left a band. Answer I haven’t done SQL for a while so please bear with me.
Find IDs and names of students who took CS-101 and did not take CS-319
Can someone help with this homework problem: Find IDs and names of students who took CS-101 and did not take CS-319. These are the two tables that I can use for this assignment: I tried this but was unable to successfully exclude the students who who took “CS-319” Answer There are at least three s…
While loop SQL Server
Help me please. I need to write two functions, one that calculates the factorial and another that calculates the sums of euler. To make the euler sums I need to use the function that calculates the factory. I already have the function of factorial but when doing the sums the result I get “NULL” No…
Using REPLACE with CHAR(160) is Returning Hexadecimal as Value
I am trying to get rid of   characters in MYSQL, but am getting weird behavior where using REPLACE is returning a hexadecimal string. The original value is some HTML stored in a field with the type BLOB: The SQL I am using is this: And after executing, this is what is left in the database: What is goi…
How can use lag to return the difference between the value of the current row and the value of the following row?
I would like to ask you how to return the difference between the value of the current row and the value of the following row. I know that I could use lead, but I would like to try to use lag function to do the same. What I thought was lag(value) over (partition by id order by time desc), but
Is my site vulnerable to SQL injections if I get error 403?
I have a login form and just to test I tried to fill in “select * from accounts where username = test” and then I pressed enter to see what happens. I got redirected to this page: Should I be concerned about SQL injections? Or is this a normal response? Edit: the PHP code for this particular case.…
Select data from three tables only if one of them has reference to parent table
I have three tables person, his cars, his houses. And i need select persons with his cars and houses if one of childs(car, house) table have reference to parent(person). I tried with join, but don’t know how use OR in this condition. and result should be Answer You can left join twice and ensure that on…