From Traza + aryx, 2 Years ago, written in Plain Text.
Embed
  1. SELECT bolt_nev, bolt_ID, boltok.varos FROM boltok INNER JOIN vasarlasok ON fk_boltID = bolt_ID INNER JOIN torzsvasarlok ON fk_kartyaszam = kartyaszam WHERE torzsvasarlok.varos = "Budapest" AND boltok.varos = "Budapest" ORDER BY bolt_nev;
  2.  
  3.  
  4. SELECT nev, varos, utca_hazszam, irsz FROM torzsvasarlok LEFT JOIN vasarlasok ON fk_kartyaszam = kartyaszam WHERE vasarlas_ID IS NULL;
  5.  
  6.  
  7. SELECT COUNT(nev) AS "szamlalas", varos FROM torzsvasarlok WHERE nev LIKE "%a" GROUP BY varos ORDER BY szamlalas;
  8.  
  9.  
  10. SELECT nev, varos, utca_hazszam, irsz FROM torzsvasarlok GROUP BY varos;
  11.  
  12.  
  13. CREATE TABLE akciok ( akc_ID INT AUTO_INCREMENT PRIMARY KEY, akc_nev VARCHAR(20), akc_szazalek INT NOT NULL, kezdo_datum TIMESTAMP)
  14.  
  15.  
  16. ALTER TABLE torzsvasarlok ADD COLUMN vevo_min INT;
  17.  
  18.  
  19. DELETE torzsvasarlok FROM torzsvasarlok LEFT JOIN vasarlasok ON kartyaszam = fk_kartyaszam WHERE vasarlasok_ID IS NULL AND varos = "Budapest";