Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Terceiro
--Sql Server 2014 Express Edition --Batches are separated by 'go' CREATE TABLE products ( id NUMERIC, name VARCHAR(255), amount NUMERIC, price NUMERIC, id_providers NUMERIC, id_categories NUMERIC ) CREATE TABLE providers ( id NUMERIC, name VARCHAR(255), street VARCHAR(255), city VARCHAR(255), state varCHAR(255) ) CREATE TABLE categories ( id NUMERIC, name VARCHAR(255)) INSERT INTO products ( id, name, amount, price, id_providers, id_categories ) VALUES ( 1, 'Two-door wardrobe', 100, 800, 6, 8 ), ( 2, 'Dining table', 1000, 560, 1, 9 ), ( 3, 'Towel holder', 10000, 25, 5, 1 ), ( 4, 'Computer desk', 350, 320, 4, 6 ), ( 5, 'Chair', 3000, 210, 3, 6 ), ( 6, 'Single bed', 750, 460, 1, 2 ); INSERT INTO providers ( id, name, street, city, state ) VALUES ( 1, 'Henrique', 'AV Brasil', 'Rio de Janeiro', 'RJ' ), ( 2, 'Marcelo Augusto', 'Rua Imigrantes', 'Belo Horizonte', 'MG' ), ( 3, 'Caroline Silva', 'Av São Paulo', 'Salvador', 'BA' ), ( 4, 'Guilerme Staff', 'Rua Central', 'Porto Alegre', 'RS' ), ( 5, 'Isabela Moraes', 'Av Juiz Grande', 'Curitiba', 'PR' ), ( 6, 'Francisco Accerr', 'Av Paulista', 'São Paulo', 'SP'); INSERT INTO categories ( id, name ) VALUES ( 1, 'Old Stock'), ( 2, 'New Stock'), ( 3, 'Modern'), ( 4, 'Commercial'), ( 5, 'Recyclable'), ( 6, 'Executive'), ( 7, 'Superior'), ( 8, 'Wood'), ( 9, 'Super Luxury'), ( 10, 'Vintage'); SELECT products.name, providers.name FROM products INNER JOIN providers ON providers.id = products.id_providers WHERE products.id_categories=6;
run
|
edit
|
history
|
help
0
SO_20171230_SqlServer
bdLojaRoupas
Data row generator (good performance, w/o recursive CTE)
Rno 37 boat
Microsoft SQL Server T-SQL in 10 mn ~ Lesson 13 Subqueries vers.#3
Outer Apply successer cell chek and get the result
securing critical sections with manual locks in sql server
BRYANActual
Items
identity