16.Data Query Language (DQL) in SQL|Isnull(),Null,Between,In,Order by Clause,Distinct,Like sysobject
Download 300+ Real-time SQL Interview Questions with Answers: https://imojo.in/SQLQuestionsPandeyGuruji Download Complete SQL Training Materials: https://imojo.in/sqlpandeyguruji Enroll for SQL Training Videos, SQL Training Materials, and Important Real-time Interview Questions with Answers: https://pandeyguruji.graphy.com/courses/download-sql-training-videos-materials-and-important-interview-questions ---------------------------------------------------------------------------------------------------------------------------- Are you someone who is looking for Real-time training contact +918309569513 or visit https://pandeyguruji.graphy.com/ and join for free training materials, Link: https://bit.ly/30vrk1W For any query Contact me on social media: Facebook : https://www.facebook.com/mpandeyguruji/ Instagram: https://www.instagram.com/pandey_guruji/ Linkedin: https://www.linkedin.com/in/mukesh-pandey-1a151634/ ------------------------------------------------------------------------------------------------------------------- SQL Tutorial for Beginners in Hindi: https://bit.ly/3CwfnGB SQL Tutorial for Beginners in English: https://bit.ly/3qVI3GQ SQL Live Training: https://bit.ly/3kXqOl1 Crack SQL Interview: https://bit.ly/3caxIyb SQL Interview Questions: http://bit.ly/2CR6wCZ Advance SQL Interview Questions: https://bit.ly/3HnMrnN Career Guidance: https://bit.ly/3FffkRf IT Technology News & Updates: https://bit.ly/3FeNQvc -------------------------------------------------------------------------------------------------------------------- This Video contains In-depth coverage Data Query Language (DQL) in SQL|Isnull(),Null,Between,In,Order by Clause,Distinct,Like sysobject in SQL. Covers all of the important queries and SQL commands. In this videos series, you'll learn how to read and write complex queries. Handle tricky SQL interview questions. Implement complex SQL queries and answer popular interview questions on SQL. These videos series will help to crack interviews and get jobs in SQL Developer, Database Developer, Data Engineer, Reporting Analyst, Data Analyst, Data Scientist, System Analyst, Power BI Developer, Tableau Developer, BI Developer, etc. ----------------------------------------------------------------------------------------------------------------- --- Find the table name Select * from sys.tables --- Find the All objects Name Select * from Sys.objects Select distinct type,type_desc from Sys.objects Select * from Sys.objects where type = 'P' ----Table creation If Exists ( Select 1 from Sys.objects Where Name = 'Department' and type = 'U') Drop table Department CREATE TABLE Department ( DepartID int, DepartmentName VARCHAR(30) ) Insert Into Department(DepartID,DepartmentName) values (1,'IT') Insert Into Department(DepartID,DepartmentName) values (2,'HR') Insert Into Department(DepartID,DepartmentName) values (3,'Marketing') Insert Into Department(DepartID,DepartmentName) values (4,'Operation') --How many stored procedure created in the database Select * from Sys.objects where type = 'V' Select * from DimEmployee --Where clause Select * from DimEmployee where Gender = 'M' and [MaritalStatus]= 'M' Select * from DimEmployee where [EmployeeKey] = 10 or [SalariedFlag] = 1 --• Order by Clause: By default ASC --Asc -- Desc Select * from DimEmployee Select * from DimEmployee order by FirstName desc Select * from DimEmployee order by FirstName Select * from DimEmployee order by FirstName asc Select * from DimEmployee order by SalesTerritoryKey,FirstName desc --we can also use the column position Select * from DimEmployee order by 5 desc Select * from DimEmployee order by 6 desc Select * from DimEmployee order by 5,6,7 asc drop table Emp1 CREATE TABLE Emp1( Emp_ID INT , Emp_name Varchar(100), Emp_Sal int ) INSERT INTO Emp1 VALUES (1,'Anees',4000); INSERT INTO Emp1 VALUES (2,'Rick',1200); INSERT INTO Emp1 VALUES (3,'John',1100); INSERT INTO Emp1 VALUES (4,'Stephen',900); INSERT INTO Emp1 VALUES (5,'assf',1400); INSERT INTO Emp1 VALUES (6,'cddgd',1400); INSERT INTO Emp1 VALUES (7,'dfgfhfg',1400); Select * from DimCustomer --How we can find the employee information which don't have middle name Select * from DimCustomer where MiddleName is null Select * from DimCustomer where ISNULL(MiddleName,'') = '' Select ISNULL(MiddleName,''),* from DimCustomer where ISNULL(MiddleName,'') = '' Select ISNULL(MiddleName,'N/A') as MiddleName_New,* from DimCustomer Select ISNULL(MiddleName,1),* from DimCustomer where ISNULL(GeographyKey,1)=1 --• Column aliases Select EmployeeKey as EMPID,ParentEmployeeKey PEMPID,FirstName as FName,LastName LName from DimEmployee -- In And Between
Download
0 formatsNo download links available.