Website Development Prices

Search Blog

Friday, May 8, 2015

Izrada tabela baze podataka (Creating database tables)

Baza podataka prodavnice VolimMotore.

Kupci (SifraKupca, Ime, Adresa, Grad)
Porudzbine (BrojPorudzbine, SifraKupca, Iznos, Datum)
Motori (BrojMotora, Proizvodjac, ImeMotora, Cena)
Stvari_Porudzbina (BrojPorudzbine, BrojMotora, Kolicina)
Pregled_Motora (BrojMotora, Pregled)

Ovaj kod sacuvajte kao volimmotore.sql.


create table kupci
( customerid int unsigned not null auto_increment primary key,
  ime char(50) not null,
  adresa char(100) not null,
  grad char(30) not null
);

create table porudzbine
( brojporudzbine int unsigned not null auto_increment primary key,
  sifrakupca int unsigned not null,
  iznos float(6,2),
  date date not null
);

create table motori
(  brojmotora char(13) not null primary key,
   proizvodjac char(50),
   imemotora char(100),
   cena float(4,2)
);

create table stvari_porudzbina
( brojporudzbine int unsigned not null,
  brojmotora char(13) not null,
  kolicina tinyint unsigned,

  primary key (brojporudzbine, brojmotora)

);
create table pregled_motora
(
  brojmotora char(13) not null primary key,
  pregled text

);


Otvorite phpmyadmin tako sto cete pokrenuti XAMPP. Kliknite na Admin u liniji MySQL-a ili ukucajte u address bar http://localhost/phpmyadmin/ 

Kreiranje baze podataka volimmotore.

1. Kliknite karticu Databases.

2. Upisite ime baze, u ovom slucaju volimmotore
3. Za Collation izaberite utf8_general_ci.

4. Kliknite dugme Create.

Kreiranje tabela u bazi podataka volimmotore.

1. Sa leve strane izaberite bazu podataka volimmotore.

2. Izaberite karticu SQL.

3. Unesite kod iz fajla volimmotore.sql.


4. Kiknite dugme Go.

5. Kliknite na karticu Structure.

The database of the store LoveMotobikes.

Customers (CustomerID, Name, Address, City)
Orders (OrdersID, CustomerID, Amount, Date)
Motobikes (MotobikeID, Manufacturer, MotobikeName, Price)
Oraders_Items (OrdersID, MotobikeID, Quantity)
Pregled_Motora (MotobikeID, Review)
.
This code save as lovemotobikes.sql.

create table customers
( customerid int unsigned not null auto_increment primary key,
  name char(50) not null,
  address char(100) not null,
  city char(30) not null
);

create table orders
( ordersid int unsigned not null auto_increment primary key,
  customerid int unsigned not null,
  amount float(6,2),
  date date not null
);

create table motobikes
(  motobikeid char(13) not null primary key,
   manufacturer char(50),
   motobike_name char(100),
   price float(4,2)
);

create table orders_items
( ordersid int unsigned not null,
  motobikeid char(13) not null,
  quantity tinyint unsigned,

  primary key (ordersid, motobikeid)

);
create table motobike_review
(
  motobikeid char(13) not null primary key,
  review text

);

Open phpmyadmin by starting XAMPP. Click on the Admin in line of MySQL or type in the address bar http://localhost/phpmyadmin/

Creating a database lovemotobikes.

1. Click the tab Databases.
2. Enter the name of the database, in this case lovemotobikes.
3. Select Collation utf8_general_ci.
4. Click the Create button.

Creating a table in the database lovemotobikes.

1. From the left pane select the database lovemotobikes.
2. Select the tab SQL.
3. Enter the code from the file lovemotobikes.sql.
4. Click Go button.

5. Click on the tab Structure.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.