Skip to main content

Posts

SQL Count,Avg,Sum

 SQL Count,Avg,Sum SQL COUNT function is used for counting. SQL AVG function is used for average value. SQL SUM function is used for total sum. SELECT COUNT(column_name) FROM (table_name) SELECT AVG(column_name) FROM (table_name) SELECT SUM(column_name) FROM (table_name) Return total number of price from Customer Table. SELECT Count(Price) FROM Customer Find the average  price from Customer Table. SELECT Avg(Price) FROM Customer Find the total sum of price from Customer Table. SELECT SUM(Price) FROM Customer
Recent posts

SQL Min and Max

 SQL Min and Max   SQL Min is used to return smallest value. SQL Max is used to return largest value. SELECT MIN(column_name) FROM table_name WHERE condition. SELECT MAX(column_name) FROM table_name WHERE condition. Return smallest value of quantity from Customer Table: SELECT MIN(Quantity) FROM Customer. Return largest value of quantity from Customer Table: SELECT MAX(Quantity) FROM Customer.

SQL Select Top

 SQL Select Top     Select Top statement is use to return desire record. SELECT TOP number or percent FROM table_name WHERE condition. Return top 3 record from Customer Table: SELECT TOP 3 FROM Customer. Return top 10 record from Customer Table whose Username = 'abc' : SELECT TOP 10 FROM Customer where Username = 'abc'

SQL Delete

 SQL Delete   It is use for delete record from database. DELETE From table_name where Condition. Delete all record from Customer Table. DELETE FROM Customer. Delete "abc" record from Customer table. DELETE FROM Customer where CustomerName ='abc'

SQL Update

 SQL Update   It is use to update database table. UPDATE table_name set column_name = value where CONDITION. Update Customer name from Customer Table whose id = 1: UPDATE Customer set CustomerName = 'CDE' WHERE id  = 1

SQL Insert

 SQL Insert   It is use to INSERT the data in database. Insert data into Customer Table: INSERT INTO Customer(CustomerName,Address,Phone)VALUES('ABC','PAKISTAN','92363624') Insert data into Customer Table whose id = 1: INSERT INTO Customer(CustomerName,Address,Phone)VALUES('ABC','PAKISTAN','92363624') where id = '1'.

SQL Order By

 SQL Order By   ORDER BY keyword is used to sort or filter the data in ascending or descending order. Sort Username from Customer Table: SELECT * FROM Customer ORDER BY Username. Sort Username is ascending order from Customer Table: SELECT * FROM Customer ORDER BY Username ASC. Sort Username is descending order from Customer Table: SELECT * FROM Customer ORDER BY Username DESC. SELECT Username,Address FROM Customer ORDER BY Username DESC.

SQL Select

 SQL Select   The SQL Select statement is used to select data from database. Return all data from Customer Table: SELECT * FROM Customer. Return Username and Password from Customer Table: SELECT Username and Password FROM Customer. Return Username whose id = 1 from Customer Table: SELECT Username FROM Customer WHERE id = 1. Return Different Username from Customer Table: SELECT DISTINCT Username FROM Customer. Return Count of Different Username from Customer Table. SELECT COUNT(DISTINCT Username ) FROM Customer.

HTML Heading

HTML Heading are more important when you designing website.Basically 6 types of heading. Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 CODE: <h1> <h2> <h3> <h4> <h5> <h6> You can use this code to give headings.

HTML Introduction

HTML is the standard markup language to create web pages. WHAT IS HTML? HTML stands for Hyper Text Markup Language For Creating Web Pages. Consist of series of element. Tell the browser how to manipulate the conten t. HTML STRUCTURE: < !DOCTYPE html > < html > < head > < title > Page Title < /title > < /head > < body > < h1 > Heading goes here < /h1 > < p > Paragraph goes here. < /p > < /body > < /html > <DOCTYPE html> - Defines the html5 document. <html> - Defines root element of html page. <head> - All meta,styling and script tag initilliaze tag goes here. <title> - Title of your websites. ...

Showing List of database Using Jquery, Ajax and Datatable

In this article of ASP.NET MVC we will learn about Showing List of database Using Jquery, Ajax and Datatable so let's start: Firstly create a model class which you want to show a list of datatable.In my case i create a model class namely called GEN_TaskMaster:  public class GEN_TaskMaster     {         public long sysTaskID { get; set; }         public long sysUserID { get; set; }                  public DateTime Task_Date { get; set; }         public string Task_Assign_To { get; set; }         public string Task_Assign_From { get; set; }         public string Task_Description { get; set; }                 } Then go to your controller and paste a code below: public ActionResult ListAll()         {             var list = db.Database...

DropDown Using Model Class and Sql Linq Query

In this articles of ASP.NET MVC we will learn about Dropdown using Model Class and Sql Linq Query so let's start Firstly create a model class which you want to show data in your dropdown In my case i create a model called GEN_User     public partial class GEN_Users     {         public long sysUserID { get; set; }         public string Username { get; set; }         public string Password { get; set; }     } Now go to your controller class and paste a code below: public ActionResult Index()         {             ViewBag.userName = new SelectList(db.GEN_Users, "sysUserID", "Username");             return View();         } Go to your view and simply paste a code below: @Html.DropDownList("GEN_Users", (SelectList)ViewBag.userName, "Select One", new { @class = "form-control "}) Thank you for reading...

Insertion using sql link query , jquery and ajax

In this articles of ASP.NET MVC we will learn about Insertion using sql linq query with jquery and ajax so let's get start. Firstly make a connection with database and for connection,Open visual studio on the left hand side goto server explorer and make a connection on click this button: After Click on this button you will find a dialogbox called Add Connection ,after appearing a dialogbox add a server name (to find a server name firstly open sql server management studio and when you open you will find a server name just copy server name and paste on Add Connection dialogbox under server name input field). In my case , my server name is NAVEED-PC. After adding server name just click OK button ,then you will find a connection with your database at the left corner under server explorer. After making connection , just right click on the connection which is marked with red colour and goto properties and once you clicked the properties option you will find its properties on the right ha...

CRUD Operation in ASP.NET MVC Using ADO.NET Jquery Ajax

In this article of ASP.NET MVC we will learn about CRUD operation using jquery ajax so let's start. Firstly open visual studio: Go to File => New and Select Project,when you select project then New Project Dialogbox will appear. Select ASP.NET Web Application (.NET Framework) and give a name to your project , as we are building CRUD Operation so our project's name could be CRUD_OPEATION and then select OK. Now you will see a new dialogbox, select Empty Template and MVC folder. After create project you will see a like screen like this: Now go to Models folder and add ADO.NET Entity Data Model and give any name like in my case i give dbEntities and selec OK: After that you will see a dilogbox called Entity Data Model Wizard, select EF Designer from database and select Next: After that a new dilogbox will appear and it will ask a new connection to your sql server, then select New Connection and give server name ( if you want to see your server name then open sql server,it will ...