Posts

First steps in SQL

Image
  Creating DB :         Creating a Database - Part I - solution                                  CREATE DATABASE IF NOT EXISTS Sales;                                  CREATE SCHEMA IF NOT EXISTS Sales; To select DB : Run - USE database_name;  Data type Limit :               STRING:                         CHAR  : 255 (Maximum size) Bytes.                          VARCHAR : 65,535 (Maximum size) Bytes.             INTEGER:                        ...

Basic database terminology

Image
                                               Relational schema                     an existing idea of how the DB must be organized Primary key : A column(or set of columns) whose value exists and is unique for every record in a table is called primary key . Foreign Key :  Identifies the relationship between tables,not the tables themselves. Unique Key & Null values : Used whenever you would like to specify that you don't want to see duplicate data in a given fields. Example : Relationships : Relationships tell you how much of the data from the foreign key field can be seen in the primary key column of the table the data is related to and vice-versa. One to Many Relation :   Example : of ONE   toooooo MANY: Many to One :  

Basic Introduction of SQL & MySql

Image
SQL is declarative language-  * Main component of SQL syntax:     1: DDL(Data defination Language);     2: DML(Data Manipulation language);     3: DCL(Data Control Language);     4: TCL(Transaction control language) #DDL : A set of statement that allow the user to define or modify data structures and  objects, such as tables.It  contains - CREATE , ALTER , DROP , RENAME , TRUNCATE   methods.   *note: Keywords are the reserved word in sql like : CREATE , ALTER,ADD .and we do not use that word to assign the object_name.   #DML : Its statement allow us to manipulate the data in the tables of a database.               It contains : SELECT , INSERT , UPDATE , DELETE statement(methods) #DCL : It contains the following statement : GRANT & REVOKE.  allow us to manage the rights users have in a database  The REVOKE clause : used to revoke the perm...

creating server

Image
  const http = require ( 'http' ); //1: callback function function rqList ( req , res ){ } //1: creating a server const server1 = http . createServer ( rqList ); //second way const server2 = http . createServer ( function ( req , res ){ }) //third way const server = http . createServer (( req , res ) => { console . log ( req ); }) //listening to a port for request server . listen ( 3000 ); while requesting to localhost:3000 in a browser we get the following as request: rajeshwar@rajeshwar:~/Documents/Nodejs/Node-part-2/basics$ node app <ref *2> IncomingMessage { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: null, ended: false, endEmitted: false, reading: false, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, paused: tru...

How the web works

Image
In a normal way :    1:     we type the url in the browser.    2:    After the submission the DNS lookup will performed and after that the           request will placed to that ip address with some header(meta data). Where the handshake will perform if all correct then the response send along with response header.    3:     Http Vs Https :         

Introduction To Nodejs

Image
Nodejs  actually use the v8 engine to render the Javascript into the server . V8 takes the js code and compiles to the machine code so the machine can understand . V8 engine id developed by the google and is also wriiten in c++. so the Nodejs ships the js+c++ binding to the v8 where it compiles those code to machine level

Array & object sort

 <?php             $sel = mysqli_query($conn , "SELECT DISTINCT `lat_log` FROM `visitors`");             $num = mysqli_num_rows($sel);             $numArr = [];             if($num){                 while($r = mysqli_fetch_assoc($sel)){                     $city = $r['lat_log'];                     $selcount = mysqli_query($conn , "SELECT `id` FROM `visitors` WHERE `lat_log`='$city'");                     $ncount =...