Wednesday, November 19, 2014

loop

/* Task 1

****
***
**
*


#include<stdio.h>

int main()
{
int i, j;

for (i = 4; i >= 0; i--)
{
for (j = i; j>0; j--)
{
printf("*");
}
printf("\n");
}
}

*/

/* Task 2

*
**
***
****

#include<stdio.h>

int main()
{
int i, j;

for (i = 0; i <= 4; i++)
{
for (j = 0; j<i; j++)
{
printf("*");
}
printf("\n");
}
}

*/

/* Task 3

   *
  * *  
 * * *
* * * *

#include<stdio.h>

int main()
{
int i, j, k;

for (i = 0; i <= 4; i++)
{
for (k = 1; k <= 4 - i; k++)
{
printf(" ");
}
for (j = 0; j<i; j++)
{
printf(" *");
}
printf("\n");
}
}

*/

/* Task 4

* * * *
 * * *
  * *
   *

#include<stdio.h>

int main()
{
int i, j, k;

for (i = 4; i >= 0; i--)
{
for (j = 0; j<i; j++)
{
printf(" *");
}
printf("\n");
for (k = 0; k <= 4 - i; k++)
{
printf(" ");
}
}
}
*/

/* Task 5

   *
  * *
 * * *
* * * * 
 * * *
  * *
   *


#include<stdio.h>

int main()
{
int  i, j, k;

for (i = 0; i <= 4; i++)
{
for (int j = 1; j <= 4 - i; j++)
{
printf(" ");
}
for (int j = 0; j<i; j++)
{
printf(" *");
}
printf("\n");
}

for (i = 2; i >= 0; i--)
{
for (k = 2 - i; k >= 0; k--)
{
printf(" ");
}
for (j = i; j >= 0; j--)
{
printf(" *");
}
printf("\n");
}

}

*/

Thursday, October 30, 2014

[R.G. Mechanics] FINAL FANTASY XIII.part094.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part001.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part002.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part003.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part004.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part005.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part006.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part007.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part008.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part009.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part010.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part011.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part012.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part013.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part014.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part015.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part016.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part017.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part018.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part019.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part020.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part021.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part022.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part023.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part024.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part025.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part026.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part027.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part028.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part029.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part030.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part031.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part032.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part033.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part034.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part035.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part036.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part037.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part038.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part039.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part040.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part041.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part042.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part043.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part044.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part045.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part046.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part047.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part048.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part049.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part050.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part051.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part052.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part053.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part054.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part055.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part056.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part057.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part058.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part059.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part060.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part061.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part062.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part063.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part064.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part065.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part066.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part067.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part068.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part069.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part070.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part071.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part072.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part073.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part074.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part075.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part076.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part077.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part078.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part079.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part080.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part081.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part082.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part083.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part084.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part085.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part086.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part087.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part088.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part089.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part090.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part091.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part092.rarТатах[R.G. Mechanics] FINAL FANTASY XIII.part093.rarТатах

Friday, October 17, 2014

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.17 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database 2014_10_17;
Query OK, 1 row affected (0.08 sec)

mysql> use 2014_10_17;
Database changed
mysql> create table
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(
ID varchar(8),
Department varchar(2),
Class int
)' at line 2
mysql> create table(ID varchar(8),Department varchar(2),Class int);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(ID v
archar(8),Department varchar(2),Class int)' at line 1
mysql> clear
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int
    -> Class int
    ->
    ->
    ->
    ->
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'Class
 int




)' at line 6
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int,
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '' at
line 5
mysql> delete table oyutan;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'table
 oyutan' at line 1
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Name varchar(35),
    -> Department varchar(2),
    -> Class int
    -> );
Query OK, 0 rows affected (0.50 sec)

mysql> create table hicheel
    -> (
    -> ID int,
    -> Name varchar(30),
    -> Credit int
    -> );
Query OK, 0 rows affected (0.31 sec)

mysql> create table hicheelsongolt
    -> (
    -> SID varchar(8),
    -> CID int
    -> );
Query OK, 0 rows affected (0.41 sec)

mysql> insert into oyutan values('CS11D002','Bat','CS','2');
Query OK, 1 row affected (0.06 sec)

mysql>
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.17 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database 2014_10_17;
Query OK, 1 row affected (0.08 sec)

mysql> use 2014_10_17;
Database changed
mysql> create table
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(
ID varchar(8),
Department varchar(2),
Class int
)' at line 2
mysql> create table(ID varchar(8),Department varchar(2),Class int);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(ID v
archar(8),Department varchar(2),Class int)' at line 1
mysql> clear
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int
    -> Class int
    ->
    ->
    ->
    ->
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'Class
 int




)' at line 6
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int,
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '' at
line 5
mysql> delete table oyutan;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'table
 oyutan' at line 1
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Name varchar(35),
    -> Department varchar(2),
    -> Class int
    -> );
Query OK, 0 rows affected (0.50 sec)

mysql> create table hicheel
    -> (
    -> ID int,
    -> Name varchar(30),
    -> Credit int
    -> );
Query OK, 0 rows affected (0.31 sec)

mysql> create table hicheelsongolt
    -> (
    -> SID varchar(8),
    -> CID int
    -> );
Query OK, 0 rows affected (0.41 sec)

mysql> insert into oyutan values('CS11D002','Bat','CS','2');
Query OK, 1 row affected (0.06 sec)

mysql>
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.17 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database 2014_10_17;
Query OK, 1 row affected (0.08 sec)

mysql> use 2014_10_17;
Database changed
mysql> create table
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(
ID varchar(8),
Department varchar(2),
Class int
)' at line 2
mysql> create table(ID varchar(8),Department varchar(2),Class int);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(ID v
archar(8),Department varchar(2),Class int)' at line 1
mysql> clear
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int
    -> Class int
    ->
    ->
    ->
    ->
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'Class
 int




)' at line 6
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Department varchar(2),
    -> Class int,
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '' at
line 5
mysql> delete table oyutan;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'table
 oyutan' at line 1
mysql> use 2014_10_17;
Database changed
mysql> create table oyutan
    -> (
    -> ID varchar(8),
    -> Name varchar(35),
    -> Department varchar(2),
    -> Class int
    -> );
Query OK, 0 rows affected (0.50 sec)

mysql> create table hicheel
    -> (
    -> ID int,
    -> Name varchar(30),
    -> Credit int
    -> );
Query OK, 0 rows affected (0.31 sec)

mysql> create table hicheelsongolt
    -> (
    -> SID varchar(8),
    -> CID int
    -> );
Query OK, 0 rows affected (0.41 sec)

mysql> insert into oyutan values('CS11D002','Bat','CS','2');
Query OK, 1 row affected (0.06 sec)

mysql>

Friday, October 3, 2014

33

  5 | 2012-12-06 |    3 | undaa       |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        6 |
  5 | 2012-12-06 |    1 | gurilan bvt |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        6 |
  5 | 2012-12-06 |    2 | zairmag     |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        6 |
  5 | 2012-12-06 |    3 | undaa       |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        6 |
  5 | 2012-12-06 |    1 | gurilan bvt |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        6 |
  5 | 2012-12-06 |    2 | zairmag     |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        6 |
  5 | 2012-12-06 |    3 | undaa       |
|    1 | atar talh                   |    1 |        650 |   100 |        3 |
  6 | 2012-12-06 |    1 | gurilan bvt |
|    1 | atar talh                   |    1 |        650 |   100 |        3 |
  6 | 2012-12-06 |    2 | zairmag     |
|    1 | atar talh                   |    1 |        650 |   100 |        3 |
  6 | 2012-12-06 |    3 | undaa       |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        3 |
  6 | 2012-12-06 |    1 | gurilan bvt |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        3 |
  6 | 2012-12-06 |    2 | zairmag     |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        3 |
  6 | 2012-12-06 |    3 | undaa       |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        3 |
  6 | 2012-12-06 |    1 | gurilan bvt |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        3 |
  6 | 2012-12-06 |    2 | zairmag     |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        3 |
  6 | 2012-12-06 |    3 | undaa       |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        3 |
  6 | 2012-12-06 |    1 | gurilan bvt |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        3 |
  6 | 2012-12-06 |    2 | zairmag     |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        3 |
  6 | 2012-12-06 |    3 | undaa       |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        3 |
  6 | 2012-12-06 |    1 | gurilan bvt |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        3 |
  6 | 2012-12-06 |    2 | zairmag     |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        3 |
  6 | 2012-12-06 |    3 | undaa       |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        3 |
  6 | 2012-12-06 |    1 | gurilan bvt |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        3 |
  6 | 2012-12-06 |    2 | zairmag     |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        3 |
  6 | 2012-12-06 |    3 | undaa       |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        3 |
  6 | 2012-12-06 |    1 | gurilan bvt |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        3 |
  6 | 2012-12-06 |    2 | zairmag     |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        3 |
  6 | 2012-12-06 |    3 | undaa       |
|    1 | atar talh                   |    1 |        650 |   100 |        5 |
 12 | 2012-12-05 |    1 | gurilan bvt |
|    1 | atar talh                   |    1 |        650 |   100 |        5 |
 12 | 2012-12-05 |    2 | zairmag     |
|    1 | atar talh                   |    1 |        650 |   100 |        5 |
 12 | 2012-12-05 |    3 | undaa       |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        5 |
 12 | 2012-12-05 |    1 | gurilan bvt |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        5 |
 12 | 2012-12-05 |    2 | zairmag     |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        5 |
 12 | 2012-12-05 |    3 | undaa       |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        5 |
 12 | 2012-12-05 |    1 | gurilan bvt |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        5 |
 12 | 2012-12-05 |    2 | zairmag     |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        5 |
 12 | 2012-12-05 |    3 | undaa       |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        5 |
 12 | 2012-12-05 |    1 | gurilan bvt |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        5 |
 12 | 2012-12-05 |    2 | zairmag     |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        5 |
 12 | 2012-12-05 |    3 | undaa       |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        5 |
 12 | 2012-12-05 |    1 | gurilan bvt |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        5 |
 12 | 2012-12-05 |    2 | zairmag     |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        5 |
 12 | 2012-12-05 |    3 | undaa       |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        5 |
 12 | 2012-12-05 |    1 | gurilan bvt |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        5 |
 12 | 2012-12-05 |    2 | zairmag     |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        5 |
 12 | 2012-12-05 |    3 | undaa       |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        5 |
 12 | 2012-12-05 |    1 | gurilan bvt |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        5 |
 12 | 2012-12-05 |    2 | zairmag     |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        5 |
 12 | 2012-12-05 |    3 | undaa       |
|    1 | atar talh                   |    1 |        650 |   100 |        5 |
  1 | 2012-12-05 |    1 | gurilan bvt |
|    1 | atar talh                   |    1 |        650 |   100 |        5 |
  1 | 2012-12-05 |    2 | zairmag     |
|    1 | atar talh                   |    1 |        650 |   100 |        5 |
  1 | 2012-12-05 |    3 | undaa       |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        5 |
  1 | 2012-12-05 |    1 | gurilan bvt |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        5 |
  1 | 2012-12-05 |    2 | zairmag     |
|    2 | zuiwan chex                 |    1 |        830 |   100 |        5 |
  1 | 2012-12-05 |    3 | undaa       |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        5 |
  1 | 2012-12-05 |    1 | gurilan bvt |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        5 |
  1 | 2012-12-05 |    2 | zairmag     |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |        5 |
  1 | 2012-12-05 |    3 | undaa       |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        5 |
  1 | 2012-12-05 |    1 | gurilan bvt |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        5 |
  1 | 2012-12-05 |    2 | zairmag     |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |        5 |
  1 | 2012-12-05 |    3 | undaa       |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        5 |
  1 | 2012-12-05 |    1 | gurilan bvt |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        5 |
  1 | 2012-12-05 |    2 | zairmag     |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |        5 |
  1 | 2012-12-05 |    3 | undaa       |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        5 |
  1 | 2012-12-05 |    1 | gurilan bvt |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        5 |
  1 | 2012-12-05 |    2 | zairmag     |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |        5 |
  1 | 2012-12-05 |    3 | undaa       |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        5 |
  1 | 2012-12-05 |    1 | gurilan bvt |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        5 |
  1 | 2012-12-05 |    2 | zairmag     |
|    7 | cocacola-330ml              |    3 |        100 |   500 |        5 |
  1 | 2012-12-05 |    3 | undaa       |
+------+-----------------------------+------+------------+-------+----------+---
----+------------+------+-------------+
168 rows in set (0.00 sec)

mysql> select * from baraa;
+------+-----------------------------+------+------------+-------+
| DD   | Name                        | Type | Unit_Price | Piece |
+------+-----------------------------+------+------------+-------+
|    1 | atar talh                   |    1 |        650 |   100 |
|    2 | zuiwan chex                 |    1 |        830 |   100 |
|    3 | ogooj-eeven                 |    1 |       2200 |    25 |
|    4 | alyaska zairmag-shokolodtai |    2 |        300 |   250 |
|    5 | alyaska zairmag-tsotsgiitei |    2 |        300 |   200 |
|    6 | pepsi-500ml                 |    3 |        750 |   300 |
|    7 | cocacola-330ml              |    3 |        100 |   500 |
+------+-----------------------------+------+------------+-------+
7 rows in set (0.00 sec)

mysql> select * from trade;
+----------+-------+------------+
| Baraa_DD | Piece | Ognoo      |
+----------+-------+------------+
|        1 |     3 | 2012-11-30 |
|        2 |     3 | 2012-12-03 |
|        1 |     1 | 2012-12-04 |
|        4 |    10 | 2012-12-05 |
|        6 |     5 | 2012-12-06 |
|        3 |     6 | 2012-12-06 |
|        5 |    12 | 2012-12-05 |
|        5 |     1 | 2012-12-05 |
+----------+-------+------------+
8 rows in set (0.00 sec)

mysql> select * from type;
+------+-------------+
| ID   | Name        |
+------+-------------+
|    1 | gurilan bvt |
|    2 | zairmag     |
|    3 | undaa       |
+------+-------------+
3 rows in set (0.00 sec)

mysql> alter table type add primary key(ID);
Query OK, 3 rows affected (0.82 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> alter table baraa add foreign key(Type) references type(ID);
Query OK, 7 rows affected (8.26 sec)
Records: 7  Duplicates: 0  Warnings: 0

mysql> alter table trade add foreign key(Baraa_DD) references type(ID);
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint f
ails (`supermarket`.`#sql-1374_1`, CONSTRAINT `#sql-1374_1_ibfk_1` FOREIGN KEY (
`Baraa_DD`) REFERENCES `type` (`ID`))
mysql> alter table baraa add primary key(DD);
Query OK, 7 rows affected (0.88 sec)
Records: 7  Duplicates: 0  Warnings: 0

mysql> alter table trade  add foreign key(Baraa_DD) references baraa(DD);
Query OK, 8 rows affected (0.78 sec)
Records: 8  Duplicates: 0  Warnings: 0

mysql> select * from baraa where Unit_Price>300;
+----+-------------+------+------------+-------+
| DD | Name        | Type | Unit_Price | Piece |
+----+-------------+------+------------+-------+
|  1 | atar talh   |    1 |        650 |   100 |
|  2 | zuiwan chex |    1 |        830 |   100 |
|  3 | ogooj-eeven |    1 |       2200 |    25 |
|  6 | pepsi-500ml |    3 |        750 |   300 |
+----+-------------+------+------------+-------+
4 rows in set (0.00 sec)

mysql> select baraa.Name,trade.Piece from baraa,trade where baraa.DD=trade.Baraa
.DD where Piece>5;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'where
 Piece>5' at line 1
mysql> select baraa.Name,trade.Piece from baraa,trade where baraa.DD=trade.Baraa
.DD and where Piece>5;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'where
 Piece>5' at line 1
mysql> select baraa.Name,trade.Piece from baraa,trade where baraa.DD=trade.Baraa
.DD;
ERROR 1054 (42S22): Unknown column 'trade.Baraa.DD' in 'where clause'
mysql> select baraa.Name,trade.Piece from baraa,trade where baraa.DD=trade.Baraa
_DD and where Piece>5;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'where
 Piece>5' at line 1
mysql> select baraa.Name,trade.Piece from baraa,trade where baraa.DD=trade.Baraa
_DD  where trade.Piece>5;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'where
 trade.Piece>5' at line 1
mysql> select baraa.Name,trade.Piece from baraa,trade where baraa.DD=trade.Baraa
_DD;
+-----------------------------+-------+
| Name                        | Piece |
+-----------------------------+-------+
| atar talh                   |     3 |
| atar talh                   |     1 |
| zuiwan chex                 |     3 |
| ogooj-eeven                 |     6 |
| alyaska zairmag-shokolodtai |    10 |
| alyaska zairmag-tsotsgiitei |    12 |
| alyaska zairmag-tsotsgiitei |     1 |
| pepsi-500ml                 |     5 |
+-----------------------------+-------+
8 rows in set (0.00 sec)

mysql> select baraa.Name,trade.Piece from baraa,trade where baraa.DD=trade.Baraa
_DD  where trade.Piece>5;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'where
 trade.Piece>5' at line 1
mysql> select baraa.Name,trade.Piece from baraa,trade where baraa.DD=trade.Baraa
_DD and trade.Piece>5;
+-----------------------------+-------+
| Name                        | Piece |
+-----------------------------+-------+
| ogooj-eeven                 |     6 |
| alyaska zairmag-shokolodtai |    10 |
| alyaska zairmag-tsotsgiitei |    12 |
+-----------------------------+-------+
3 rows in set (0.00 sec)

mysql> select sum(Piece) from trade;
+------------+
| sum(Piece) |
+------------+
|         41 |
+------------+
1 row in set (0.00 sec)

mysql> select sum(Piece) from baraa;
+------------+
| sum(Piece) |
+------------+
|       1475 |
+------------+
1 row in set (0.00 sec)

mysql> select * from baraa where trade>'2012.12.03';
ERROR 1054 (42S22): Unknown column 'trade' in 'where clause'
mysql> select * from trade where ognoo>'2012.12.03';
+----------+-------+------------+
| Baraa_DD | Piece | Ognoo      |
+----------+-------+------------+
|        1 |     1 | 2012-12-04 |
|        4 |    10 | 2012-12-05 |
|        6 |     5 | 2012-12-06 |
|        3 |     6 | 2012-12-06 |
|        5 |    12 | 2012-12-05 |
|        5 |     1 | 2012-12-05 |
+----------+-------+------------+
6 rows in set (0.00 sec)

mysql>

Tuesday, September 30, 2014

үсэгнүүд

фцужэнгшүзкъ\
йыбөахролдп
ячёсмитьвю

=№-"₮:._,%?ещ
+1234567890ЕЩ

ФЦУЖЭНГШҮЗКЪ
ЙЫБӨАХРОЛДП
ЯЧЁСМИТЬВЮ

+1234567890ЕЩ

Friday, September 26, 2014

22

,'1000');
Query OK, 1 row affected, 1 warning (0.03 sec)

mysql> insert into baraa values('EB1101', 'us butsal', '25000','China','0.5','75
0');
Query OK, 1 row affected, 1 warning (0.02 sec)

mysql> create table baraa1(code int(8), name char(50), price int(50),country cha
r(20), height float (20), number int (100));
Query OK, 0 rows affected (0.11 sec)

mysql> create table baraanuud(code char(8), name char(50), price int(50),country
 char(20), height float (20), number int (100));
Query OK, 0 rows affected (0.10 sec)

mysql> insert into baraanuud values('EB1010', 'Zuragt', '1500000','Yapon','5','1
00');
Query OK, 1 row affected (0.03 sec)

mysql> insert into baraanuud values('EB1101', 'Toos sorogch', '350000','China','
0.5','1000');
Query OK, 1 row affected (0.01 sec)

mysql> insert into baraanuud values('EB1101', 'us butsalgagch', '25000','China',
'0.5','750');
Query OK, 1 row affected (0.03 sec)

mysql> insert into baraanuud values('EB1212', 'us butsalgagch', '25000','China',
'0.5','750');
Query OK, 1 row affected (0.02 sec)

mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');
    '> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '5','1
0');
insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5',' at line
1
    '> ';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '';
'' at line 1
mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');
    '> ';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '5','1
0');
'' at line 1
mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand','5','1
0');
Query OK, 1 row affected (0.01 sec)

mysql> insert into baraanuud values('PC1123', 'Acer PC', '500000','Korea','5','1
0');
Query OK, 1 row affected (0.01 sec)

mysql> insert into baraanuud values('LP1010', 'Macbook Pro', '1500000','U.S.A','
2','10');
Query OK, 1 row affected (0.03 sec)

mysql> insert into baraanuud values('LP1211', 'Acer laptop', '1300000','Korea','
1','10');
Query OK, 1 row affected (0.02 sec)

mysql> select * from baraanuud;
+--------+----------------+---------+---------+--------+--------+
| code   | name           | price   | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt         | 1500000 | Yapon   |      5 |    100 |
| EB1101 | Toos sorogch   |  350000 | China   |    0.5 |   1000 |
| EB1101 | us butsalgagch |   25000 | China   |    0.5 |    750 |
| EB1212 | us butsalgagch |   25000 | China   |    0.5 |    750 |
| PC1212 | HP PC          |  450000 | Tailand |      5 |     10 |
| PC1123 | Acer PC        |  500000 | Korea   |      5 |     10 |
| LP1010 | Macbook Pro    | 1500000 | U.S.A   |      2 |     10 |
| LP1211 | Acer laptop    | 1300000 | Korea   |      1 |     10 |
+--------+----------------+---------+---------+--------+--------+
8 rows in set (0.12 sec)

mysql> select * from baraanuud where CODE like 'EB%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code   | name           | price   | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt         | 1500000 | Yapon   |      5 |    100 |
| EB1101 | Toos sorogch   |  350000 | China   |    0.5 |   1000 |
| EB1101 | us butsalgagch |   25000 | China   |    0.5 |    750 |
| EB1212 | us butsalgagch |   25000 | China   |    0.5 |    750 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.04 sec)

mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code   | name           | price   | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt         | 1500000 | Yapon   |      5 |    100 |
| EB1101 | Toos sorogch   |  350000 | China   |    0.5 |   1000 |
| EB1101 | us butsalgagch |   25000 | China   |    0.5 |    750 |
| LP1010 | Macbook Pro    | 1500000 | U.S.A   |      2 |     10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)

mysql> select * from baraanuud where CODE like '10%' order by CODE asc;
Empty set (0.00 sec)

mysql> select * from baraanuud where CODE like 'EB%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code   | name           | price   | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt         | 1500000 | Yapon   |      5 |    100 |
| EB1101 | Toos sorogch   |  350000 | China   |    0.5 |   1000 |
| EB1101 | us butsalgagch |   25000 | China   |    0.5 |    750 |
+--------+----------------+---------+---------+--------+--------+
3 rows in set (0.00 sec)

mysql> select * from baraanuud where price>'1000000';
+--------+-------------+---------+---------+--------+--------+
| code   | name        | price   | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt      | 1500000 | Yapon   |      5 |    100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A   |      2 |     10 |
| LP1211 | Acer laptop | 1300000 | Korea   |      1 |     10 |
+--------+-------------+---------+---------+--------+--------+
3 rows in set (0.02 sec)

mysql> select * from baraanuud where COUNTRY like 'korea'order by COUNTRY asc;
+--------+-------------+---------+---------+--------+--------+
| code   | name        | price   | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| PC1123 | Acer PC     |  500000 | Korea   |      5 |     10 |
| LP1211 | Acer laptop | 1300000 | Korea   |      1 |     10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)

mysql> select sum (height) from baraanuud;
ERROR 1305 (42000): FUNCTION baraa.sum does not exist
mysql> select sum(height) from baraanuud;
+-------------+
| sum(height) |
+-------------+
|        19.5 |
+-------------+
1 row in set (0.17 sec)

mysql> select * from baraanuud where CODE like '%10' order by CODE asc;
+--------+-------------+---------+---------+--------+--------+
| code   | name        | price   | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt      | 1500000 | Yapon   |      5 |    100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A   |      2 |     10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)

mysql> select sum(price) from baraanuud;
+------------+
| sum(price) |
+------------+
|    5650000 |
+------------+
1 row in set (0.02 sec)

mysql> select avg(price) from baraanuud;
+-------------+
| avg(price)  |
+-------------+
| 706250.0000 |
+-------------+
1 row in set (0.00 sec)

mysql> select min(price) from baraanuud;
+------------+
| min(price) |
+------------+
|      25000 |
+------------+
1 row in set (0.00 sec)

mysql> select * from baraanuud where price<'1000000';
+--------+----------------+--------+---------+--------+--------+
| code   | name           | price  | country | height | number |
+--------+----------------+--------+---------+--------+--------+
| EB1101 | Toos sorogch   | 350000 | China   |    0.5 |   1000 |
| EB1101 | us butsalgagch |  25000 | China   |    0.5 |    750 |
| EB1212 | us butsalgagch |  25000 | China   |    0.5 |    750 |
| PC1212 | HP PC          | 450000 | Tailand |      5 |     10 |
| PC1123 | Acer PC        | 500000 | Korea   |      5 |     10 |
+--------+----------------+--------+---------+--------+--------+
5 rows in set (0.00 sec)

mysql> select * from baraanuud where price 3500000x100'';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '35000
00x100''' at line 1
mysql> select * from baraanuud where price'1000000*10';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near ''1000
000*10'' at line 1
mysql> select * from baraanuud where price='1000000*10';
Empty set, 8 warnings (0.00 sec)

mysql> select * from baraanuud price='1000000*10';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '='100
0000*10'' at line 1
mysql> select price*number from baraanuud;
+--------------+
| price*number |
+--------------+
|    150000000 |
|    350000000 |
|     18750000 |
|     18750000 |
|      4500000 |
|      5000000 |
|     15000000 |
|     13000000 |
+--------------+
8 rows in set (0.04 sec)

mysql>
mysql> select name.zuragt price*number from baraanuud;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '*numb
er from baraanuud' at line 1
mysql> select (price*number) from baraanuud where name like 'zuragt';
+----------------+
| (price*number) |
+----------------+
|      150000000 |
+----------------+
1 row in set (0.01 sec)

mysql> select (height*number) from baraanuud where name like 'zuragt';
+-----------------+
| (height*number) |
+-----------------+
|             500 |
+-----------------+
1 row in set (0.00 sec)

mysql> select (height*number) and (price*number) from baraanuud where name like
'zuragt';
+------------------------------------+
| (height*number) and (price*number) |
+------------------------------------+
|                                  1 |
+------------------------------------+
1 row in set (0.01 sec)

mysql> select (height*number),(price*number) from baraanuud where name like 'zur
agt';
+-----------------+----------------+
| (height*number) | (price*number) |
+-----------------+----------------+
|             500 |      150000000 |
+-----------------+----------------+
1 row in set (0.00 sec)

mysql> select * from baraanuud where CODE like 'EB%10' order by CODE asc;
+--------+--------+---------+---------+--------+--------+
| code   | name   | price   | country | height | number |
+--------+--------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon   |      5 |    100 |
+--------+--------+---------+---------+--------+--------+
1 row in set (0.00 sec)

mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code   | name           | price   | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt         | 1500000 | Yapon   |      5 |    100 |
| EB1101 | Toos sorogch   |  350000 | China   |    0.5 |   1000 |
| EB1101 | us butsalgagch |   25000 | China   |    0.5 |    750 |
| LP1010 | Macbook Pro    | 1500000 | U.S.A   |      2 |     10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)

mysql> select * from baraanuud where CODE like '%10' order by CODE asc;
+--------+-------------+---------+---------+--------+--------+
| code   | name        | price   | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt      | 1500000 | Yapon   |      5 |    100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A   |      2 |     10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)

mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code   | name           | price   | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt         | 1500000 | Yapon   |      5 |    100 |
| EB1101 | Toos sorogch   |  350000 | China   |    0.5 |   1000 |
| EB1101 | us butsalgagch |   25000 | China   |    0.5 |    750 |
| LP1010 | Macbook Pro    | 1500000 | U.S.A   |      2 |     10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)

mysql> select * from baraanuud where CODE like '' order by CODE asc;