Enter password: *****
Welcome to the MySQL monitor.
Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.33-community
MySQL
Community Server (GPL)
Type 'help;' or '\h' for help. Type
'\c' to clear the buffer.
mysql> create database cmp;
Query OK, 1 row affected
(0.01 sec)
mysql> use cmp;
Database changed
mysql> create table emp
-> (
-> eid integer,
-> ename varchar(20),
-> eage integer,
-> ejob varchar(20),
-> esal integer
-> )
-> ;
Query OK, 0 rows affected
(0.06 sec)
mysql> select * from emp;
Empty set (0.00 sec)
mysql> insert into emp
(eid,ename,eage,ejob,esal)
values(1001,'Kumar',23,'Tech',1
8000);
Query OK, 1 row affected (0.05 sec)
mysql> select * from emp;
+------+-------+------+------+-------+
| eid
| ename | eage | ejob | esal |
+------+-------+------+------+-------+
| 1001 | Kumar | 23 | Tech | 18000 |
+------+-------+------+------+-------+
1 row in set (0.00 sec)
mysql> insert into
emp(eid,ename,eage,ejob,esal) values(1001,'Kumar',23,'Tech',1
8000);
Query OK, 1 row affected (0.03 sec)
mysql> select * from emp;
+------+-------+------+------+-------+
| eid
| ename | eage | ejob | esal |
+------+-------+------+------+-------+
| 1001 | Kumar | 23 | Tech | 18000 |
| 1001 | Kumar | 23 | Tech | 18000 |
+------+-------+------+------+-------+
2 rows in set (0.00 sec)
mysql> delete from emp;
Query OK, 2 rows affected (0.03 sec)
mysql> select * from emp;
Empty set (0.00 sec)
mysql> delete from emp where eid=1001;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table emp;
Query OK, 0 rows affected (0.05 sec)
mysql> select * from emp;
ERROR 1146 (42S02): Table
'cmp.emp' doesn't exist
mysql> create table emp
-> (
-> eid integer primary key,
-> ename varchar(20),
-> eage integer,
-> ejob varchar(20),
-> esal integer
-> );
Query OK, 0 rows affected (0.05 sec)
mysql> insert into emp
(eid,ename,eage,ejob,esal)
values(1001,'Kumar',23,'Tech',1
8000);
Query OK, 1 row affected (0.01 sec)
mysql> insert into emp
(eid,ename,eage,ejob,esal)
values(1001,'Kumar',23,'Tech',1
8000);
ERROR 1062 (23000):
Duplicate entry '1001' for key 'PRIMARY'
mysql> select * from emp;
+------+-------+------+------+-------+
| eid
| ename | eage | ejob | esal |
+------+-------+------+------+-------+
| 1001 | Kumar | 23 | Tech | 18000 |
+------+-------+------+------+-------+
1 row in set (0.00 sec)
|
Computer Science :: 11th/12th, Computer Engineering :: Degree/Diploma, Coding Concept ( C, C++ & JAVA Programming, JDBC Concept, DBMS - SQL Concept, Data Structure, Communication & Network Concept.
Thursday, February 5, 2015
MYSQL CODE CONCEPT
Subscribe to:
Post Comments (Atom)
-
1) Workbook - A workbook is like a book and consists worksheets. 2) Worksheet - A worksheet is working area consists rows and columns. By...
-
Programmingway: SSC ICT PAPER PATTERN : INFORMATION COMMUNICATION TECHNOLOGY (41) (E) (NEW COURSE) NOTE: - (i) All questions are compu...
-
Choose Eklavya, for Computer Education वाह रे जिंदगी, एक साल में बहुत कुछ दिखाया है तूने..!!
No comments:
Post a Comment