-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6
More file actions
60 lines (41 loc) · 1.27 KB
/
6
File metadata and controls
60 lines (41 loc) · 1.27 KB
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
Hi, now we will see how we can print a specific column, how we can order information etc. Please see the following code. We are
going to learn a whole lot of things.
DROP TABLE student;
CREATE TABLE student(
student_id INT AUTO_INCREMENT,
name VARCHAR(15),
major VARCHAR(15),
PRIMARY KEY(student_id)
);
SELECT * FROM student;
SELECT major FROM student;
SELECT student_id,name FROM student;
SELECT student.name, student.major
FROM student;
SELECT student_id,major FROM student
ORDER BY major;
SELECT name,major FROM student
ORDER BY name DESC;
SELECT * FROM student
ORDER BY student_id DESC;
SELECT * FROM student
ORDER BY major ASC,student_id DESC;
SELECT * FROM student
LIMIT 2;
SELECT * FROM student
ORDER BY major
LIMIT 2;
SELECT * FROM student
WHERE major='EEE';
SELECT major,name FROM student
WHERE student_id>=4
ORDER BY student_id DESC
LIMIT 5;
SELECT * FROM student
WHERE name IN ('Mousumi','Mayabi','Minhaz');
INSERT INTO student(name,major) VALUES('Fokhrul','EEE');
INSERT INTO student(name,major) VALUES('Mrinal','EEE');
INSERT INTO student(name,major) VALUES('Rahima','BBA');
INSERT INTO student(name,major) VALUES('Mousumi','English');
INSERT INTO student(name,major) VALUES('Mayabi','Math');
INSERT INTO student(name,major) VALUES('Minhaz','IT');