Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
E2
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
CREATE TABLE Gamintojas ( Gamintojo_kodas CHAR(4) NOT NULL, Pavadinimas VARCHAR(35) NOT NULL, PRIMARY KEY (Gamintojo_kodas) ); CREATE TABLE Sandelis ( Nr SMALLINT NOT NULL, Daiktu_sk SMALLINT CHECK (Daiktu_sk > 0), PRIMARY KEY (Nr) ); CREATE TABLE Uzsakymas ( Nr INTEGER NOT NULL, Pirkejas CHAR(5) NOT NULL, Prekiu_kiekis SMALLINT NOT NULL, Suma DECIMAL(5,2) CHECK(Suma > 10 AND Suma < 3000), Uzsakymo_data DATE, Issiuntimo_data DATE CHECK (Issiuntimo_data >= Uzsakymo_data), PRIMARY KEY (Nr) ); CREATE TABLE Preke ( Kodas CHAR(5) NOT NULL, Pavadinimas VARCHAR(35) NOT NULL, SN CHAR(7), Gamintojas VARCHAR(35), Kaina DECIMAL(4,2) CONSTRAINT Kainos_dydis CHECK (Kaina > 0 AND Kaina < 300), Uzsakymas INTEGER NOT NULL, Sandelis SMALLINT NOT NULL, PRIMARY KEY (Kodas), CONSTRAINT IUzsakyma FOREIGN KEY (Uzsakymas) REFERENCES Uzsakymas ON DELETE CASCADE ON UPDATE RESTRICT ); CREATE TABLE Pirkejas ( Pirkejo_ID CHAR(6) NOT NULL, Vardas VARCHAR(35) NOT NULL, Pavarde VARCHAR(35) NOT NULL, Adresas VARCHAR(35) NOT NULL, Telefono_nr CHAR(9) NOT NULL, PRIMARY KEY(Pirkejo_ID) ); INSERT INTO Gamintojas VALUES ('1234','RAZERIS'); INSERT INTO Gamintojas VALUES ('4356','KOM'); INSERT INTO Gamintojas VALUES ('7534','FIJI'); INSERT INTO Gamintojas VALUES ('2434','BIM BAM BUM');
absolute service time: 0,41 sec
edit mode
|
history
|
discussion