mysql练习题及答案(国外英文资料).docVIP

  • 25
  • 0
  • 约1.65万字
  • 约 23页
  • 2017-06-10 发布于河南
  • 举报
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)

1亿VIP精品文档

相关文档