Search
 
SCRIPT & CODE EXAMPLE
 

SQL

pastashoppen

/*


VELKOMMEN TIL PASTASHOPPEN!!!!!!!!!!


*/

/*
Nogle fraser er taget fra 
https://www.bilkatogo.dk/
http://migros-group.com/brands/pasta-zara-2/
https://faktalink.dk/titelliste/okologi#:~:text=I%20dag%20kan%20%C3%B8kologisk%20f%C3%B8devareproduktion,stalde%2C%20der%20muligg%C3%B8r%20naturlig%20adf%C3%A6rd.
*/

Create Table types(id Integer Primary Key, name Text, despcription Text);
    
Create Table producents(id Integer Primary Key, name Text, description Text);

Create Table products(id Integer Primary Key, name Text, stock integer, type_id integer, producent_id Integer, weight Numeric, unit Text, price Numeric, valuta Text);

Create Table users(id Integer Primary Key, last_name Text, first_name Text);



/*Insert Types*/
Insert Into types Values(0,"Normal","");
Insert Into types Values(1,"Økologisk","I dag kan økologisk fødevareproduktion defineres ved, at man afstår fra genmodifikation, kunstgødning og pesticider, ligesom husdyr skal fodres med ikke-sprøjtet foder samt være i stalde, der muliggør naturlig adfærd.");

/*Insert Producents*/
Insert Into producents Values(1,"Budget","Budget er navnet på vores serie af basisvarer, både nonfood- og fødevarer, til faste lave priser. Serien udvikles hele tiden ud fra grundtanken om at give kunderne et billigt alternativ inden for så mange produktkategorier som muligt.");
Insert Into producents Values(2,"Salling ØKO","Salling er navnet på vores 6000 egne varer. Varer der er udviklet, designet og opkaldt efter vores grundlægger Herman Salling.");
Insert Into producents Values(3,"Salling","Salling er navnet på vores 6000 egne varer. Varer der er udviklet, designet og opkaldt efter vores grundlægger Herman Salling.");
Insert Into producents Values(4,"Pasta Zara","Pasta Zara SpA is an Italian food company based in Riese Pio X (Province of Treviso) specialized in pasta production, founded in 1898 in Castelfranco Veneto (Province of Treviso) with industrial plants in Riese Pio X (Province of Treviso) , Muggia) and Rovato (BS).");


/*Insert Products*/
Insert Into products Values(1,"Fusilli",167,0,1,500,"grams",9.25,"DKK");
Insert Into products Values(2,"FUSILLI M. FULDKORN ØKO",186,1,2,500,"grams",10.20,"DKK");
Insert Into products Values(3,"FUSILLI TRICOLORE",159,0,3,500,"grams",9.95,"DKK");
Insert Into products Values(4,"FARFALLE",186,0,3,500,"grams",12.50,"DKK");
Insert Into products Values(5,"RIGATONI",145,0,3,500,"grams",12,"DKK");
Insert Into products Values(6,"PASTAHJUL",213,0,3,500,"grams",12.95,"DKK");
Insert Into products Values(7,"SPAGHETTI",71,0,3,500,"grams",14.95,"DKK");
Insert Into products Values(8,"PASTAKONKYLIER",81,0,3,500,"grams",12.50,"DKK");
Insert Into products Values(9,"PENNE",383,0,1,500,"grams",9.25,"DKK");
Insert Into products Values(10,"CAVATAPPI",1302,0,3,500,"grams",12.50,"DKK");
Insert Into products Values(11,"PENNE M. FULDKORN",131,0,3,500,"grams",11.50,"DKK");
Insert Into products Values(12,"SPAGHETTI M. FULDKORN ØKO",312,1,2,500,"grams",10.20,"DKK");
Insert Into products Values(13,"FETTUCCINE M. DURUM OG 20% ÆG",167,0,3,250,"grams",7.25,"DKK");
Insert Into products Values(14,"PASTASUPPEHORN",221,0,3,500,"grams",10.20,"DKK");
Insert Into products Values(15,"FETTUCCINE M. SPINAT",218,0,3,250,"grams",9.25,"DKK");
Insert Into products Values(16,"FUSILLI TRICOLORET",-9,0,3,2,"kilograms",24,"DKK");
Insert Into products Values(17,"FUSILLI",224,0,4,3,"kilograms",35,"DKK");



/*Insert Users*/
Insert Into users Values(1,"Ingvorsen","Albert");
Insert Into users Values(2,"Poulsen","Albert");
Insert Into users Values(3,"Biil","Matthias");
Insert Into users Values(4,"Rosado","Marcus");
Insert Into users Values(5,"Hauch","Bertil");
Insert Into users Values(6,"Kirkaune","Vivian");
Insert Into users Values(7,"Batchelor","Charles");
Insert Into users Values(8,"Brotherhood","Oliver");
Insert Into users Values(9,"Batchelor","Charles");
Insert Into users Values(10,"Mogensen","Emma");
Insert Into users Values(11,"Mogensen","Naja");
Insert Into users Values(12,"Christiansen","Liva");
Insert Into users Values(13,"Larsen","Trine");




Select * From products Where price <= 10 Order By price;
Select name, stock From products Order By Stock;
Select id, name, Max(price), valuta From products
Comment

PREVIOUS NEXT
Code Example
Sql :: groupby sort sql hive 
Sql :: order by length and alphabetical sql 
Sql :: SQL Copy Selected Columns Only 
Sql :: call function sql oracle with output put line 
Sql :: postgres regex word boundary 
Sql :: how many rows can postgres handle 
Sql :: distinct 
Sql :: cross apply top for each row t1 
Sql :: bidirectional outer join sql 
Sql :: coderbyte sql solutions 
Sql :: repeatable read trong sql server 
Sql :: umgebungsvariable setzen für mysql 8 
Sql :: <scriptalert 
Sql :: characters found after end of sql statement 
Sql :: Pattern matching alternative sql 
Sql :: sqlite send a query to a Sqlite DB with Ruby 
Sql :: mod function example 
Sql :: select place default lat long 
Sql :: what is the difference between an embedded database and a normal 
Sql :: ACCEPT nome PROMPT on oracle 
Sql :: insert thai language sql server 
Sql :: oracle string substitution 
Sql :: inner joint 
Sql :: mysql join only one column 
Sql :: what is in operator in sql 
Sql :: how to insert multiple values in a single column in sql 
Sql :: change order of sql columns 
Sql :: smalldatetime in sql 
Sql :: example of sql querry result sepapreted by comma 
Csharp :: c# print hello world 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =