Database
Example on how to add FOREIGN KEY in MYSQL
FOREIGN KEY :
To allow naming of a FOREIGN KEY constraint, and for defining a FOREIGN KEY constraint on multiple columns, use the following SQL syntax:
ALTER TABLE `customer_address`
ADD CONSTRAINT `fk.customer_address.customer_id`
FOREIGN KEY (`customer_id`) REFERENCES `user` (`ID`)
ON UPDATE CASCADE
ON DELETE CASCADE;
Converting a single comma separated row into multiple rows
we can have it like this
SELECT A.[State], Split.a.value('.', 'VARCHAR(100)') AS String FROM (SELECT [State], CAST ('<M>' + REPLACE([City], ',', '</M><M>') + '</M>' AS XML) AS String FROM TableA) AS A CROSS APPLY String.nodes ('/M') AS Split(a);
assuiming we have table with two columns
1- State.
2- City (separated by Comma)
Recover MySQL password
Please check this URL
https://stackoverflow.com/a/34207996/4135373
how to use Pagenation in MSSQL
SELECT * from {table}
ORDER BY "{column}"
OFFSET page number start from zero} ROWS
FETCH NEXT {PAge Size} ROWS ONLY
Export MySQL query to a file
the Main phrase is
Select ......... where ........... {INTO OUTFILE 'C:\\file_name.csv'}