在电商平台数据库中的商品表设计时,“商品名”字段最好选择()类型。A、textB、char(n)C、varchar(n)D、nvarchar(n)
在电商平台数据库中的商品表设计时,“商品名”字段最好选择()类型。
- A、text
- B、char(n)
- C、varchar(n)
- D、nvarchar(n)
相关考题:
(1)将考生文件夹下的自由表“商品”添加到数据库"DB1”中。(2)为表“商品”插入一条记录(“08000203”,“眼镜”,“00000008”)。(3)删除表“商品”中编码为“08000131”的记录。(4)修改表“商品”的字段,增加一个字段“单价,N(8,2)”。将(2)(3)(4)所用到的SQL,语句保存到“result.txt”中。
请编写一个函数char *fun(char *s,int n)。函数fun()的功能是将字符串s中的字符“循环左移”n位。例如,输入“ABCDE”,则循环左移2位应输出“CDEAB”,输入“1234567”,循环左移3位应输出“4567123”。注意:部分源程序已存在文件PROC13.cpp中。请勿修改主函数和其他函数中的任何内容,仅在函数fun()的花括号中填写若干语句。文件PROC13.cpp的内容如下://PROC13.cppinclude <iostream>include <string>using namespace std;char *fun(char *s,int n);int main(){char str[81];int n;cout<<"Enter a string(less than 80 char)\n”;cin>>str;cout<<"\n Enter n:";cin>>n;if(n>strlen(str)){cout<<"\n Data overflow";return 0;}cout<<"The result is: "<<fun(str,n)<<end1;return 0;}char *fun(char*s,int n){//* * * * * *}
从商品库的商品表1中查询出比所有商品单价的平均值要高的所有商品记录。提示:在where子句中使用子查询,在子查询中求单价的平均值所采用的函数为avg(单价)。假设使用名称为AAA的数据库,它包括Students(学号char (8),姓名varchar (8),年龄int,专业varchar (20),入学日期DateTime)和Score(学号char (8),课程名varchar (10),成绩numeric (5,2))两张表。
Visual FoxPro有如下数据库表stock.dbf,是7月30日沪深股市的收盘情况,请根据此表,完成下题:将stock表中增加一个新字段“交易量”,字段类型是数值型,宽度为8,应使用SQL语句( )。A. ALTER stock ALTER交易量N(8)B. ALTER TABLE stock交易量N(8)C. ALTER TABLE stock ADD交易量N(8)D. ALTER TABLE stock交易量WTIH N(8)
以下n变量赋值必须进行强制类型转换的是( )。A.int n;n=100+10;B.int n;n=100F+10;C.int n;short m=10;n=100+m;D.int n;short m=10;char s=2;n=s+m;
利用查询设计器设计查询时,下列叙述中错误的是()A、在设计多表查询时,必须设置两个表之间的联接类型,默认的联接类型是内联接B、在选择一个排序字段时,系统默认的排序方式为升序C、在“杂项”中设置查询结果的记录范围时,可以选择前N条记录或最后N条记录D、所选的分组字段可以不是查询输出字段
Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()A、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );B、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );C、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );D、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );
单选题Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()ACREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );BCREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );CCREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );DCREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );
单选题在电商平台数据库中的商品表设计时,“商品图片”字段存放图片的路径信息,最好选择()类型。AimageBtextCnvarchar(n)Ddatetime