TCS SQL Interview Questions | SQL Server | SQL Interview Preparation | Part 43

preview_player
Показать описание
TCS interview questions and answers:

For SQL Quiz-

Find Us On FaceBook-

---Query Question : 1--

CREATE TABLE COLVALUES
(
COL1 VARCHAR(5),
COL2 VARCHAR(5),
COL3 VARCHAR(5),
)

INSERT INTO COLVALUES VALUES ('A','B','C'),('X','Y','Z'),('1','2','3'),('100','200','300'),('P','Q','R')

SELECT COL1,COL2
FROM COLVALUES
UNION ALL
SELECT COL1,COL3
FROM COLVALUES
ORDER BY COL1

-----Query---Question : 2--

CREATE TABLE DISTINCTVALUES
(
COL1 int,
)

INSERT INTO DISTINCTVALUES VALUES (1),(1),(1),(2),(2),(3),(4),(4)

SELECT * FROM DISTINCTVALUES
UNION
SELECT * FROM DISTINCTVALUES
Рекомендации по теме
Комментарии
Автор

Can’t thank you enough… the collection of your interview questions is really amazing.. the best YouTube channel for SQL server interview questions 👍🏼

chetalikekre
Автор

Good efforts. I am VBA developer but I have knowledge on SQL not much more. Now I am interested to learn SQL saas ssrs SSIS. I am watching all your videos. I think if I do practice your videos then SQL can learn

RaMeShBaBu-gfwc
Автор

You're matchless, sir! Tomorrow I have an interview @TCS. If you have more questions pl/sql oracle related, kindly share with us. Thanks in advance! :)

priyankasarkar
Автор

Hi Susheel, your videos are really hellpful and please make videos on magic tables, different locks/isolation available in sql server

prajaakeeyaparty
Автор

we can use group by also to get the distinct record.

jaideepmalik
Автор

Very nice susheel. I have learnt so many things from your videos. Please continue doing the good work.

anupamaagarwal
Автор

Wow it's nice to see this video..
This is great way to filter duplicate records.

ssunitech
Автор

the first question did not match the output

dhilipsurya