0% found this document useful (0 votes)
3 views

CProgram Files (x86)MySQLMySQL Server 5.1binmysql.exe9

The document details a MySQL session where a user connects to the server, shows databases, and creates a table named 'csc'. The user encounters multiple SQL syntax errors while trying to create the table and insert data, including issues with column names and duplicate primary keys. Eventually, the user successfully inserts several rows into the 'csc' table and retrieves the data.

Uploaded by

satyamandal1357
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

CProgram Files (x86)MySQLMySQL Server 5.1binmysql.exe9

The document details a MySQL session where a user connects to the server, shows databases, and creates a table named 'csc'. The user encounters multiple SQL syntax errors while trying to create the table and insert data, including issues with column names and duplicate primary keys. Eventually, the user successfully inserts several rows into the 'csc' table and retrieves the data.

Uploaded by

satyamandal1357
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Enter password: ****

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


Your MySQL connection id is 5
Server version: 5.1.73-community MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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> show databases;


+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| satyam |
| test |
+--------------------+
4 rows in set (0.01 sec)

mysql> use satyam;


Database changed
mysql> show tables;
+------------------+
| Tables_in_satyam |
+------------------+
| library |
+------------------+
1 row in set (0.00 sec)

mysql> drop library;


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 'library'
at line 1
mysql> drop table library;
Query OK, 0 rows affected (0.02 sec)

mysql> create table csc(serial no. int primary key , name varchar(90),mobile no.
int(100),email varchar(20),stream varchar(20),dob varchar(20);
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 'no. int
primary key , name varchar(90),mobile no. int(100),email varchar(20),str' at line 1
mysql> create table csc(serial no int primary key , name varchar(90),mobile no
int(100),email varchar(20),stream varchar(20),dob varc
har(20);
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 'no int
primary key , name varchar(90),mobile no int(100),email varchar(20),strea' at line
1
mysql> create table csc(sno int primary key , name varchar(90),mobile no
int(100),email varchar(20),stream varchar(20),dob varchar(20
);
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 'no
int(100),email varchar(20),stream varchar(20),dob varchar(20)' at line 1
mysql> create table csc(serial no int primary key , name varchar(90),mobile no
int(100),email varchar(20),stream varchar(20),dob varchar(20);
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 'no int
primary key , name varchar(90),mobile no int(100),email varchar(20),strea' at line
1
mysql> create table csc(serial no int primary key , name varchar(90),mobile no
int(20),email varchar(20),stream varchar(20),dob varch
ar(20);
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 'no int
primary key , name varchar(90),mobile no int(20),email varchar(20),stream' at line
1
mysql> create table csc(serial_no int primary key , name varchar(90),mobile_no
int(100),email varchar(20),stream varchar(20),dob varc
har(20);
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> create table csc(serial_no int primary key , name varchar(90),mobile_no
int(100),email varchar(20),stream varchar(20),dob varchar(20));
Query OK, 0 rows affected (0.03 sec)

mysql> insert into csc


value(1,'satyam',9093495267,'[email protected]','science','2007-11-04');
ERROR 1264 (22003): Out of range value for column 'mobile_no' at row 1
mysql> INSERT INTO csc (id, name, mobile_no, email, subject, date)
-> VALUES (1, 'satyam', '9093495267', '[email protected]', 'science', '2007-11-
04');
ERROR 1054 (42S22): Unknown column 'id' in 'field list'
mysql> INSERT INTO csc (id, name, mobile_no, email, subject, date)
-> INSERT INTO csc (id, name, mobile_no, email, subject, date)
-> ;
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 'INSERT
INTO csc (id, name, mobile_no, email, subject, date)' at line 2
mysql> INSERT INTO csc (serial no, name, mobile_no, email, subject, date)
-> VALUES (1, 'satyam', '9093495267', '[email protected]', 'science', '2007-11-
04');
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 'no,
name, mobile_no, email, subject, date)
VALUES (1, 'satyam', '9093495267', 's' at line 1
mysql> insert into csc
value(1,'satyam',9093495267,'[email protected]','science','2007-11-04');
ERROR 1264 (22003): Out of range value for column 'mobile_no' at row 1
mysql> create table csc(sno int primary key , name varchar(90),mobile no
int(100),email varchar(20),stream varchar(20),dob varchar(20);
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 'no
int(100),email varchar(20),stream varchar(20),dob varchar(20)' at line 1
mysql> create table csc(serial no. int primary key , name varchar(90),mobile no.
int(100),email varchar(20),stream varchar(20),dob varchar(20);
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 'no. int
primary key , name varchar(90),mobile no. int(100),email varchar(20),str' at line 1
mysql> insert into csc
value(1,'satyam',909349526778687976768,'[email protected]','science','2007-11-04');
ERROR 1264 (22003): Out of range value for column 'mobile_no' at row 1
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
Query OK, 1 row affected (0.01 sec)

mysql> insert into csc


value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql>
mysql> insert into csc
value(1,'satyam',909349526,'[email protected]','science','2007-11-04');
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
mysql> insert into csc
value(2,'shaurya',909349526,'[email protected]','science','2007-1-04');
Query OK, 1 row affected (0.01 sec)

mysql> insert into csc


value(3,'vinay',929349526,'[email protected]','commerce','2000-1-04');
Query OK, 1 row affected (0.02 sec)

mysql> insert into csc


value(4,'mohit',929349546,'[email protected]','commerce','2004-1-04');
Query OK, 1 row affected (0.01 sec)

mysql> insert into csc value(5,'vikas',929349506,'[email protected]','arts','2004-1-


09');
Query OK, 1 row affected (0.01 sec)

mysql> insert into csc value(6,'sankit',929349348,'[email protected]','arts','2006-


1-09');
Query OK, 1 row affected (0.01 sec)

mysql> select* from csc;


+-----------+---------+-----------+-------------------+----------+------------+
| serial_no | name | mobile_no | email | stream | dob |
+-----------+---------+-----------+-------------------+----------+------------+
| 1 | satyam | 909349526 | [email protected] | science | 2007-11-04 |
| 2 | shaurya | 909349526 | [email protected] | science | 2007-1-04 |
| 3 | vinay | 929349526 | [email protected] | commerce | 2000-1-04 |
| 4 | mohit | 929349546 | [email protected] | commerce | 2004-1-04 |
| 5 | vikas | 929349506 | [email protected] | arts | 2004-1-09 |
| 6 | sankit | 929349348 | [email protected] | arts | 2006-1-09 |
+-----------+---------+-----------+-------------------+----------+------------+
6 rows in set (0.00 sec)

mysql>

You might also like