Sei sulla pagina 1di 11

Enter password: ****

Welcome to the MySQL monitor. Commands end with ; or \g.


Your MySQL connection id is 1
Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use company:


ERROR 1049 (42000): Unknown database 'company:'
mysql> use company;
ERROR 1049 (42000): Unknown database 'company'
mysql> create database sahil;
Query OK, 1 row affected (0.50 sec)

mysql> use sahil;


Database changed
mysql> create table customer(customer_no varchar(5),c_name varchar(50));
Query OK, 0 rows affected (1.70 sec)

mysql> alter table customer add primary key (customer_no);


Query OK, 0 rows affected (0.63 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> show databases;


+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| s |
| sahil |
| test |
+--------------------+
5 rows in set (0.16 sec)

mysql> alter table customer add constraint check(customer_no like 'c%');


Query OK, 0 rows affected (0.45 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> create table customer_order(order_no varchar(5),order_date date,order_amount


number(8),
-> customer_no varchar(5) references customer(customer_no));
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
'number(8),
customer_no varchar(5) references customer(customer_no))' at line 1
mysql> create table customer_order(order_no varchar(5),order_date date,customer_no
varchar(5) refrences customer(customer_no),order_amount number(8));
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
'refrences customer(customer_no),order_amount number(8))' at line 1
mysql> create table customer_order(order_no varchar(5),order_date date,customer_no
varchar(5) references customer(customer_no),order_amount number(8));
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
'number(8))' at line 1
mysql> create table customer_order(order_no varchar(5),order_date date,customer_no
varchar(5) references customer(customer_no),order_amount int(8));
Query OK, 0 rows affected (0.25 sec)
mysql> alter table customer_order add constraint check(order_no like 'o%');
Query OK, 0 rows affected (0.30 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> alter table customer_order add constraint primary key(order_no);


Query OK, 0 rows affected (0.20 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> alter table customer_order add constraint primary key(order_no)Enter


password: ****;
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 'Enter
password: ****' at line 1
mysql> Welcome to the MySQL monitor. Commands end with ; or \g.
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 'Welcome
to the MySQL monitor. Commands end with' 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 'or' at
line 1
-> Your MySQL connection id is 1
-> Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)
->
-> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
->
-> mysql> use company:
-> ERROR 1049 (42000): Unknown database 'company:'
-> mysql> use company;
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 '.
Your MySQL connection id is 1
Server version: 5.0.51b-community-nt MySQL Commu' at line 1
mysql> ERROR 1049 (42000): Unknown database 'company'
-> mysql> create database sahil;
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 'ERROR
1049 (42000): Unknown database 'company'
mysql> create database sahil' at line 1
mysql> Query OK, 1 row affected (0.50 sec)
->
-> mysql> use sahil;
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 'Query
OK, 1 row affected (0.50 sec)
mysql> use sahil' at line 1
mysql> Database changed
-> mysql> create table customer(customer_no varchar(5),c_name varchar(50));
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 'Database
changed
mysql> create table customer(customer_no varchar(5),c_name varc' at line 1
mysql> Query OK, 0 rows affected (1.70 sec)
->
-> mysql> alter table customer add primary key (customer_no);
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 'Query
OK, 0 rows affected (1.70 sec)
mysql> alter table customer add primary key' at line 1
mysql> Query OK, 0 rows affected (0.63 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> show databases;
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 'Query
OK, 0 rows affected (0.63 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' at line 1
mysql> +--------------------+
-> | Database |
-> +--------------------+
-> | information_schema |
-> | mysql |
-> | s |
-> | sahil |
-> | test |
-> +--------------------+
-> 5 rows in set (0.16 sec)
->
-> mysql> alter table customer add constraint check(customer_no like 'c%');
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
'+--------------------+
| Database |
+--------------------+
| informati' at line 1
mysql> Query OK, 0 rows affected (0.45 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> create table customer_order(order_no varchar(5),
->
->
->
->
->
->
->
->
->
->
->
->
-> Enter password: ****
-> Welcome to the MySQL monitor. Commands end with ; or \g.
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 'Query
OK, 0 rows affected (0.45 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' 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 'or' at
line 1
-> Your MySQL connection id is 1
-> Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)
->
-> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
->
-> mysql> use company:
-> ERROR 1049 (42000): Unknown database 'company:'
-> mysql> use company;
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 '.
Your MySQL connection id is 1
Server version: 5.0.51b-community-nt MySQL Commu' at line 1
mysql> ERROR 1049 (42000): Unknown database 'company'
-> mysql> create database sahil;
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 'ERROR
1049 (42000): Unknown database 'company'
mysql> create database sahil' at line 1
mysql> Query OK, 1 row affected (0.50 sec)
->
-> mysql> use sahil;
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 'Query
OK, 1 row affected (0.50 sec)
mysql> use sahil' at line 1
mysql> Database changed
-> mysql> create table customer(customer_no varchar(5),c_name varchar(50));
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 'Database
changed
mysql> create table customer(customer_no varchar(5),c_name varc' at line 1
mysql> Query OK, 0 rows affected (1.70 sec)
->
-> mysql> alter table customer add primary key (customer_no);
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 'Query
OK, 0 rows affected (1.70 sec)
mysql> alter table customer add primary key' at line 1
mysql> Query OK, 0 rows affected (0.63 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> show databases;
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 'Query
OK, 0 rows affected (0.63 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' at line 1
mysql> +--------------------+
-> | Database |
-> +--------------------+
-> | information_schema |
-> | mysql |
-> | s |
-> | sahil |
-> | test |
-> +--------------------+
-> 5 rows in set (0.16 sec)
->
-> mysql> alter table customer add constraint check(customer_no like 'c%');
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
'+--------------------+
| Database |
+--------------------+
| informati' at line 1
mysql> Query OK, 0 rows affected (0.45 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> create table customer_order(order_no varchar(5),
->
->
->
->
->
->
->
->
->
->
->
->
-> Enter password: ****
-> Welcome to the MySQL monitor. Commands end with ; or \g.
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 'Query
OK, 0 rows affected (0.45 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' 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 'or' at
line 1
-> Your MySQL connection id is 1
-> Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)
->
-> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
->
-> mysql> use company:
-> ERROR 1049 (42000): Unknown database 'company:'
-> mysql> use company;
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 '.
Your MySQL connection id is 1
Server version: 5.0.51b-community-nt MySQL Commu' at line 1
mysql> ERROR 1049 (42000): Unknown database 'company'
-> mysql> create database sahil;
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 'ERROR
1049 (42000): Unknown database 'company'
mysql> create database sahil' at line 1
mysql> Query OK, 1 row affected (0.50 sec)
->
-> mysql> use sahil;
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 'Query
OK, 1 row affected (0.50 sec)
mysql> use sahil' at line 1
mysql> Database changed
-> mysql> create table customer(customer_no varchar(5),c_name varchar(50));
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 'Database
changed
mysql> create table customer(customer_no varchar(5),c_name varc' at line 1
mysql> Query OK, 0 rows affected (1.70 sec)
->
-> mysql> alter table customer add primary key (customer_no);
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 'Query
OK, 0 rows affected (1.70 sec)
mysql> alter table customer add primary key' at line 1
mysql> Query OK, 0 rows affected (0.63 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> show databases;
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 'Query
OK, 0 rows affected (0.63 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' at line 1
mysql> +--------------------+
-> | Database |
-> +--------------------+
-> | information_schema |
-> | mysql |
-> | s |
-> | sahil |
-> | test |
-> +--------------------+
-> 5 rows in set (0.16 sec)
->
-> mysql> alter table customer add constraint check(customer_no like 'c%');
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
'+--------------------+
| Database |
+--------------------+
| informati' at line 1
mysql> Query OK, 0 rows affected (0.45 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> create table customer_order(order_no varchar(5),
->
->
->
->
->
->
->
->
->
->
->
->
-> Enter password: ****
-> Welcome to the MySQL monitor. Commands end with ; or \g.
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 'Query
OK, 0 rows affected (0.45 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' 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 'or' at
line 1
-> Your MySQL connection id is 1
-> Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)
->
-> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
->
-> mysql> use company:
-> ERROR 1049 (42000): Unknown database 'company:'
-> mysql> use company;
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 '.
Your MySQL connection id is 1
Server version: 5.0.51b-community-nt MySQL Commu' at line 1
mysql> ERROR 1049 (42000): Unknown database 'company'
-> mysql> create database sahil;
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 'ERROR
1049 (42000): Unknown database 'company'
mysql> create database sahil' at line 1
mysql> Query OK, 1 row affected (0.50 sec)
->
-> mysql> use sahil;
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 'Query
OK, 1 row affected (0.50 sec)
mysql> use sahil' at line 1
mysql> Database changed
-> mysql> create table customer(customer_no varchar(5),c_name varchar(50));
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 'Database
changed
mysql> create table customer(customer_no varchar(5),c_name varc' at line 1
mysql> Query OK, 0 rows affected (1.70 sec)
->
-> mysql> alter table customer add primary key (customer_no);
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 'Query
OK, 0 rows affected (1.70 sec)
mysql> alter table customer add primary key' at line 1
mysql> Query OK, 0 rows affected (0.63 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> show databases;
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 'Query
OK, 0 rows affected (0.63 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' at line 1
mysql> +--------------------+
-> | Database |
-> +--------------------+
-> | information_schema |
-> | mysql |
-> | s |
-> | sahil |
-> | test |
-> +--------------------+
-> 5 rows in set (0.16 sec)
->
-> mysql> alter table customer add constraint check(customer_no like 'c%');
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
'+--------------------+
| Database |
+--------------------+
| informati' at line 1
mysql> Query OK, 0 rows affected (0.45 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> create table customer_order(order_no varchar(5),
->
->
->
->
->
->
->
->
->
->
->
->
-> Enter password: ****
-> Welcome to the MySQL monitor. Commands end with ; or \g.
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 'Query
OK, 0 rows affected (0.45 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' 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 'or' at
line 1
-> Your MySQL connection id is 1
-> Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)
->
-> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
->
-> mysql> use company:
-> ERROR 1049 (42000): Unknown database 'company:'
-> mysql> use company;
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 '.
Your MySQL connection id is 1
Server version: 5.0.51b-community-nt MySQL Commu' at line 1
mysql> ERROR 1049 (42000): Unknown database 'company'
-> mysql> create database sahil;
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 'ERROR
1049 (42000): Unknown database 'company'
mysql> create database sahil' at line 1
mysql> Query OK, 1 row affected (0.50 sec)
->
-> mysql> use sahil;
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 'Query
OK, 1 row affected (0.50 sec)
mysql> use sahil' at line 1
mysql> Database changed
-> mysql> create table customer(customer_no varchar(5),c_name varchar(50));
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 'Database
changed
mysql> create table customer(customer_no varchar(5),c_name varc' at line 1
mysql> Query OK, 0 rows affected (1.70 sec)
->
-> mysql> alter table customer add primary key (customer_no);
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 'Query
OK, 0 rows affected (1.70 sec)
mysql> alter table customer add primary key' at line 1
mysql> Query OK, 0 rows affected (0.63 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> show databases;
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 'Query
OK, 0 rows affected (0.63 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' at line 1
mysql> +--------------------+
-> | Database |
-> +--------------------+
-> | information_schema |
-> | mysql |
-> | s |
-> | sahil |
-> | test |
-> +--------------------+
-> 5 rows in set (0.16 sec)
->
-> mysql> alter table customer add constraint check(customer_no like 'c%');
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
'+--------------------+
| Database |
+--------------------+
| informati' at line 1
mysql> Query OK, 0 rows affected (0.45 sec)
-> Records: 0 Duplicates: 0 Warnings: 0
->
-> mysql> create table customer_order(order_no varchar(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 'Query
OK, 0 rows affected (0.45 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysq' at line 1
mysql> show tables;
+-----------------+
| Tables_in_sahil |
+-----------------+
| customer |
| customer_order |
+-----------------+
2 rows in set (0.05 sec)

mysql> desc table


-> ;
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'
at line 1
mysql> desc customer;
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| customer_no | varchar(5) | NO | PRI | | |
| c_name | varchar(50) | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
2 rows in set (0.13 sec)

mysql> desc customer


->
-> _order;
Empty set (0.03 sec)

mysql> desc customer_order;


+--------------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+------------+------+-----+---------+-------+
| order_no | varchar(5) | NO | PRI | | |
| order_date | date | YES | | NULL | |
| customer_no | varchar(5) | YES | | NULL | |
| order_amount | int(8) | YES | | NULL | |
+--------------+------------+------+-----+---------+-------+
4 rows in set (0.06 sec)

mysql> alter table customer_order alter order_amount set default 0;


Query OK, 0 rows affected (0.16 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> desc customer_order;


+--------------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+------------+------+-----+---------+-------+
| order_no | varchar(5) | NO | PRI | | |
| order_date | date | YES | | NULL | |
| customer_no | varchar(5) | YES | | NULL | |
| order_amount | int(8) | YES | | 0 | |
+--------------+------------+------+-----+---------+-------+
4 rows in set (0.02 sec)

mysql> create table item(item_no varchar(5),item_name varchar(30),unit_price


int(5));
Query OK, 0 rows affected (0.34 sec)

mysql> show item


-> ;
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 'item' at
line 1
mysql> desc item;
+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| item_no | varchar(5) | YES | | NULL | |
| item_name | varchar(30) | YES | | NULL | |
| unit_price | int(5) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
3 rows in set (0.06 sec)

mysql> mysql> alter table item add constraint check(item_no like 'i%');
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 'mysql>
alter table item add constraint check(item_no like 'i%')' at line 1
mysql> mysql> alter table item add constraint c check(item_no like 'i%');
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 'mysql>
alter table item add constraint c check(item_no like 'i%')' at line 1
mysql> mysql> alter table item add constraint check(item_no like 'i%');
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 'mysql>
alter table item add constraint check(item_no like 'i%')' at line 1
mysql> mysql> alter table item add constraint check(item_no like 'i%');
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 'mysql>
alter table item add constraint check(item_no like 'i%')' at line 1
mysql> alter table item add constraint check(item_no like 'i%');
Query OK, 0 rows affected (0.17 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> desc item;


+------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+-------+
| item_no | varchar(5) | YES | | NULL | |
| item_name | varchar(30) | YES | | NULL | |
| unit_price | int(5) | YES | | NULL | |
+------------+-------------+------+-----+---------+-------+
3 rows in set (0.03 sec)

mysql> create table order_item(order_no varchar(5) references


cust_order(order_no),item_no varchar(5) references item(item_no),qty int(5));
Query OK, 0 rows affected (0.06 sec)

mysql> desc order_item;


+----------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------+------+-----+---------+-------+
| order_no | varchar(5) | YES | | NULL | |
| item_no | varchar(5) | YES | | NULL | |
| qty | int(5) | YES | | NULL | |
+----------+------------+------+-----+---------+-------+
3 rows in set (0.01 sec)

mysql>

Potrebbero piacerti anche