Products Without Duplicates

 DML Script:

DROP TABLE IF EXISTS Products;

GO


CREATE TABLE Products

(

Product      VARCHAR(10),

ProductCode  VARCHAR(2),

PRIMARY KEY (Product, ProductCode)

);

GO


INSERT INTO Products (Product, ProductCode) VALUES

('Alpha','01'),

('Alpha','02'),

('Bravo','03'),

('Bravo','04'),

('Charlie','02'),

('Delta','01'),

('Echo','EE'),

('Foxtrot','EE'),

('Gulf','GG');

GO


Detailed Explanation: https://youtu.be/3CI2ZNF3VMY

Comments

Popular posts from this blog

50 Essential SQL Questions to Land Your Dream Job

How to find all the customers who placed orders on three consecutive days | SQL Scenario questions

ACCENTURE SQL INTERVIEW QUESTION | Change the ProductIDs