PTA Query the course number and course title score of the first 3 courses 3

This topic requires writing SQL statements,

Retrieve the records of the course numbers and course names of the first three courses in the course table.

Tip: Please use the SELECT statement to answer.

Table Structure:

Please write the SQL statement that defines the table structure here. For example:

CREATE TABLE course (
 cno char(7) ,
 cname varchar(20) NOT NULL,
  cpno char(7),
  ccredit int NOT NULL,
  PRIMARY KEY (cno)
) ;

table sample

Please give a table sample corresponding to the above table structure here. For example

course table:

Sample output:

Please give a sample output here. For example:

Code length limit 16 KB

Time limit 400 ms

DatabaseMySQL

The result output requires a strict comparison of the order and data

select cno, cname
from course
order by cno limit 3

Guess you like

Origin blog.csdn.net/weixin_70206677/article/details/129345061