Pages

DBMS

 Here, database related stuffs!


SQL:

1. How to update a column ? 
SQL> UPDATE table SET rating = 5 where table_id = 4;


2. GROUP BY: 

The SQL GROUP BY Statement

The GROUP BY statement groups rows that have the same values into summary rows, like "find the number of customers in each country".

The GROUP BY statement is often used with aggregate functions (COUNT()MAX()MIN()SUM()AVG()) to group the result-set by one or more columns.

GROUP BY Syntax

SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);

No comments:

Post a Comment

Contains duplicate - using HashSet (optimized code)

  class Solution {     public boolean containsDuplicate ( int [] nums) {         HashSet< Integer > seen = new HashSet<>()...