Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
SI 1
CREATE TABLE Classification( IdClassification INT PRIMARY KEY NOT NULL, NameClassification VARCHAR (10) ) INSERT INTO Classification VALUES (1001, 'SUV'), (1002, 'Sedan'), (1003, 'Compact'); SELECT IdClassification AS [Codul clasificatiei], NameClassification AS [Numele clasificatiei] FROM Classification; CREATE TABLE PetrolEngines( IdPetrolEngines INT PRIMARY KEY NOT NULL, ModelPetrolEngines VARCHAR (30), Power INT, Torque VARCHAR (30), Transmission VARCHAR (30), Year VARCHAR (30) ) INSERT INTO PetrolEngines VALUES (2001, '1.4 TSI 125 ', 125, '200 N⋅m', '6-speed manual', '2016–2018'), (2002, '1.4 TSI 150 ', 150, '250 N⋅m', '6-speed manual', '2016–2018'), (2003, '1.5 TSI 130 ', 130, '220 N⋅m', '6-speed manual', '2019–present'), (2004, '1.5 TSI 150 ', 150, '250 N⋅m', '6-speed manual ', '2018–present'), (2005, '2.0 TSI 180 4 Motion', 180, '320 N⋅m', '7-speed DSG', '2016–2018'), (2006, '2.0 TSI 190 4 Motion', 190, '320 N⋅m', '7-speed DSG', '2019–2020'), (2007, '2.0 TSI 220 4 Motion', 220, '350 N⋅m', '7-speed DSG', '2016–2018'), (2008, '2.0 TSI 230 4 Motion', 230, '350 N⋅m', '7-speed DSG', '2019–2020'), (2009, '2.0 TSI 320 4 Motion', 320, '420 N⋅m', '7-speed DSG', '2020–present'); SELECT IdPetrolEngines AS [Codul motorului pe benzina], ModelPetrolEngines AS [Modelul motorului], Power AS [Puterea motorului], Torque AS [Cuplu], Transmission AS [Cutia de viteze], Year AS [Anul] FROM PetrolEngines; CREATE TABLE Model( IdModel INT PRIMARY KEY NOT NULL, NameModel VARCHAR (10), NumberDoors INT, Engine VARCHAR (20), Wheels VARCHAR (20), IdClassification INT NOT NULL FOREIGN KEY REFERENCES Classification (IdClassification) ) INSERT INTO Model VALUES (3001, 'Atlas', 4, '1.8 tsi', '18 black', 1001), (3002, 'Passat', 4, '1.8 tsi', '20 black', 1002); SELECT IdModel AS [Codul modelului], NameModel AS [Numele modelului], NumberDoors AS [Numarul de usi], Engine AS [Motor], Wheels AS [Jante], IdClassification AS [Codul clasificatiei] FROM Model;
run
|
edit
|
history
|
help
0
/Users/svetlanakanevskaa/Downloads/ACDB.sql
Microsoft SQL Server T-SQL in 10 minutes - products
Sum then delete one row - SQL Server 2008 R2
Query through an error in Sql Server
VANYA
dynamic pivot
Customer_Orders
Veterinary 1
Test row_number() ordering when CTE referenced multiple times
Generate xml