Skip to main content

Posts

WHERE and ORDER BY clause

* WHERE clause is used as a filter on the table  to get a desired output. It is used to full fill a given condition.  Syntax : -  SELECT column_name  FROM table_name  WHERE search_condition ORDER BY expression; WHERE clause appears after the FROM clause but before the ORDER BY clause.  WHERE clause not only is used in SELECT statement but also in the UPDATE and DELETE clause. We use ORDER BY clause at the very end of the query. • Lets say we have the emp table: and we want the names of the employees who's salary is greater than 2000. • So we will write a query: As we can see, the data is now filtered out. Earlier there were 14 rows but now after using WHERE clause we have 6 rows.  We always use WHERE clause with comparison operators like:  Now lets see ORDER BY clause: • Say we have the same query viz " SELECT * FROM EMP WHERE SAL>2000;" but now we want the data to be sorted in ascending order of sal column then we write-- SELECT  *  FROM  EMP  WHERE  S

Introduction to SQL

 Q.)  What is SQL ? Ans.) SQL(Structured Query Language) is a standardized language to communicate with the database.  With the help of it we can retrieve data from the database. SQL not only allows us to read the data but also allows us to write the data in the database.  Data in the database is stored in the form of tables. We can Select, Insert, Update, Delete, Create, Alter, Drop and can perform many more operations on the table. And these are called as SQL Statements. * SQL Statements are classified mainly into 4 categories :- 1) DML (Data Manipulation Language) 2) DDL (Data Definition Language) 3) DCL (Data Control Language) 4) TCL (Transaction Control Language) * Under DML we have :-(No Autocommit) 1. Select  2. Insert  3. Update  4. Delete  5. Merge    * Under DDL :-(Allows Autocommit) 1. Create 2. Alter  3. Drop  4. Truncate  5. Flashback * Under DCL :-(Allows Autocommit) 1. Grant  2. Revoke  * Under TCL :-(No Autocommit) 1. Commit 2. Rollback 3. Save point From above, we ca

Progress bar using HTML/CSS

(switch to desktop mode for better experience)  # html code : <! DOCTYPE   html > < html   lang = "en" > < head >      < link   href = 'E:\html\testpro\style.css'   rel = 'stylesheet' >      < meta   charset = "UTF-8" >      < meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >      < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      < title > progress bar </ title > </ head > < body >      < div   class = "box" >          < h1 >< u > progress bar </ u > : </ h1 >          < h2   id = 'h1' > c </ h2 >              < span   class = 'c'   id = 'bar1' ></ span >          < h2   id = 'h2' > c++ </ h2 >              < span   class = 'cpp'   id = 'bar2' ></ span >          &

BMI Calculator

Today; in the era of fast changing world where we've prioritized our job, one thing that is being highly compromised is our Health. Recently we've been through the CORONA crisis where we've acknowledge that how weak our immune system is. Bad eating habits and lack of sleep can get you anxiety, stress, fatigue and weakness all over your body. So the question arise: What should we do? One little thing that we could do is to know our Body Mass Index ; the BMI score. BMI is a measurement of a person’s weight with respect to his or her height. It is more of an indicator than a direct measurement of a person’s total body fat. BMI correlates with total body fat. This means that as the BMI score increases, so does a person’s total body fat. The WHO defines an adult who has a BMI below 18.5 is considered Underweight, between 18.5 to 24.9 a Healthy weight, a BMI between 25 and 29.9 as Overweight, and an adult who has a BMI of 30 or higher is considered Obese. BMI

coding_round#1

==>> This is a coding question asked in Tech Mahindra coding round. Q.) Given an array of integers representing measurements in inches, write a program to calculate the total of measurements in feet. Ignore the measurements that are less than a foot (eg. 10). Note:- You are expected to write code in the findTotalFeet function only which will receive the first parameter as the number of items in the array and the second parameter as the array itself. You are not required to take input from the console Example:- Finding the total measurements in feet from a list of 5 numbers Input:- 5                  18 11 27 12 14 Output:- 5 Explanation:-  The first parameter (5) is the size of the array. Next is an array of measurements in inches. The total number of feet is 5 which is calculated as shown below: 18->1 11->0 27->2 12->1 14->1 ==>> I've provided a solution for the following problem:- click on the image and zoom-in for more clarity. ( Plz feel free to

Weather Web App

*This is a Weather Web App build using HTML/CSS and JS Note : Enter any city name of your choice to check the weather updates. You can even try city names from different countries (like New York, London, Tokyo, Toronto, Paris) and it will give you the weather updates of that particular city. #For Quote and Joke generator : click here #For Number Guessing Game : click here

Quote and Joke Generator

*This a random quote and jokes generator. #The first one is a random quote generator. You will get a new quote every time you click on the button. #The second one is a random joke generator. You will get a new joke every time you click on the button. For Number Guessing Game : click here //click on the button to get a quote //-author get a quote //click on the button to get a joke get a joke