SQL Course (PART-1)
First of all I want to say that all the queries than has been written and the table on which different queries has been executed are done on a table that has already been uploaded in the "postgreSQL". Later on we will see all the queries that how to create and manipulate the tables according to the user needs. SELECT Statement: SELECT is the most common statement used, and it allows us to retrieve information from the table. * is used to query everything, which increases the traffic between the database server and application and also slows down the retrieval of results. Syntax : SELECT column_name1,.... FROM table_name; SELECT * FROM city; SELECT DISTINCT: DISTINCT is used to query the unique data from the table, will not show the duplicate values. Syntax : SELECT DISTINCT (column_name1,column_name2,…) FROM table_name; SELECT DISTINCT (release_year, rental_rate) FROM film; COUNT : COUNT() func. returns the number o...
Comments
Post a Comment