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)
JAC Board Computer || IIT 2025 || Introductory Information Technology || Class 10 || Practical Examination 2025
Marks Division HOE 30 Marks IT Application Report File 20 Marks Viva - Voce 10 Marks 1) Write an HTML code to generate a web p...
-
1) TCP/IP - Transmission Control Protocol/ Internet Protocol. 2) HTTPs - Hyper Text Transfer Protocol. 3) ICT - Information Comunication Te...
-
1) What is Make Code Arcade? Answer: Make Code Arcade is a coding platform that enables to create block – based program. 2) How ...
-
Programmingway@Eklavya Technosys!: New Year's 2025 | Happiness & Healthier's Life Sty... : भारत कई धर्मों का संगम है, हिंदू, मुस...
No comments:
Post a Comment