10 SQL Code Challenges for Beginners | T-SQL Practice Statements

Published: 20 November 2022
on channel: Urban IT Canada
47
6

SQL Queries for creating Tables

1.
Create table Opposite
(
id int,
Value int
)

Insert into Opposite
Values (1,-56),(2,76),(3,-84),(4,96),(5,-47)

2.
Create table Divisions
(
Division_id int,
Year int,
Revenue int
)

Insert into Divisions
Values (1,2018,60),(1,2021,40),(1,2020,70),(2,2021,-10),(3,2018,20),(3,2016,40),(4,2021,50)

3.
Create table Century
(
id int,
Year int
)

Insert into Century
Values (1,1776),(2,2001),(3,1643),(4,1865),(5,1969)

4.
Create Table EvenOdd
(
id int,
Value int
)

Insert into EvenOdd
Values (1,4),(2,11),(3,57),(4,24),(5,47)

5.
Create Table AgeGroup
(
id int,
Name char(10),
Age int
)

Insert into AgeGroup
Values (1,'Bob',21),(2,'Sam',19),(3,'Jill',18),
(4,'Jim',21),(5,'Sally',19),(6,'Jess',20),(7,'Will',21)


6.
Create Table Greeting
(
id int,
Name char(10)
)

Insert into Greeting
Values(1,'Bob'),(2,'Sam'),(3,'Jill'),(4,'Jim'),(5,'Sally'),(6,'Jess'),(7,'Will')



7.
Create table BestSeller
(
id int,
Name VARCHAR(10),
Amount_Sold int
)

Insert into BestSeller
Values (1,'Cup',11),(2,'Saucer',22),(3,'Plate',46),(4,'Fork',34),(5,'Spoon',45),(6,'Knife',78),
(7,'Mug',23),(8,'Glass',64),(9,'Tumbler',24)

8.
Create Table Passport
(
id int,
Name VARCHAR(20),
Country VARCHAR(20)
)

Insert into Passport
Values (1,'Bob Smith','United States'),(2,'Jim Jones','China'),(3,'Sam White','Japan'),
(4,'Jess Black','Canada'),(5,'Will Wilson','Germany'),(6,'Wilson Scott','England'),
(7,'Scott Daniels','France'),(8,'Daniel Jackson','Canada'),(9,'Jack Johnson','United States')


Blog's URL: https://www.codecademy.com/resources/...

If you are ready for Expert Level Challenge, check out my other video:    • How to Find Hat-Trick using T-SQL| LEAD an...  

Please like, comment and subscribe.


On this page of the site you can watch the video online 10 SQL Code Challenges for Beginners | T-SQL Practice Statements with a duration of hours minute second in good quality, which was uploaded by the user Urban IT Canada 20 November 2022, share the link with friends and acquaintances, this video has already been watched 47 times on youtube and it was liked by 6 viewers. Enjoy your viewing!