sqlserver
250+ SQL Programs for Practice | SQL Tutorial
SQL Tutorial SQL Tutorial provides in-depth knowledge about the Database Management using MS SQL Server, MySQL Server. To understand more …
Top 100 SQL Queries Interview Questions
Introduction In this article, you will find basic to most puzzled interview queries questions with an example. This article is …
How to find out Microsoft SQL Server Enterprise Edition Expiration Date
Introduction As you all know Microsoft SQL Server’s evaluation edition expires after 6 months of validity. So in this article, …
How can I remove duplicate rows from large table
Introduction Remove duplicate rows from large table which has more than 10,000+ rows. DELETE FROM student WHERE ID NOT IN …
Write a SQL query to get FirstName, Lastname, Scholarship amount from tblStudent and tblScholarship table for all students even if they didn’t get Scolarship
Introduction Write a SQL query to get FirstName, Lastname, Scholarship amount from tblStudent and tblScholarship table for all students even …
SQL Server Advanced Questions – ‘Join’
The following exercise will help you to improve your MS SQL server query skills effectively. I have used Microsoft SQL …
Write the query to get branch, no of students in a branch, total admission fees with respect to a branch from tblStudent table order by admission fees descending
Introduction Write the query to get branch, no of students in a branch, total admission fees with respect to a …
Write the query to get no of students joined with respect to year and month from tblStudent table
Introduction Write the query to get no of students joined with respect to year and month from tblStudent table. I …
Write the query to get branch wise average admission fees from “tblStudent” table order by admission fees ascending order
Introduction Write the query to get branch wise average admission fees from “tblStudent” table order by admission fees ascending order. …
Write the query to get the branch and branch wise total(sum) admission fees, display it in ascending order according to admission fees
Introduction Write the query to get the branch and branch wise total(sum) admission fees, display it in ascending order according …
Write a query to get how many students exist in tblstudent
Introduction Write a query to get how many students exist in tblstudent. I have used Microsoft SQL server 2008 R2 …
Write a query to get 5 % of admission fees from Michael, 10% of admission fees from John and for other 15 % of admission fees as ‘Deducted_Admission_fee’ from tblStudent table
Introduction Write a query to get 5 % of admission fees from Michael, 10% of admission fees from John and …
Write a query to get students details from “tblStudent” whose admission fees is between 900 and 1500
Introduction Write a query to get students details from “tblStudent” whose admission fees is between 900 and 1500. I have …
Write a query to get students details from “tblStudent” whose admission fees is greater than 1200
Introduction Write a query to get students details from “tblStudent” whose admission fees is greater than 1200. I have used …
Write a query to get students details from “tblStudent” whose admission fees is less than 1200
Introduction Write a query to get students details from “tblStudent” whose admission fees is less than 1200. I have used …
Write a query to select FirstName, LastName from tblStudent table in singal column
Introduction Write a query to select FirstName, LastName from tblStudent table in singal column. I have used Microsoft SQL server …
Write a query to select Minimum Admission fees from tblStudent table
Introduction Write a query to select Minimum Admission fees from tblStudent table. I have used Microsoft SQL server 2008 R2 …
Write a query to select highest Admission fees from tblStudent table
Introduction Write a query to select highest Admission fees from tblStudent table. I have used Microsoft SQL server 2008 R2 …
Write a query to select TOP 2 Admission fees from tblStudent table
Introduction Write a query to select TOP 2 Admission fees from tblStudent table. I have used Microsoft SQL server 2008 …
Write a query to select second highest admission fees from “tblStudent” table
Introduction Write a query to select second highest admission fees from “tblStudent” table. I have used Microsoft SQL server 2008 …
Write a query to select TOP Nth (any number) admission fees from tblStudent table
Introduction Write a query to select TOP Nth (any number) admission fees from tblStudent table. I have used Microsoft SQL …
List of SQL Query questions on Top, Union, admission fees and Group by questions
The following exercise will help you to improve your MS SQL server query skills effectively. I have used Microsoft SQL …
Write a Query to get only time part of the “AdmissionDate” from tblStudent
Introduction Write a Query to get only time part of the “AdmissionDate” from tblStudent. I have used Microsoft SQL server …
Write a Query to get “AdmissionDate” in “yyyy/mm/dd” format, ex- “2019/05/06”
Introduction Write a Query to get “AdmissionDate” in “yyyy/mm/dd” format, ex- “2019/05/06”. I have used Microsoft SQL server 2008 R2 …
Write a Query to get “AdmissionDate” in “dd mmm yyyy” format, ex- “06 May 2019”
Introduction Write a Query to get “AdmissionDate” in “dd mmm yyyy” format, ex- “06 May 2019”. I have used Microsoft …
Write a Query to get the first name, last name, current date, admission date and difference between current date and admission date in year
Introduction Write a Query to get the first name, last name, current date, admission date and difference between current date …
Write a Query to get the first name, last name, current date, admission date and difference between current date and admission date in month
Introduction Write a Query to get the first name, last name, current date, admission date and difference between current date …
Write a SQL query to Get the first name, last name, current date, admission date and difference between current date and admission date in days
Introduction Write a SQL query to Get the first name, last name, current date, admission date and difference between current …
Write a SQL query to get all student details from tblStudent table whose admission date between ‘2016-01-01’ and ‘2018-01-01’
Introduction Write a SQL query to get all student details from tblStudent table whose admission date between ‘2016-01-01’ and ‘2018-01-01’. …
Write a SQL query to get only year part of admission date from tblStudent
Introduction Write a SQL query to get only year part of admission date from tblStudent. I have used Microsoft SQL …
Write a SQL query to get only month part of admission date from tblStudent
Introduction Write a SQL query to get only month part of admission date from tblStudent. I have used Microsoft SQL …
Write a SQL query to get database date
Introduction Write a SQL query to get database date. I have used Microsoft SQL server 2008 R2 for the following …
Write a SQL query to get admission date and time from tblStudent table
Introduction Write a SQL query to get admission date and time from tblStudent table. I have used Microsoft SQL server …
Write a SQL query to get student details from tblStudent table whose admission month is ‘June’
Introduction Write a SQL query to get student details from tblStudent table whose admission month is ‘June’. I have used …
Write a SQL query to get student details from tblStudent table whose admission date is before January 31st
Introduction Write a SQL query to get student details from tblStudent table whose admission date is before January 31st. I …
Write a SQL query to get student details from tblStudent table whose admission date is after January 31st 2018
Introduction Write a SQL query to get student details from tblStudent table whose admission date is after January 31st 2018. …
Write a SQL query to get student details from tblStudent table whose admission year is “2016”
Introduction Write a SQL query to get student details from tblStudent table whose admission year is “2016”. I have used …
Write a Sql query get first name, admission year, admission month and admission date from tblStudent table
Introduction Write a Sql query get first name, admission year, admission month and admission date from tblStudent table. I have …
List of SQL Query questions on Datetime
The following exercise will help you to improve your MS SQL server query skills effectively. I have used Microsoft SQL …
Write a SQL query get fristname from tblstudent not start with any single character between a-l
Introduction Write a SQL query get fristname from tblstudent not start with any single character between a-l. I have used …
Write a SQL query get all students details from tblStudent whose first name ends with ‘a’ and name contains 4 letters
Introduction Write a SQL query get all students details from tblStudent whose first name ends with ‘a’ and name contains …
Write a SQL query get all students details from tblStudent whose first name starts with ‘m’ and name contains 4 letters
Introduction Write a SQL query get all students details from tblStudent whose first name starts with ‘m’ and name contains …
Write a SQL query to get FristName from tblStudent table after replacing ‘a’ with ‘$’
Introduction Write a SQL query to get FristName from tblStudent table after replacing ‘a’ with ‘$’. I have used Microsoft …
Write a SQL query to get length of FirstName from tblstudent
Introduction Write a SQL query to get length of FirstName from tblstudent. I have used Microsoft SQL server 2008 R2 …
Write a SQL query to get FirstName from tblstudent after removing white spaces from left side
Introduction Write a SQL query to get FirstName from tblstudent after removing white spaces from left side. I have used …
Write a SQL query to get FirstName from tblstudent after removing white spaces from right side
Introduction Write a SQL query to get FirstName from tblstudent after removing white spaces from right side. I have used …
Write a SQL query to get firstname from tblstudent with Hello prefix
Introduction Write a SQL query to get firstname from tblstudent with Hello prefix. I have used Microsoft SQL server 2008 …
Write a SQL query to get position of ‘v’ in name ‘David’ from tblstudent
Introduction Write a SQL query to get position of ‘v’ in name ‘David’ from tblstudent. I have used Microsoft SQL …
Write a SQL query to get all students details from the tblStudent table order by LastName Ascending and Admission fees descending
Introduction Write a SQL query to get all students details from the tblStudent table order by LastName Ascending and Admission …
Write a SQL query to get all students details from the tblStudent table order by FirstName Descending
Introduction Write a SQL query to get all students details from the tblStudent table order by FirstName Descending. I have …
Write a SQL query to get all students details from the tblStudent table order by FirstName Ascending
Introduction Write a SQL query to get all students details from the tblStudent table order by FirstName Ascending. I have …
Write a SQL query to get list of all students whose first name start with ‘Ma’ or ‘Da’
Introduction Write a SQL query to get list of all students whose first name start with ‘Ma’ or ‘Da’. I …
Write a SQL query to get all student details from tblstudent whose “FirstName” ends with ‘a’
Introduction Write a SQL query to get all student details from tblstudent whose “FirstName” ends with ‘a’. I have used …
Write a SQL query to get all student details from tblstudent whose “FirstName” start with letter ‘d’
Introduction Write a SQL query to get all student details from tblstudent whose “FirstName” start with letter ‘d’. I have …
Write a SQL query to get all student details from tblstudent whose “FirstName” contains ‘a’
Introduction Write a SQL query to get all student details from tblstudent whose “FirstName” contains ‘a’. I have used Microsoft …
Write a SQL query to combine firstname and lastname and display it as “Full Name”
Introduction Write a SQL ( Structured Query Language ) query to combine firstname and lastname and display it as “Full …
Write a SQL query to get unique branch from tblstudent table
Introduction Write a SQL query to get unique branch from tblstudent table. I have used Microsoft SQL server 2008 R2 …
Write a SQL query to get first name from tblstudent in lower case
Introduction Write a SQL query to get first name from tblstudent in lower case. I have used Microsoft SQL server …
Write a SQL query to get first name from tblstudent in upper case
Introduction Write a SQL query to get first name from tblstudent in upper case. I have used Microsoft SQL server …
Write a SQL query to get details whose firstname starts with name “David”
Introduction Write a SQL query to get details whose firstname starts with name “David”. I have used Microsoft SQL server …
Write a SQL query to display firstname and branch of student, who belongs to the branch ‘Computer Engineering’
Introduction Write a SQL query to display firstname and branch of student, who belongs to the branch ‘Computer Engineering’. I …
Write a query to display only firstname and branch from table student
Introduction Write a query to display only firstname and branch from table student. I have used Microsoft SQL server 2008 …
Write a SQL query to display sum of two numbers 10 and 15
Introduction Write a SQL query to display sum of two numbers 10 and 15. I have used Microsoft SQL server …
Write a SQL query to display a string “Hello World!”
Introduction Write a SQL query to display a string “Hello World!”. I have used Microsoft SQL server 2008 R2 for …
Write a SQL statement to display all students information
Introduction I have used Microsoft SQL server 2008 R2 for the following demo. tblstudent StudentId FirstName LastName Admission_fee Admission_date Branch …
MS SQL Queries to retrieve data from tables
In this article, you will find basic to most puzzled Microsoft SQL Server queries to retrieve data from tables with …