-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDBMS_Practical2
87 lines (73 loc) · 3.02 KB
/
DBMS_Practical2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
prog22@prog22-OptiPlex-3070:~$ sudo mysql -u root -p
[sudo] password for prog22:
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.7.33-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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> create database Gamers1;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| Ajay |
| Assignment1 |
| Employee |
| Gamers |
| Gamers1 |
| Gamers2 |
| Student |
| abc |
| asg1 |
| assig1 |
| employee |
| kills |
| laxjan |
| mysql |
| performance_schema |
| samarth |
| student1 |
| sys |
+--------------------+
19 rows in set (0.00 sec)
mysql> use Gamers1;
Database changed
mysql> create table Gamers1Info(Id integer AUTO_INCREMENT,Name varchar(30),Played_Games varchar(30),Rank varchar(30),PRIMARY KEY(Id));
Query OK, 0 rows affected (0.23 sec)
mysql> insert into Gamers1Info (Id,Name, Played_Games, Rank) value(100,'Prathamesh','Chess','#1');
Query OK, 1 row affected (0.03 sec)
mysql> select * from Gamers1Info;
+-----+------------+--------------+------+
| Id | Name | Played_Games | Rank |
+-----+------------+--------------+------+
| 100 | Prathamesh | Chess | #1 |
+-----+------------+--------------+------+
1 row in set (0.00 sec)
mysql> insert into Gamers1Info (Id,Name, Played_Games, Rank) value(NULL,'Pratik','Carrom','#2');
Query OK, 1 row affected (0.03 sec)
mysql> select * from Gamers1Info;
+-----+------------+--------------+------+
| Id | Name | Played_Games | Rank |
+-----+------------+--------------+------+
| 100 | Prathamesh | Chess | #1 |
| 101 | Pratik | Carrom | #2 |
+-----+------------+--------------+------+
2 rows in set (0.00 sec)
mysql> insert into Gamers1Info (Id,Name, Played_Games, Rank) value(NULL,'Pratham','Badminton','#2');
Query OK, 1 row affected (0.03 sec)
mysql> select * from Gamers1Info;
+-----+------------+--------------+------+
| Id | Name | Played_Games | Rank |
+-----+------------+--------------+------+
| 100 | Prathamesh | Chess | #1 |
| 101 | Pratik | Carrom | #2 |
| 102 | Pratham | Badminton | #2 |
+-----+------------+--------------+------+
3 rows in set (0.00 sec)
mysql> insert into Gamers2Info (Id,Name, Played_Games, Rank) value(NULL,'Pratik','Carrom','#2')insert into Gamers2Info (Id,Name, Played_Games, Rank) value(NULL,'Pratik','Carrom','#2')insert into Gamers2Info (Id,Name, Played_Games, Rank) value(NULL,'Pratik','Carrom','#2')insert into Gamers2Info (Id,Name, Played_Games, Rank) value(NULL,'Pratik','Carrom','#2')