Back to Browse

SQL SERVER - II How to create table with JSON data type and retrieve the data?

17 views
Mar 13, 2026
19:16

Creater Table Orders( OrderId INT, CustomerName Varchar(20), OrderDeatils JSON) Insert into Orders Values (1,'Arjun','{"Product":"Laptop","Price":70000,"Qty":1,"City":"Vizag"}') select Orderid, JSON_VALUE(OrderDeatils,'$.Product')AS Product, JSON_VALUE(OrderDeatils,'$.Price')AS Price From Orders Find out Orders where Product is laptop select * from Orders WHERE JSON_VALUE(OrderDeatils,'$.Product')='Laptop' Find the Orders where price less than 25k Select OrderId,CustomerName from orders WHERE CAST(JSON_VALUE(OrderDeatils,'$.Price') AS Int) lt 25000

Download

1 formats

Video Formats

360pmp414.3 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

SQL SERVER - II How to create table with JSON data type and retrieve the data? | NatokHD