SQL is an amazing tool, if we know to use it the right way. Using the concept of the SQL server spatial data and some mathematics, I have built this Christmas tree the SQL way!!. Attached is the image of the output. The code is as below. You too can run the code for yourself and generate the tree.
Note: After Executing the code, to see the image, Click on the “Spatial results” tab below in the results window, Uncheck the ‘Show Grid lines’ box in the right pane. You will be able to see the image.
Values() clause also known as Table valued Constructor(TVC) was introduced in SQL server 2008. This is a very useful clause and has variety of applications. One such application we will be looking here is to create a matrix of numbers and then display the sum of numbers and maximum values in each row of the matrix using values() clause. SQL code is as below:
When I was learning about SQL JOINS I found this cheat sheet and couldn’t anything find better than this. So I want to share with all of you guys.
I don’t think I have to explain about the SQL JOINS now.
Image is taken from- Image Source
Today we’ll be learning about one of the most important statement in SQL that is ‘Update’ statement. As the name says Update statement is used to update the records in the existing table.
Below the table called new_table in database.
Today we’ll be learning some SQL tips and tricks that could save a lot of time.I’ll be using MYSQL workbench 6.3 for the tutorial. As you know SQL is not case sensitive so query can be written in either of the case.
Below is the table in the database named “new_table”
Today we’ll be learning about SQL functions. We have functions in SQL similar to Excel.
The following Table ‘cricket’ we have.
Today we’ll be learning about the SELECT statement in SQL.
Query the entire table
Using the ‘Select *‘ statement in the query will return the entire table (all the columns and all the rows). Read more