- 1、本文档共23页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
mysql练习题及答案(国外英文资料)
mysql练习题及答案(国外英文资料)
Mysql query for statement exercises
The definition of Sutdent table
The field name field describes the primary key foreign key non-empty unique from the data type
The Id number INT (10) is not
Name VARCHAR (20) whether or not
Sex gender VARCHAR (4) whether no
Whether the Birth YEAR of Birth is YEAR after YEAR
Department Department VARCHAR (20) whether no
Address home Address VARCHAR (50) whether no
The definition of the Score table
The field name field describes the primary key foreign key non-empty unique from the data type
The Id number INT (10) is whether it is
The Stu_id number INT (10) is no
The name of the C_name class VARCHAR (20) is no or no
Grade score INT (10) whether no
1. Create student and score table
CREATE TABLE student
Id INT (10) NOT NULL UNIQUE PRIMARY KEY,
Name VARCHAR (20) NOT NULL,
Sex VARCHAR (4),
Birth YEAR.
Department VARCHAR (20),
Address VARCHAR (50)
);
Create the score table. SQL code is as follows:
CREATE TABLE score
Id INT (10) NOT NULL UNIQUE PRIMARY KEY AUTO_INCREMENT,
Stu_id INT (10) NOT NULL,
C_name VARCHAR (20),
Grade INT (10)
);
Add records for the student table and the score table
The INSERT statement that inserts records to the student table is as follows:
INSERT INTO student VALUES (901, boss, man, 1985, computer system, Beijing haidian district);
INSERT INTO student VALUES (902, 2, man, 1986, Chinese department, Beijing changping district);
INSERT INTO student VALUES (903, 3, girl, 1990, Chinese department, yongzhou, hunan);
INSERT INTO student VALUES (904, li 4, man, 1990, English department, fuxin city, liaoning province);
INSERT INTO student VALUES (905, wang 5, female, 1991, English department, xiamen city);
INSERT INTO student VALUES (906, wang 6, man, 1988, computer department, hengyang city, hunan);
Inserting the record INSERT statement to the score table is as follows:
INSERT INTO score VALUES (NULL, 901, computer, 98)
INSERT INTO score VALUES (NULL, 901, English, 80)
INSERT INTO score VALUES (NULL,
文档评论(0)