Advertisement
mudhita_triari

Membuat dan menambahkan tabel

Apr 19th, 2024
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PostgreSQL 1.12 KB | Source Code | 0 0
  1. -- Mengatur parameter
  2. SET statement_timeout = 0;
  3. SET lock_timeout = 0;
  4. SET idle_in_transaction_session_timeout = 0;
  5. SET client_encoding = 'UTF8';
  6. SET standard_conforming_strings = on;
  7. SELECT pg_catalog.set_config('search_path', 'public', false);
  8. SET check_function_bodies = false;
  9. SET xmloption = content;
  10. SET client_min_messages = warning;
  11. SET row_security = off;
  12.  
  13. -- Membuat tabel
  14. CREATE TABLE public.Buah (
  15.     namaBuah CHARACTER(20),
  16.     Jumlah CHARACTER(20),
  17.     Harga CHARACTER(20)
  18. );
  19.  
  20. -- Memasukkan data ke dalam tabel
  21. INSERT INTO public.Buah (namaBuah, Jumlah, Harga) VALUES
  22. ('Mangis', '21', '2000'),
  23. ('Mangga', '24', '1500'),
  24. ('Rambutan', '23', '3500'),
  25. ('Bengkoang', '22', '4500'),
  26. ('Apel', '30', '3000'),
  27. ('Jeruk', '28', '2500'),
  28. ('Pisang', '40', '1500'),
  29. ('Durian', '10', '10000'),
  30. ('Semangka', '15', '5000'),
  31. ('Melon', '16', '5500'),
  32. ('Pepaya', '25', '2000'),
  33. ('Nanas', '20', '2500'),
  34. ('Anggur', '18', '8000'),
  35. ('Lemon', '30', '3000'),
  36. ('Alpukat', '22', '6000'),
  37. ('Belimbing', '35', '2000'),
  38. ('Ceri', '40', '7000'),
  39. ('Duku', '38', '3500'),
  40. ('Guava', '32', '3000'),
  41. ('Jambu Air', '36', '2500');
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement