Write articles on oyewiki and earn per view | Click here to Know more

SQL Desc Table

Category : SQL Author : Ankur Rastogi Date : Fri Mar 18 2016

Overview To see description, structure, column names and data types of any existing table you can use command Desc table. Syntax Syntax for this is DESC table_name; Example Let us see the table hostel_list that we just created in last step DESC hostel_list; +----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra...

Read Full

MYSQL AVG Function

Category : MYSQL Author : Ankur Rastogi Date : Sat Jun 04 2016

MYSQL AVG function is used to find out the average value of the column value that is provided as input to AVG function. It will return the aggregated average of all the values. AVG function is quite useful when we are doing some sort of analysis and needs to find the average value such as average salary, or avergae family strength in some city. Syntax for MYSQL AVG function is  SELECT AVG(column_name) FROM table_name; Let us have close look at it with the help of example....

Read Full

SQL Syntax

Category : SQL Author : Ankur Rastogi Date : Sun Mar 06 2016

SQL syntax or query follows a particular rules and regulation which are denoted as SQL Syntax. Every SQL starts with standard operators and ends with the semicolon. Some of The Most Important SQL Commands CREATE DATABASE - creates a new database ALTER DATABASE - modifies a database CREATE TABLE - creates a new table ALTER TABLE - modifies a table DROP TABLE - deletes a table INSERT INTO - inserts new data into a database SELECT - retrieves data from...

Read Full

MYSQL Temporary Table

Category : MYSQL Author : Ankur Rastogi Date : Sat Jun 04 2016

MYSQL Temporary tables is the functionality provided by various RDBMS. This is used to create temporary tables which provide same funtionalities as of regular tables such as SELECT, UPDATE, INSERT, DELETE options but for the current logged in session only. Temporary tables acts very useful when we need to operate some operation on temporary data for temporary cases. As we know temporary tables only exist for the current logged in session in database so you will not find you temporary...

Read Full

What can be the maximum number of rows in a MYSQL Database Table?

Category : IQ Author : Ankur Rastogi Date : Wed Jul 13 2016

Interview Question Series:   This question was asked in one of the top startups interview from one of my friend. Question here is What can be a maximum number of rows that a MYSQL Database table can contain? Suppose you have a MYSQL Database  and a database table in it called users . So this table contains a list of users. Each row in this table contains unique user. So The question is what can be the maximum number of users that can be inserted in user's table. If you want...

Read Full

Linux and Unix Free Command

Category : LINUX Author : Ayush Kush Date : Sun Apr 17 2016

Overview Linux Free command comes handy when we need to find out the free and consumed space in our system. Linux free command displays the total amount of free and used amount of physical as well as swap memory, It also tell us about shared memory, cached memory and memory in buffer. The shared memory column represent either the Shemm value or Mem Shared value. Syntax free [options] Options -b, --bytes Display the amount of memory in bytes. -k, --kilo...

Read Full

MYSQL Having Clause

Category : MYSQL Author : Ankur Rastogi Date : Sat Jun 04 2016

Overview MYSQL Having Clause works with Group BY Clause. Having clause applies the condition on the groups returned by the group by clause. Final rows contains only those groups which passes the having condition. In other words Having Clause will only returns those aggregate values which will meet the Having condition in the select query. Syntax Syntax for Having Clause is SELECT column_names FROM table_name WHERE conditions GROUP BY column_name HAVING [condition]....

Read Full

Web Server vs Application Server Difference Explained

Category : IQ Author : Ankur Rastogi Date : Sun Nov 06 2016

Web servers are used to server static content over the http request. while application servers are used to serve dynamic content over variety of requests. Web servers also act as protecting container to the application server, restricting direct access to the application server by the client. In this the port on which web server is running is accessible from outside, whereas access to port on which application server is closed and client can only contact web server thus...

Read Full

MYSQL Where Condition

Category : MYSQL Author : Ankur Rastogi Date : Sat Apr 16 2016

Overview Where condition is used to fetch data from the table on the basis of some conditions on some of the data columns. Syntax Syntax for using where clause is SELECT * FROM table_name WHERE (conditions); Example Let us have a deeper look on this with the help of an example Let us consider our hostel_list table which contains the list of hostels. +----+-------------------+-----------+----------+ | id | name | occupancy | capacity...

Read Full

SQL Like Clause

Category : SQL Author : Ankur Rastogi Date : Tue Mar 22 2016

Overview Like clause is used with Where clause to apply condition. As the name suggests Like clause is used to fetch all the records where a column matches/contains a word. Syntax Syntax for Like clause is SELECT * FROM table_name where column_name LIKE 'random_value'; Example Suppose we need to find all the hostel name which ends with 'SH' like KAILASH BHAVAN is one of them. So the query for this will be SELECT * FROM hostel_list WHERE name LIKE '%SH %'; In the...

Read Full

SQL Null & Not Null Operator

Category : SQL Author : Ankur Rastogi Date : Fri Mar 25 2016

Overview Null values represent a blank values in a database table. Suppose you insert data for four column in table having six column. So at that time the rest of the two columns will have either the null value or the default value if there is any default value set for those column in table. At times when we are working on SQL Queries we get the requirement to fetch rows by checking whether the column has Null values or doesnt have null values. So for such requirements we have...

Read Full

MYSQL Select Into

Category : MYSQL Author : Ankur Rastogi Date : Sat Jun 04 2016

Overview MYSQL SELECT INTO query is used to select data from one table and to copy that selected data into new table. Either we can copy all the data or we can also select a subset of data from the existing table which satisfies the given condition. Largely it is used to take backup or to copy the existing rows, records from one table to another new table. we can also say that MYSQL SELECT INTO is used to create new table by copying data from existing table. Syntax Syntax for...

Read Full

SQL Insert Into

Category : SQL Author : Ankur Rastogi Date : Fri Mar 18 2016

Overview Now in previous few steps you were learning how to create , desc and delete table. Now let us see how to insert data into our tables. Insert into command is used to insert data into our tables. Syntax Syntax for insert command is INSERT INTO table_name (Col1, Col2.... ColN) values (Val1, Val2... ValN); Here in this command the number of columns passed should be equal to number of values passed. and Val1 will always corresponds to Col1. That means while...

Read Full

Linux and Unix Chgrp Command

Category : LINUX Author : Ankur Rastogi Date : Sun Apr 17 2016

Overview Linux CHGRP Command is used to change the group ownership of a file. By using Linux CHGRP command we can change the group recursively for all the files and directories inside. we have also covered CHOWN , CHMOD in previous steps. Syntax chgrp [OPTION]... GROUP FILE... chgrp [OPTION]... --reference=RFILE FILE... Options -c, --changes like verbose but report only when a change is made -f, --silent, --quiet suppress most...

Read Full

Infix To Postfix Conversion Using Stack in Javascript

Category : DATASTRUCTURE Author : Ankur Rastogi Date : Sat May 21 2016

Here we go with the javascript program to convert infix to postfix notation. What is Infix notation? The expression of the form of a op b , where operator is in between of bot the operands. What is Postfix notation? The expression of the form of a b op ,  where both the operands are followed by operator. Here we will see the implementation to convert infix notation to postfix notation. As it is also easier for compliers also to read from left to right or from right to left. In...

Read Full

Do You Know Voice Behind Delhi Metro Announcements?

Category : TRAVEL Author : Raman Shaily Date : Sat Jan 14 2017

 ( Image Source ) Voice has been a significant and great blessings for human beings. In a dark night a voice can make you feel presence or existence of someone. In today's world Voice has played a major role. we connect to the world with this key note. We hear them daily and we don't know who they are. The article is to tell bit about some faces behind some magical voices. अगला स्टेशन राजीव चौक है यहां ब्लू लाइन के लिए बदलें ( Image Source ) Most heard...

Read Full

MYSQL difference between count(*) and count(column_name)

Category : MYSQL Author : Mayank Rastogi Date : Thu Nov 03 2016

Earlier we have published about Mysql Count Function  which is used to return the total number of rows present in any database table. Count function is mainly used where we want to fetch the total number of records in any of the given table. Problem Statement So the question arises is that what is the difference between count(*) and count(column_name)? count(*) count(*) returns the total number of rows in any table irrespective of the values inside the columns. count(column_name) On...

Read Full

MYSQL Data Types

Category : MYSQL Author : Ankur Rastogi Date : Sat Apr 16 2016

MYSQL data types defines what type of data a column can contains. While creating a column you need to define the data type that you would be saving in that column. Through these data types SQL understands what type of data is in column and how to show that data while retrieving that data. Below is the list of various data types and their descriptions. bit  ==> Numeric value, can hold from 0 to 1. tinyint ==> Numeric value, can hold from 0 to 255. smallint ==>...

Read Full

MYSQL Create Table Like

Category : MYSQL Author : Ankur Rastogi Date : Sat Apr 16 2016

Overview Sometimes you can get a requirement where you need to create a new table like an already exiting with different table name. There you can use " create table like " command. Syntax Syntax for create table like command is CREATE TABLE table_name like already_exiting_table_name; CREATE TABLE table_name AS SELECT [COL1, COL2] FROM already_exiting_table_name [WHERE]; Example For ex: If you want to create abc table like hotel_list table create in...

Read Full

SQL Wildcards

Category : SQL Author : Ankur Rastogi Date : Sun Mar 27 2016

Overview Special characters are used as wild cards in SQL. SQL Wildcards are used to fetch data from table with the LIKE clause. We can use LIKE clause with wildcards to match substring or string with some pattern in database table. SQL Wildcards are % ==> It matches one or more characters. _ ==> It matches one character. [list_of_characters] ==> In this it applies sets, ranges of string characters. [! or ^list_of_characters] ==> In this this is used to match...

Read Full