Current location - Education and Training Encyclopedia - Resume - SQL creates student table (student), course, class table (class) and course selection table (XK), and I can reward QB for writing it correctly.
SQL creates student table (student), course, class table (class) and course selection table (XK), and I can reward QB for writing it correctly.
1, select DISTINCT Sdept from the students.

2. Select Count (different Cpno)

course

Where CNAME = "English";

3, create a table Student2

(SNO character (9) primary key,

SNAME CHAR(20) is unique,

Ssex CHAR(2),

Sbirthday SMALLINT,

Sdept CHAR(20)

);