-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate35.sql
62 lines (46 loc) · 1.17 KB
/
create35.sql
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
# create database pqr
create database pqr;
/* create database having name is 123 */
create database 123;
/* create database having special character in its name */
create database a@r;
/* create database having alphanumeric name */
create database sql35;
create database 123sql;
create database mno;
/* show all the existing databases */
show databases;
/* wriet a query to drop a database */
drop database pqr;
/* write a query to use a particular database by default*/
use sql35;
/* Write a query to create a table student having columns SID,first_name,last_name,city,country */
create table student(
SID int,
First_Name char(50),
Last_Name char(50),
City char(50),
Country char(50));
/* write a query to describe a table table */
describe student;
desc student;
/* Write a query to drop a entire table */
drop table student;
show tables;
create table student(
SID int,
First_Name char(50),
Last_Name char(50),
City char(50),
Country char(50));
show tables;
drop table student;
create table student(
SID int,
First_Name char(50),
Last_Name char(50),
City char(50),
Country char(50));
/* Rename the table student as studentdata */
rename table student to studentdata;
show tables;