Professional Documents
Culture Documents
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 33
Server version: 5.0.83-0ubuntu3 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database company;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database
|
+--------------------+
| information_schema |
| company
|
| company1
|
| employee
|
| harbour
|
| mysql
|
+--------------------+
6 rows in set (0.01 sec)
mysql> use company;
Database changed
mysql> create table employee
-> (fname varchar(20),
-> minit varchar(20),
-> lname varchar(20),
-> ssn int(9),
-> sex char(2),
-> salary float,
-> superssn int(9),
-> dno int(3)
-> )
-> ;
Query OK, 0 rows affected (0.09 sec)
mysql> create table department
-> (dname varchar(20),
-> dnumber int(3),
-> mgrssn int(9
-> ),
-> );
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 6
mysql> create table department (dname varchar(20), dnumber int(3), mgrssn int(9
) );
Query OK, 0 rows affected (0.00 sec)
mysql> create table dept_locations(dnumber int(3),dlocation varchar(30));
Query OK, 0 rows affected (0.00 sec)
mysql> create table project(pname varchar(2),pnumber int(3),plocation varchar(30
),dnum int(3));
Query OK, 0 rows affected (0.00 sec)
mysql> create table workson(essn int(9),pno int(3),hours int (2));
+-------+-------+--------+-----------+------+--------+-----------+------+
3 rows in set (0.03 sec)
mysql> exit
Bye
cclub@ubuntu:~$